implemented sync_detector logic. But it is a bit buggy: data stored in avg_ON is very similar to avg_OFF. But while sync_detector phase is inverted -- both behave the same way

This commit is contained in:
2025-12-19 23:20:55 +03:00
parent eb6cb9b762
commit 186ad1939a
19 changed files with 5244 additions and 4772 deletions

View File

@ -76,11 +76,16 @@ void Error_Handler(void);
#define ADC_BUFF_SIZE 50
#endif
#define SYNC_DET_ON
/* Structure describing simple accumulation state for ADC processing */
struct ADC_proc_typedef {
uint8_t status; /* 0 - stopped, 1 - collecting, 2 - filled */
uint32_t sum;
uint32_t avg;
uint32_t sum_ON;
uint32_t sum_OFF;
uint32_t avg_ON;
uint32_t avg_OFF;
uint32_t N;
};