added cam double trigger and pragma once in GS
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (C) 2026 Pierre Barbier <pierrebarbier741@gmail.com>
|
// Copyright (C) 2026 Pierre Barbier <pierrebarbier741@gmail.com>
|
||||||
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#pragma once
|
||||||
#include <ring_buffer.h>
|
#include <ring_buffer.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "cmsis_os2.h"
|
#include "cmsis_os2.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "global_state.h"
|
||||||
#include "ring_buffer.h"
|
#include "ring_buffer.h"
|
||||||
#include "tasks.h"
|
#include "tasks.h"
|
||||||
|
|
||||||
@@ -17,7 +18,10 @@ void camHandler(void *argument) {
|
|||||||
ringBufferRead(&state_g.cam_RB, 0));
|
ringBufferRead(&state_g.cam_RB, 0));
|
||||||
|
|
||||||
// FILTERS
|
// FILTERS
|
||||||
|
if (CAM_TRIGD) {
|
||||||
|
ringBufferRevert(state_g.cam_RB,1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
state_g.cam_state = CAM_TRIGD;
|
state_g.cam_state = CAM_TRIGD;
|
||||||
state_g.cam_miss_ctr = 0;
|
state_g.cam_miss_ctr = 0;
|
||||||
switch (state_g.sync_state) {
|
switch (state_g.sync_state) {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ void crankHandler(void *argument) {
|
|||||||
DEBUG_LOG("Crank pulse detected at: %lu\n\r",
|
DEBUG_LOG("Crank pulse detected at: %lu\n\r",
|
||||||
ringBufferRead(&state_g.crank_RB, 0));
|
ringBufferRead(&state_g.crank_RB, 0));
|
||||||
// FILTER
|
// FILTER
|
||||||
|
|
||||||
// INCREMENT SWITCH
|
// INCREMENT SWITCH
|
||||||
switch (state_g.crank_state) {
|
switch (state_g.crank_state) {
|
||||||
case CYCLE_COMPRESSION: {
|
case CYCLE_COMPRESSION: {
|
||||||
|
|||||||
Reference in New Issue
Block a user