From b7cfc2b3eadf9dd69b70cdd80b62cdbd577d4872 Mon Sep 17 00:00:00 2001 From: Miducc Date: Fri, 23 Jun 2023 09:33:29 +0700 Subject: [PATCH] Config initial settings when powering-up and start detecting smoke --- Customizable_Smoke_Detector_Ver2.c | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Customizable_Smoke_Detector_Ver2.c 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