some menu improvements
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#define PWMRES 8
|
||||
#define POWERSTEPS 2 // A total of 20 levels ( 100 / SPEED_STEPS ) * RUN_MOTOR_CONTROL_DELAY = 500ms
|
||||
#define PWMMIN 55
|
||||
#define PWMMAX 95 // Max 98% of 2^PWM_RES
|
||||
#define PWMMAX 80 // Max 98% of 2^PWM_RES
|
||||
|
||||
/**
|
||||
* @brief A class which use PWM to control the power of DC Motor
|
||||
|
||||
@@ -49,10 +49,16 @@ void MenuGPS::printPage() const {
|
||||
lineOne = "Time: ";
|
||||
lineTwo = "";
|
||||
if (fixType) {
|
||||
if (gpsData->hour < 10)
|
||||
lineTwo.concat("0");
|
||||
lineTwo.concat(gpsData->hour);
|
||||
lineTwo.concat(":");
|
||||
if (gpsData->min < 10)
|
||||
lineTwo.concat("0");
|
||||
lineTwo.concat(gpsData->min);
|
||||
lineTwo.concat(":");
|
||||
if (gpsData->sec < 10)
|
||||
lineTwo.concat("0");
|
||||
lineTwo.concat(gpsData->sec);
|
||||
} else
|
||||
lineTwo = "00:00:00";
|
||||
|
||||
@@ -64,10 +64,6 @@ void MenuAutopilot::printMenu() {
|
||||
}
|
||||
|
||||
void MenuAutopilot::update() {
|
||||
if (millis() - this->lastMillis < this->minDelay)
|
||||
return;
|
||||
this->lastMillis = millis();
|
||||
|
||||
if (!this->autopilot->shouldUpdate())
|
||||
return;
|
||||
|
||||
|
||||
@@ -41,16 +41,13 @@ class MenuAutopilot : public MenuDriveMode {
|
||||
/**
|
||||
* @brief can be called to update shown data
|
||||
*/
|
||||
void update();
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
Autopilot* autopilot;
|
||||
RouteInfo routeInfo;
|
||||
|
||||
uint32_t lastMillis = 0;
|
||||
uint16_t minDelay = 1500;
|
||||
};
|
||||
|
||||
#endif // MENU_AUTOPILOT_DRIVE_H
|
||||
|
||||
@@ -40,7 +40,7 @@ class MenuCaptureRoute : public MenuDriveMode {
|
||||
/**
|
||||
* @brief can be called to update shown data
|
||||
*/
|
||||
void update();
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
Reference in New Issue
Block a user