Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-STM32F103C8T6 eeprom_flash Watchdog PinDetect DS1820
Diff: main.cpp
- Revision:
- 56:522ad08941bb
- Parent:
- 55:3378972851fd
- Child:
- 57:9bf4c8142958
--- a/main.cpp Sat Oct 06 09:16:46 2018 +0000
+++ b/main.cpp Sun Oct 07 05:53:12 2018 +0000
@@ -32,6 +32,8 @@
DigitalOut pomp_OFF(PA_12); // pomp off
DigitalOut heater_OFF(PA_15); // heater off
+DigitalOut reset_wifi(PA_4); // reset WIFI
+
// This function is called when a character goes into the RX buffer.
void rxCallback() {
char c;
@@ -198,6 +200,14 @@
};
};
+void flushSerialBuffer(void) {
+ char char1 = 0;
+ while (pc.readable()) {
+ char1 = pc.getc();
+ };
+ return;
+};
+
int main() {
@@ -205,6 +215,7 @@
heater_OFF = 1;
pomp_OFF = 1;
+ reset_wifi = 0;
eeprom_config_value = get_temp_config_value();
working_mode = (char)get_mode_config_value();
@@ -215,15 +226,19 @@
pb.mode(PullUp);
// Delay for initial pullup to take effect
- wait(.005);
+ wait(.15);
+
+ reset_wifi = 1; // starts esp8266
pb.attach_deasserted(&pb_hit_interrupt);
pb.attach_asserted(&pb_out_interrupt);
//pb.rise(&pb_out_interrupt);
pb.setSampleFrequency();
+
pc.attach(&rxCallback, Serial::RxIrq);
pc.baud(19200);
+ flushSerialBuffer();
pc.printf("\r\nNaumovich 2.0\r\n");
blink_myled(3);