diff --git a/platformio.ini b/platformio.ini index c5bc22d..14b3e2d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -15,7 +15,7 @@ board_build.partitions = no_ota.csv framework = arduino monitor_speed = 115200 upload_speed = 921600 -monitor_port = COM6 +; monitor_port = COM6 lib_deps = https://git.kleiax.de/PlatformIO-Libs/SparkFunGNSS.git knolleary/PubSubClient@^2.8 @@ -26,11 +26,13 @@ lib_deps = https://git.kleiax.de/PlatformIO-Libs/Menu.git nrf24/RF24@^1.4.5 jrowberg/I2Cdevlib-MPU6050@^1.0.0 -upload_port = COM6 +; upload_port = COM6 test_ignore = test_desktop build_type = debug monitor_filters = esp32_exception_decoder check_tool = clangtidy +check_flags = + clangtidy: --checks=*,-llvmlibc [env:native] platform = native diff --git a/src/SpecialMenus/Route/menuRoute.cpp b/src/SpecialMenus/Route/menuRoute.cpp index 772c23a..cc66531 100644 --- a/src/SpecialMenus/Route/menuRoute.cpp +++ b/src/SpecialMenus/Route/menuRoute.cpp @@ -87,10 +87,10 @@ void MenuRoute::init() { this->mainMenu->setLcd(this->lcd); pointsMenu->setLcd(this->lcd); - MenuIntInput* importWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::importRoute)); - MenuIntInput* exportWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::exportRoute)); - MenuIntInput* deleteWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::deleteRoute)); - MenuActionRoute* clearWrapper = new MenuActionRoute(this, &MenuRoute::clearRoute); + auto importWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::importRoute)); + auto exportWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::exportRoute)); + auto deleteWrapper = new MenuIntInput(1, new MenuRouteWrapper(this, &MenuRoute::deleteRoute)); + auto clearWrapper = new MenuActionRoute(this, &MenuRoute::clearRoute); importWrapper->setLcd(this->lcd); importWrapper->setMinMax(0, 100); diff --git a/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp b/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp index f5157df..17363cb 100644 --- a/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp +++ b/src/SpecialMenus/driveModi/TestMode/menuTestMode.cpp @@ -85,18 +85,18 @@ void MenuTestMode::init() { // Create menu this->mainMenu = new Menu; - Menu* engineMenu = new Menu; - Menu* lightMenu = new Menu; - Menu* encoderMenu = new Menu; + auto engineMenu = new Menu; + auto lightMenu = new Menu; + auto encoderMenu = new Menu; // Sound // Ping google - MenuIntInput* drivingMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::drive)); - MenuIntInput* engineLeftMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::leftEngine)); - MenuIntInput* engineRightMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::rightEngine)); - MenuIntInput* engineBothMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::bothEngine)); - SpeedometerTest* encoderLeftMenu = new SpeedometerTest(this->testMode->getSpeedometerLeft()); - SpeedometerTest* encoderRightMenu = new SpeedometerTest(this->testMode->getSpeedometerRight()); + auto drivingMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::drive)); + auto engineLeftMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::leftEngine)); + auto engineRightMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::rightEngine)); + auto engineBothMenu = new MenuIntInput(2, new MenuTestModeWrapper(this, &TestMode::bothEngine)); + auto encoderLeftMenu = new SpeedometerTest(this->testMode->getSpeedometerLeft()); + auto encoderRightMenu = new SpeedometerTest(this->testMode->getSpeedometerRight()); // Set menus on LCD diff --git a/src/main.cpp b/src/main.cpp index 161f8f4..e819e63 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -203,22 +203,22 @@ void makeMenu() { // Create Menu main_m = new Menu(); main_m->setLcd(lcdWrapper); - Menu* mode_m = new Menu(); - Menu* set_m = new Menu(); - Menu* pid_m = new Menu(); - MenuIntInput* pidl_m = new MenuIntInput(3, new MenuPidSettings(moveController.getPID(0))); - MenuIntInput* pidr_m = new MenuIntInput(3, new MenuPidSettings(moveController.getPID(1))); - MenuIntInput* speed_m = new MenuIntInput(2, new MenuSpeed(driveManager->getDrivingSpeedsRef())); - MenuManualControl* man_m = new MenuManualControl(driveManager); - MenuCaptureRoute* cap_m = new MenuCaptureRoute(driveManager); - MenuAutopilot* auto_m = new MenuAutopilot(driveManager); - MenuTestMode* testM_m = new MenuTestMode(driveManager); - MenuCalibrateCompass* comp_m = new MenuCalibrateCompass(driveManager); - MenuSysteminformation* sys_m = new MenuSysteminformation(mainBattery); - MenuSensorData* sen_m = new MenuSensorData(sensorData); + auto mode_m = new Menu(); + auto set_m = new Menu(); + auto pid_m = new Menu(); + auto pidl_m = new MenuIntInput(3, new MenuPidSettings(moveController.getPID(0))); + auto pidr_m = new MenuIntInput(3, new MenuPidSettings(moveController.getPID(1))); + auto speed_m = new MenuIntInput(2, new MenuSpeed(driveManager->getDrivingSpeedsRef())); + auto man_m = new MenuManualControl(driveManager); + auto cap_m = new MenuCaptureRoute(driveManager); + auto auto_m = new MenuAutopilot(driveManager); + auto testM_m = new MenuTestMode(driveManager); + auto comp_m = new MenuCalibrateCompass(driveManager); + auto sys_m = new MenuSysteminformation(mainBattery); + auto sen_m = new MenuSensorData(sensorData); //TODO: Wie bekommt jeder die dumme Route? - MenuRoute* rout_m = new MenuRoute(new Route()); - MenuCalibrateBattery* bat_m = new MenuCalibrateBattery(mainBattery); + auto rout_m = new MenuRoute(new Route()); + auto bat_m = new MenuCalibrateBattery(mainBattery); auto_m->setUpdateDelay(1000); sys_m->setUpdateDelay(1500); @@ -271,7 +271,7 @@ void makeMenu() { controlPad->setMenuControl(main_m); } -void restart(void) { +void restart() { lcdWrapper->clear(); lcdWrapper->setCursor(0, 0); lcdWrapper->print("Rebooting ..."); diff --git a/src/moveControl.cpp b/src/moveControl.cpp index 20c9248..b8661c5 100644 --- a/src/moveControl.cpp +++ b/src/moveControl.cpp @@ -151,8 +151,7 @@ PID* MoveControl::getPID(uint8_t side) const { return this->left_pid; else if (side == 1) return this->right_pid; - else - return nullptr; + return nullptr; } void MoveControl::setSpeedometerDirection(Speedometer *speedometer, double value) {