This repository has been archived on 2022-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
Marlin-Artillery-M600/Marlin/src/lcd/extensible_ui/lib/example.cpp

94 lines
3.5 KiB
C++
Raw Normal View History

/***************
* example.cpp *
***************/
2018-10-08 22:44:05 +02:00
/****************************************************************************
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <http://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../../../inc/MarlinConfigPre.h"
#if BOTH(EXTUI_EXAMPLE, EXTENSIBLE_UI)
2018-10-08 22:44:05 +02:00
#include "../ui_api.h"
// To implement a new UI, complete the functions below and
// read or update Marlin's state using the methods in the
// ExtUI methods in "../ui_api.h"
//
// Although it may be possible to access other state
// variables from Marlin, using the API here possibly
// helps ensure future compatibility.
2018-10-08 22:44:05 +02:00
namespace ExtUI {
void onStartup() {
/* Initialize the display module here. The following
* routines are available for access to the GPIO pins:
*
* SET_OUTPUT(pin)
* SET_INPUT_PULLUP(pin)
* SET_INPUT(pin)
* WRITE(pin,value)
* READ(pin)
*/
}
void onIdle() {}
void onPrinterKilled(PGM_P const msg) {}
void onMediaInserted() {};
void onMediaError() {};
void onMediaRemoved() {};
2018-10-08 22:44:05 +02:00
void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
void onPrintTimerStarted() {}
void onPrintTimerPaused() {}
void onPrintTimerStopped() {}
void onFilamentRunout() {}
void onUserConfirmRequired(const char * const msg) {}
void onStatusChanged(const char * const msg) {}
2018-10-08 22:44:05 +02:00
void onFactoryReset() {}
void onStoreSettings(char *buff) {
// This is called when saving to EEPROM (i.e. M500). If the ExtUI needs
// permanent data to be stored, it can write up to eeprom_data_size bytes
// into buff.
// Example:
// static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
// memcpy(buff, &myDataStruct, sizeof(myDataStruct));
}
void onLoadSettings(const char *buff) {
// This is called while loading settings from EEPROM. If the ExtUI
// needs to retrieve data, it should copy up to eeprom_data_size bytes
// from buff
// Example:
// static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
// memcpy(&myDataStruct, buff, sizeof(myDataStruct));
}
void onConfigurationStoreWritten(bool success) {
// This is called after the entire EEPROM has been written,
// whether successful or not.
}
void onConfigurationStoreRead(bool success) {
// This is called after the entire EEPROM has been read,
// whether successful or not.
}
2018-10-08 22:44:05 +02:00
}
#endif // EXTUI_EXAMPLE && EXTENSIBLE_UI