reduced frequency of modbus rtu status messages on error

master
Mateusz Lubecki 2023-10-11 18:28:37 +02:00
rodzic cf5f6687aa
commit c219a6b7d6
4 zmienionych plików z 20 dodań i 20 usunięć

Wyświetl plik

@ -21,7 +21,7 @@
//#endif //#endif
#define RTU_NUMBER_OF_ERRORS_TO_TRIG_STATUS 32 #define RTU_NUMBER_OF_ERRORS_TO_TRIG_STATUS 128
#define RTU_POOL_QUEUE_LENGHT 6 #define RTU_POOL_QUEUE_LENGHT 6

Wyświetl plik

@ -114,13 +114,13 @@ extern int8_t pwr_save_currently_cutoff;
void pwr_save_init(config_data_powersave_mode_t mode); void pwr_save_init(config_data_powersave_mode_t mode);
int pwr_save_switch_mode_to_c0(void); int pwr_save_switch_mode_to_c0(void);
int pwr_save_switch_mode_to_c1(void); int pwr_save_switch_mode_to_c1(void);
//void pwr_save_switch_mode_to_c2(void); void pwr_save_switch_mode_to_c2(void);
//void pwr_save_switch_mode_to_c3(void); void pwr_save_switch_mode_to_c3(void);
//int pwr_save_switch_mode_to_m4(void); int pwr_save_switch_mode_to_m4(void);
//int pwr_save_switch_mode_to_m4a(void); int pwr_save_switch_mode_to_m4a(void);
//void pwr_save_switch_mode_to_i5(void); void pwr_save_switch_mode_to_i5(void);
//void pwr_save_switch_mode_to_l6(uint16_t sleep_time); void pwr_save_switch_mode_to_l6(uint16_t sleep_time);
//void pwr_save_switch_mode_to_l7(uint16_t sleep_time); void pwr_save_switch_mode_to_l7(uint16_t sleep_time);
config_data_powersave_mode_t pwr_save_pooling_handler(const config_data_mode_t * config, const config_data_basic_t * timers, int16_t minutes_to_wx, uint16_t vbatt); // this should be called from 10 seconds pooler config_data_powersave_mode_t pwr_save_pooling_handler(const config_data_mode_t * config, const config_data_basic_t * timers, int16_t minutes_to_wx, uint16_t vbatt); // this should be called from 10 seconds pooler
#endif #endif

Wyświetl plik

@ -368,7 +368,7 @@ int pwr_save_switch_mode_to_c1(void) {
// this mode is not avaliable in HW Revision B as internal radio // this mode is not avaliable in HW Revision B as internal radio
// is powered from +5V_S and external one is switched on with the same // is powered from +5V_S and external one is switched on with the same
// line which controls +4V_G // line which controls +4V_G
static void pwr_save_switch_mode_to_c2(void) { void pwr_save_switch_mode_to_c2(void) {
if ((REGISTER & ALL_STATES_BITMASK) == IN_C2_STATE) { if ((REGISTER & ALL_STATES_BITMASK) == IN_C2_STATE) {
return; return;
@ -408,7 +408,7 @@ static void pwr_save_switch_mode_to_c2(void) {
} }
static void pwr_save_switch_mode_to_c3(void) { void pwr_save_switch_mode_to_c3(void) {
if ((REGISTER & ALL_STATES_BITMASK) == IN_C3_STATE) { if ((REGISTER & ALL_STATES_BITMASK) == IN_C3_STATE) {
return; return;
@ -446,7 +446,7 @@ static void pwr_save_switch_mode_to_c3(void) {
} }
// in HW-RevB this will keep internal VHF radio module working! // in HW-RevB this will keep internal VHF radio module working!
static int pwr_save_switch_mode_to_m4(void) { int pwr_save_switch_mode_to_m4(void) {
if ((REGISTER & ALL_STATES_BITMASK) == IN_M4_STATE) { if ((REGISTER & ALL_STATES_BITMASK) == IN_M4_STATE) {
return 0; return 0;
@ -487,7 +487,7 @@ static int pwr_save_switch_mode_to_m4(void) {
return 1; return 1;
} }
static int pwr_save_switch_mode_to_m4a(void) { int pwr_save_switch_mode_to_m4a(void) {
if ((REGISTER & ALL_STATES_BITMASK) == IN_M4_STATE) { if ((REGISTER & ALL_STATES_BITMASK) == IN_M4_STATE) {
return 0; return 0;
} }
@ -524,7 +524,7 @@ static int pwr_save_switch_mode_to_m4a(void) {
return 1; return 1;
} }
static void pwr_save_switch_mode_to_i5(void) { void pwr_save_switch_mode_to_i5(void) {
if ((REGISTER & ALL_STATES_BITMASK) == IN_I5_STATE) { if ((REGISTER & ALL_STATES_BITMASK) == IN_I5_STATE) {
return; return;
@ -565,7 +565,7 @@ static void pwr_save_switch_mode_to_i5(void) {
} }
// this will keep external VHF radio working in HW-RevB // this will keep external VHF radio working in HW-RevB
static void pwr_save_switch_mode_to_l6(uint16_t sleep_time) { void pwr_save_switch_mode_to_l6(uint16_t sleep_time) {
uint16_t counter = 0; uint16_t counter = 0;
@ -652,7 +652,7 @@ static void pwr_save_switch_mode_to_l6(uint16_t sleep_time) {
} }
static void pwr_save_switch_mode_to_l7(uint16_t sleep_time) { void pwr_save_switch_mode_to_l7(uint16_t sleep_time) {
uint16_t counter = 0; uint16_t counter = 0;

Wyświetl plik

@ -224,11 +224,11 @@ int32_t rtu_serial_pool(void) {
rte_rtu_number_of_serial_io_errors++; rte_rtu_number_of_serial_io_errors++;
// stupid workaround. If there is a lot of I/O errors reset the controller // stupid workaround. If there is a lot of I/O errors reset the controller
// no more stupid workarounds here
if (rte_rtu_number_of_serial_io_errors >= 0xF0) // if (rte_rtu_number_of_serial_io_errors >= 0xF0)
{ // {
rte_main_reboot_req = 1; // rte_main_reboot_req = 1;
} // }
// latch the current value of last successfull communication // latch the current value of last successfull communication
rtu_time_of_last_succ_comm_at_previous_error_status = rtu_time_of_last_successfull_comm; rtu_time_of_last_succ_comm_at_previous_error_status = rtu_time_of_last_successfull_comm;