Updated main.cpp
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -1,27 +1,31 @@
|
|||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
|
|
||||||
|
#include "modules/cmd/cmd.h"
|
||||||
#include "modules/config/config.h"
|
#include "modules/config/config.h"
|
||||||
#include "modules/gps/gps.h"
|
#include "modules/gps/gps.h"
|
||||||
#include "modules/lcd/lcd.h"
|
#include "modules/lcd/lcd.h"
|
||||||
#include "modules/logger/system_logger.h"
|
#include "modules/logger/system_logger.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
|
||||||
system_logger *logger_output = new system_logger(&Serial);
|
system_logger *logger_output = new system_logger(&Serial);
|
||||||
|
|
||||||
lcd *driver_display = new lcd(logger_output);
|
lcd *driver_display = new lcd(logger_output);
|
||||||
gps *gps_module = new gps(&Serial2, logger_output);
|
gps *gps_module = new gps(&Serial2, logger_output);
|
||||||
config *system_config = new config(logger_output);
|
config *system_config = new config(logger_output);
|
||||||
|
cmd *command_handler = new cmd(&Serial, logger_output);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
wdt_disable();
|
||||||
driver_display->init();
|
driver_display->init();
|
||||||
driver_display->set_gps(gps_module);
|
driver_display->set_gps(gps_module);
|
||||||
driver_display->print_message("Starting Initialization");
|
driver_display->print_message("Starting Initialization");
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
driver_display->print_message("Serial Init...");
|
driver_display->print_message("Cmd Init...");
|
||||||
Serial.begin(115200);
|
command_handler->init();
|
||||||
delay(1000);
|
delay(1000);
|
||||||
driver_display->print_message("Serial Init Complete");
|
driver_display->print_message("Cmd Init Complete");
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
driver_display->print_message("Config Init...");
|
driver_display->print_message("Config Init...");
|
||||||
@@ -41,6 +45,8 @@ void setup() {
|
|||||||
driver_display->switch_screen(screen::gps_debug);
|
driver_display->switch_screen(screen::gps_debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() { gps_module->parse_task(500);
|
void loop() {
|
||||||
|
gps_module->parse_task(500);
|
||||||
driver_display->render_task();
|
driver_display->render_task();
|
||||||
|
command_handler->parse_task(500);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user