Added page method leavePage() for e.g. cleanup and storage code
This commit is contained in:
parent
992348ce92
commit
2749f25d15
|
@ -62,6 +62,7 @@ sdmmc_card_t *sdcard;
|
|||
bool hasSDCard = false;
|
||||
|
||||
// Global vars
|
||||
bool heartbeat = false; // Heartbeat indicator with two different states
|
||||
bool blinkingLED = false; // Enable / disable blinking flash LED
|
||||
bool statusLED = false; // Actual status of flash LED on/off
|
||||
bool statusBacklightLED = false;// Actual status of flash LED on/off
|
||||
|
@ -459,7 +460,6 @@ void displayTrendLow(int16_t x, int16_t y, uint16_t size, uint16_t color){
|
|||
// Show header informations
|
||||
void displayHeader(CommonData &commonData, bool symbolmode, GwApi::BoatValue *date, GwApi::BoatValue *time, GwApi::BoatValue *hdop){
|
||||
|
||||
static bool heartbeat = false;
|
||||
static unsigned long usbRxOld = 0;
|
||||
static unsigned long usbTxOld = 0;
|
||||
static unsigned long serRxOld = 0;
|
||||
|
|
|
@ -38,6 +38,8 @@ extern bool hasSDCard;
|
|||
extern sdmmc_card_t *sdcard;
|
||||
#endif
|
||||
|
||||
extern bool heartbeat;
|
||||
|
||||
// Fonts declarations for display (#includes see OBP60Extensions.cpp)
|
||||
extern const GFXfont DSEG7Classic_BoldItalic16pt7b;
|
||||
extern const GFXfont DSEG7Classic_BoldItalic20pt7b;
|
||||
|
|
|
@ -291,8 +291,15 @@ public:
|
|||
|
||||
return PAGE_UPDATE;
|
||||
};
|
||||
|
||||
void leavePage(PageData &pageData) {
|
||||
logger->logDebug(GwLog::LOG, "Leaving PageFourvalues");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
static Page *createPage(CommonData &common){
|
||||
return new PageFourValues(common);
|
||||
}/**
|
||||
|
|
|
@ -975,7 +975,8 @@ void OBP60Task(GwApi *api){
|
|||
}
|
||||
else {
|
||||
if (lastPage != pageNumber){
|
||||
if (hasFRAM) fram.write(FRAM_PAGE_NO, pageNumber); // remember page for device restart
|
||||
pages[lastPage].page->leavePage(pages[lastPage].parameters); // call page cleanup code
|
||||
if (hasFRAM) fram.write(FRAM_PAGE_NO, pageNumber); // remember new page for device restart
|
||||
currentPage->setupKeys();
|
||||
currentPage->displayNew(pages[pageNumber].parameters);
|
||||
lastPage = pageNumber;
|
||||
|
|
Loading…
Reference in New Issue