mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-09 15:14:45 +00:00
consume the additional details from OLEDDisplayUiState to handle transitions to/from plugin screens better
It's still a bit janky, but should work https://github.com/meshtastic/esp8266-oled-ssd1306/pull/2
This commit is contained in:
parent
efaf669479
commit
b62b01fe7c
@ -150,8 +150,24 @@ static void drawSleepScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int
|
|||||||
|
|
||||||
static void drawPluginFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
static void drawPluginFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Drawing Plugin Frame %d\n\n", state->currentFrame);
|
uint8_t plugin_frame;
|
||||||
MeshPlugin &pi = *pluginFrames.at(state->currentFrame);
|
// there's a little but in the UI transition code
|
||||||
|
// where it invokes the function at the correct offset
|
||||||
|
// in the array of "drawScreen" functions; however,
|
||||||
|
// the passed-state doesn't quite reflect the "current"
|
||||||
|
// screen, so we have to detect it.
|
||||||
|
if (state->frameState == IN_TRANSITION && state->transitionFrameRelationship == INCOMING) {
|
||||||
|
// if we're transitioning from the end of the frame list back around to the first
|
||||||
|
// frame, then we want this to be `0`
|
||||||
|
plugin_frame = state->transitionFrameTarget;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// otherwise, just display the plugin frame that's aligned with the current frame
|
||||||
|
plugin_frame = state->currentFrame;
|
||||||
|
DEBUG_MSG("Screen is not in transition. Frame: %d\n\n", plugin_frame);
|
||||||
|
}
|
||||||
|
DEBUG_MSG("Drawing Plugin Frame %d\n\n", plugin_frame);
|
||||||
|
MeshPlugin &pi = *pluginFrames.at(plugin_frame);
|
||||||
pi.drawFrame(display,state,x,y);
|
pi.drawFrame(display,state,x,y);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,10 @@ int32_t EnvironmentalMeasurementPlugin::runOnce() {
|
|||||||
Uncomment the preferences below if you want to use the plugin
|
Uncomment the preferences below if you want to use the plugin
|
||||||
without having to configure it from the PythonAPI or WebUI.
|
without having to configure it from the PythonAPI or WebUI.
|
||||||
*/
|
*/
|
||||||
/*radioConfig.preferences.environmental_measurement_plugin_enabled = 1;
|
radioConfig.preferences.environmental_measurement_plugin_enabled = 1;
|
||||||
radioConfig.preferences.environmental_measurement_plugin_read_error_count_threshold = 5;
|
radioConfig.preferences.environmental_measurement_plugin_read_error_count_threshold = 5;
|
||||||
radioConfig.preferences.environmental_measurement_plugin_update_interval = 30;
|
radioConfig.preferences.environmental_measurement_plugin_update_interval = 30;
|
||||||
radioConfig.preferences.environmental_measurement_plugin_recovery_interval = 600;*/
|
radioConfig.preferences.environmental_measurement_plugin_recovery_interval = 600;
|
||||||
|
|
||||||
if (!radioConfig.preferences.environmental_measurement_plugin_enabled){
|
if (!radioConfig.preferences.environmental_measurement_plugin_enabled){
|
||||||
// If this plugin is not enabled, don't waste any OSThread time on it
|
// If this plugin is not enabled, don't waste any OSThread time on it
|
||||||
|
Loading…
Reference in New Issue
Block a user