diff options
Diffstat (limited to 'src/occ_405/pss/apss.h')
-rw-r--r-- | src/occ_405/pss/apss.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/occ_405/pss/apss.h b/src/occ_405/pss/apss.h index ba0b775..0bd45ac 100644 --- a/src/occ_405/pss/apss.h +++ b/src/occ_405/pss/apss.h @@ -43,11 +43,12 @@ void dumpHexString(const void *i_data, const unsigned int len, const char *string); #endif -#define APSS_DATA_FAIL_PMAX_RAIL 16 //Number of steps before we lower Pmax_rail to nominal. This should allow for 4ms/16ticks with no APSS data. -#define APSS_DATA_FAIL_MAX 400 //Number of steps we reach before reseting OCC. This should allow for 100ms/400ticks with no APSS data. +#define APSS_DATA_FAIL_PMAX_RAIL 100 //Number of steps before we lower Pmax_rail to nominal. This should allow for 50ms/100 ticks with no APSS data. +#define APSS_DATA_FAIL_MAX 200 //Number of steps we reach before reseting OCC. This should allow for 100ms/200ticks with no APSS data. #define APSS_DATA_FAILURE_STEP 1 //Number of steps to increment FAIL_COUNT due to a failed APSS data collection. #define APSS_ERRORLOG_RESET_THRESHOLD 16 //When to allow apss tasks to log another error if count goes back to 0 again. #define APSS_MAX_NUM_INIT_RETRIES 2 +#define APSS_MAX_NUM_RESET_RETRIES 3 extern uint16_t G_apss_fail_updown_count; //Used to keep count of number of APSS data collection fails. //Decrement APSS_FAIL_COUNT to 0. @@ -58,6 +59,13 @@ extern uint16_t G_apss_fail_updown_count; //Used to keep count of number of (G_apss_fail_updown_count += APSS_DATA_FAILURE_STEP): \ (G_apss_fail_updown_count = APSS_DATA_FAIL_MAX);} +// Apss reset task is run every other tic (1 ms) +#define APSS_RESET_STATE_START 0 +#define APSS_RESET_STATE_WAIT_1MS 1 +#define APSS_RESET_STATE_WAIT_DONE 51 // Wait 50 ms +#define APSS_RESET_STATE_REINIT 52 +#define APSS_RESET_STATE_COMPLETE 53 + struct apssPwrMeasStruct { uint16_t adc[MAX_APSS_ADC_CHANNELS]; @@ -86,10 +94,12 @@ extern uint64_t G_gpe_apss_time_end; void task_apss_start_pwr_meas(task_t *i_self); void task_apss_continue_pwr_meas(task_t *i_self); void task_apss_complete_pwr_meas(task_t *i_self); +void task_apss_reset(task_t *i_self); void apss_test_pwr_meas(); // used to test measurements void reformat_meas_data(); bool apss_gpio_get(uint8_t i_pin_number, uint8_t *o_pin_value); errlHndl_t initialize_apss(void); +extern volatile bool G_apss_recovery_requested; #endif //_APSS_H |