Simple config init impl
This commit is contained in:
26
src/main.cpp
26
src/main.cpp
@@ -1,16 +1,16 @@
|
||||
#include "flags.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "modules/lcd/lcd.h"
|
||||
#include "modules/config/config.h"
|
||||
#include "modules/gps/gps.h"
|
||||
#include "modules/lcd/lcd.h"
|
||||
#include "modules/logger/system_logger.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
system_logger *logger_output = new system_logger(&Serial);
|
||||
|
||||
lcd *driver_display = new lcd();
|
||||
lcd *driver_display = new lcd(logger_output);
|
||||
gps *gps_module = new gps(&Serial2, logger_output);
|
||||
|
||||
config *system_config = new config(logger_output);
|
||||
|
||||
void setup() {
|
||||
driver_display->init();
|
||||
@@ -22,13 +22,21 @@ void setup() {
|
||||
delay(500);
|
||||
driver_display->print_message("Serial Init Complete");
|
||||
delay(500);
|
||||
|
||||
|
||||
driver_display->print_message("Config Init...");
|
||||
int result = system_config->auto_init();
|
||||
delay(500);
|
||||
if (result != 0) {
|
||||
driver_display->print_message("Configuration Read Failed");
|
||||
} else {
|
||||
driver_display->print_message("Config Init Complete");
|
||||
}
|
||||
delay(500);
|
||||
|
||||
driver_display->print_message("GPS Init...");
|
||||
gps_module->init();
|
||||
delay(500);
|
||||
driver_display->print_message("GPS Init Complete");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
gps_module->parse_task(500);
|
||||
}
|
||||
void loop() { gps_module->parse_task(500); }
|
||||
|
||||
Reference in New Issue
Block a user