kopia lustrzana https://github.com/SP8EBC/ParaTNC
initialize io for buttons only if there is any function configured to them
rodzic
45d02a7486
commit
00f222ab98
|
@ -35,6 +35,6 @@
|
||||||
/**
|
/**
|
||||||
* Do not uncomment this on production devices
|
* Do not uncomment this on production devices
|
||||||
*/
|
*/
|
||||||
#define INHIBIT_CUTOFF
|
//#define INHIBIT_CUTOFF
|
||||||
|
|
||||||
#endif /* INCLUDE_PWR_SAVE_CONFIGURATION_H_ */
|
#endif /* INCLUDE_PWR_SAVE_CONFIGURATION_H_ */
|
||||||
|
|
20
src/main.c
20
src/main.c
|
@ -505,6 +505,12 @@ int main(int argc, char* argv[]){
|
||||||
configuration_handler_load_configuration(REGION_DEFAULT);
|
configuration_handler_load_configuration(REGION_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set function for left button
|
||||||
|
main_button_one_left = configuration_get_left_button();
|
||||||
|
|
||||||
|
// set function for right button
|
||||||
|
main_button_two_right = configuration_get_right_button();
|
||||||
|
|
||||||
// set packets intervals
|
// set packets intervals
|
||||||
packet_tx_configure(main_config_data_basic->wx_transmit_period, main_config_data_basic->beacon_transmit_period, main_config_data_mode->powersave);
|
packet_tx_configure(main_config_data_basic->wx_transmit_period, main_config_data_basic->beacon_transmit_period, main_config_data_mode->powersave);
|
||||||
|
|
||||||
|
@ -567,6 +573,11 @@ int main(int argc, char* argv[]){
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PARAMETEO)
|
#if defined(PARAMETEO)
|
||||||
|
if (main_button_one_left != BUTTON_DISABLED || main_button_two_right != BUTTON_DISABLED) {
|
||||||
|
// initializing GPIO used for buttons
|
||||||
|
io_buttons_init();
|
||||||
|
}
|
||||||
|
|
||||||
// initialize all powersaving functions
|
// initialize all powersaving functions
|
||||||
pwr_save_init(main_config_data_mode->powersave);
|
pwr_save_init(main_config_data_mode->powersave);
|
||||||
|
|
||||||
|
@ -580,9 +591,6 @@ int main(int argc, char* argv[]){
|
||||||
// initializing GPIO used for swithing on and off voltages on pcb
|
// initializing GPIO used for swithing on and off voltages on pcb
|
||||||
io_pwr_init();
|
io_pwr_init();
|
||||||
|
|
||||||
// initializing GPIO used for buttons
|
|
||||||
io_buttons_init();
|
|
||||||
|
|
||||||
// initialize sensor power control and switch off supply voltage
|
// initialize sensor power control and switch off supply voltage
|
||||||
wx_pwr_switch_init();
|
wx_pwr_switch_init();
|
||||||
|
|
||||||
|
@ -603,12 +611,6 @@ int main(int argc, char* argv[]){
|
||||||
// initializing UART gpio pins
|
// initializing UART gpio pins
|
||||||
io_uart_init();
|
io_uart_init();
|
||||||
|
|
||||||
// set function for left button
|
|
||||||
main_button_one_left = configuration_get_left_button();
|
|
||||||
|
|
||||||
// set function for right button
|
|
||||||
main_button_two_right = configuration_get_right_button();
|
|
||||||
|
|
||||||
#if defined(STM32F10X_MD_VL)
|
#if defined(STM32F10X_MD_VL)
|
||||||
// enabling the clock for both USARTs
|
// enabling the clock for both USARTs
|
||||||
RCC->APB2ENR |= RCC_APB2ENR_USART1EN;
|
RCC->APB2ENR |= RCC_APB2ENR_USART1EN;
|
||||||
|
|
Ładowanie…
Reference in New Issue