commit b7cfc2b3eadf9dd69b70cdd80b62cdbd577d4872 Author: Miducc Date: Fri Jun 23 09:33:29 2023 +0700 Config initial settings when powering-up and start detecting smoke diff --git a/Customizable_Smoke_Detector_Ver2.c b/Customizable_Smoke_Detector_Ver2.c new file mode 100644 index 0000000..46af46d --- /dev/null +++ b/Customizable_Smoke_Detector_Ver2.c @@ -0,0 +1,33 @@ +#include "BA45F5250.h" +#include "stdint.h" +#include "build-in.h" +#include "system_function.h" +#include "osc_configuration.h" +#include "uart_configuration.h" +#include "afe_configuration.h" +#include "ad_converter.h" +#include "eeprom_rw.h" +#include "timer_module.h" +#include "gpio_configuration.h" + +void main() +{ + if(_to == 0 || _pdf == 0) + { + ram_erase(0); + ram_erase(1); + osc_init(); + uart_init(); + opa_config(); + adc_config(); + buzz_init(); + gpio_config(); + _pton = 0; + } + while(1) + { + GCC_CLRWDT(); + afe_init(); + delay(200); + } +} \ No newline at end of file