sync_detector still not working...

This commit is contained in:
2025-12-20 14:41:55 +03:00
parent c930b503c2
commit 179dfd8d9c
19 changed files with 5389 additions and 4909 deletions

View File

@ -79,15 +79,17 @@ void Error_Handler(void);
#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 sum_ON;
uint32_t sum_OFF;
uint32_t avg_ON;
uint32_t avg_OFF;
uint32_t N;
};
struct ADC_proc_typedef {
uint8_t status; /* 0 - stopped, 1 - collecting, 2 - filled */
uint32_t sum;
uint32_t sum_ON;
uint32_t sum_OFF;
uint32_t avg_ON;
uint32_t avg_OFF;
uint32_t N; /* number of ON/OFF pairs accumulated */
uint32_t N_on; /* number of ON samples accumulated */
uint32_t N_off; /* number of OFF samples accumulated */
};
/* Sweep state shared between ISR and main */
struct Sweep_state_typedef {
@ -101,9 +103,10 @@ struct Sweep_state_typedef {
/* Externs provided by main.c */
extern volatile struct ADC_proc_typedef ADC_proc;
extern volatile struct ADC_proc_typedef ADC_proc_shadow;
extern volatile struct Sweep_state_typedef Sweep_state;
extern volatile uint32_t curr_step_start_N;
extern uint16_t ADC1_buff_circular[ADC_BUFF_SIZE];
extern volatile struct Sweep_state_typedef Sweep_state;
extern volatile uint32_t curr_step_start_N;
extern uint16_t ADC1_buff_circular[ADC_BUFF_SIZE];
extern volatile uint32_t sample_seq;
/* USER CODE END Private defines */