Compare commits
3 Commits
e346c67e00
...
e75f21ccf6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e75f21ccf6 | ||
|
|
0909c180e8 | ||
|
|
cfe15f2612 |
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -11,3 +11,5 @@
|
|||||||
do { \
|
do { \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
#define CRANK(num) ringBufferRead(&state_g.crank_RB, num);
|
||||||
|
#define CAM(num) ringBufferRead(&state_g.cam_RB, num);
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -16,7 +16,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