mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-02 11:55:56 +00:00
Merge pull request #937 from Hydra-Designs/master
Automatic screen carousel behavior implementation (auto_screen_carousel_secs user preference)
This commit is contained in:
commit
0118f3991a
@ -805,6 +805,8 @@ void Screen::forceDisplay()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t lastScreenTransition;
|
||||||
|
|
||||||
int32_t Screen::runOnce()
|
int32_t Screen::runOnce()
|
||||||
{
|
{
|
||||||
// If we don't have a screen, don't ever spend any CPU for us.
|
// If we don't have a screen, don't ever spend any CPU for us.
|
||||||
@ -881,6 +883,11 @@ int32_t Screen::runOnce()
|
|||||||
// standard screen switching is stopped.
|
// standard screen switching is stopped.
|
||||||
if (showingNormalScreen) {
|
if (showingNormalScreen) {
|
||||||
// standard screen loop handling here
|
// standard screen loop handling here
|
||||||
|
if (radioConfig.preferences.auto_screen_carousel_secs > 0 &&
|
||||||
|
(millis() - lastScreenTransition) > (radioConfig.preferences.auto_screen_carousel_secs * 1000)) {
|
||||||
|
DEBUG_MSG("LastScreenTransition exceeded %ums transitioning to next frame\n", (millis() - lastScreenTransition));
|
||||||
|
handleOnPress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEBUG_MSG("want fps %d, fixed=%d\n", targetFramerate,
|
// DEBUG_MSG("want fps %d, fixed=%d\n", targetFramerate,
|
||||||
@ -954,8 +961,9 @@ void Screen::setFrames()
|
|||||||
normalFrames[numframes++] = drawCriticalFaultFrame;
|
normalFrames[numframes++] = drawCriticalFaultFrame;
|
||||||
|
|
||||||
// If we have a text message - show it next, unless it's a phone message and we aren't using any special plugins
|
// If we have a text message - show it next, unless it's a phone message and we aren't using any special plugins
|
||||||
if (devicestate.has_rx_text_message && shouldDrawMessage(&devicestate.rx_text_message))
|
if (devicestate.has_rx_text_message && shouldDrawMessage(&devicestate.rx_text_message)) {
|
||||||
normalFrames[numframes++] = drawTextMessageFrame;
|
normalFrames[numframes++] = drawTextMessageFrame;
|
||||||
|
}
|
||||||
|
|
||||||
// then all the nodes
|
// then all the nodes
|
||||||
// We only show a few nodes in our scrolling list - because meshes with many nodes would have too many screens
|
// We only show a few nodes in our scrolling list - because meshes with many nodes would have too many screens
|
||||||
@ -1050,7 +1058,8 @@ void Screen::handleOnPress()
|
|||||||
// If we are in a transition, the press must have bounced, drop it.
|
// If we are in a transition, the press must have bounced, drop it.
|
||||||
if (ui.getUiState()->frameState == FIXED) {
|
if (ui.getUiState()->frameState == FIXED) {
|
||||||
ui.nextFrame();
|
ui.nextFrame();
|
||||||
|
DEBUG_MSG("Setting LastScreenTransition\n");
|
||||||
|
lastScreenTransition = millis();
|
||||||
setFastFramerate();
|
setFastFramerate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ extern const pb_msgdesc_t AdminMessage_msg;
|
|||||||
#define AdminMessage_fields &AdminMessage_msg
|
#define AdminMessage_fields &AdminMessage_msg
|
||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define AdminMessage_size 440
|
#define AdminMessage_size 447
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -24,6 +24,7 @@ typedef enum _PortNum {
|
|||||||
PortNum_STORE_FORWARD_APP = 65,
|
PortNum_STORE_FORWARD_APP = 65,
|
||||||
PortNum_RANGE_TEST_APP = 66,
|
PortNum_RANGE_TEST_APP = 66,
|
||||||
PortNum_ENVIRONMENTAL_MEASUREMENT_APP = 67,
|
PortNum_ENVIRONMENTAL_MEASUREMENT_APP = 67,
|
||||||
|
PortNum_ZPS_APP = 68,
|
||||||
PortNum_PRIVATE_APP = 256,
|
PortNum_PRIVATE_APP = 256,
|
||||||
PortNum_ATAK_FORWARDER = 257,
|
PortNum_ATAK_FORWARDER = 257,
|
||||||
PortNum_MAX = 511
|
PortNum_MAX = 511
|
||||||
|
@ -150,6 +150,7 @@ typedef struct _RadioConfig_UserPreferences {
|
|||||||
bool store_forward_plugin_heartbeat;
|
bool store_forward_plugin_heartbeat;
|
||||||
uint32_t position_flags;
|
uint32_t position_flags;
|
||||||
bool is_always_powered;
|
bool is_always_powered;
|
||||||
|
uint32_t auto_screen_carousel_secs;
|
||||||
} RadioConfig_UserPreferences;
|
} RadioConfig_UserPreferences;
|
||||||
|
|
||||||
typedef struct _RadioConfig {
|
typedef struct _RadioConfig {
|
||||||
@ -194,9 +195,9 @@ extern "C" {
|
|||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default}
|
#define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default}
|
||||||
#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0}
|
#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0}
|
||||||
#define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero}
|
#define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero}
|
||||||
#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0}
|
#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define RadioConfig_UserPreferences_position_broadcast_secs_tag 1
|
#define RadioConfig_UserPreferences_position_broadcast_secs_tag 1
|
||||||
@ -262,6 +263,7 @@ extern "C" {
|
|||||||
#define RadioConfig_UserPreferences_store_forward_plugin_heartbeat_tag 149
|
#define RadioConfig_UserPreferences_store_forward_plugin_heartbeat_tag 149
|
||||||
#define RadioConfig_UserPreferences_position_flags_tag 150
|
#define RadioConfig_UserPreferences_position_flags_tag 150
|
||||||
#define RadioConfig_UserPreferences_is_always_powered_tag 151
|
#define RadioConfig_UserPreferences_is_always_powered_tag 151
|
||||||
|
#define RadioConfig_UserPreferences_auto_screen_carousel_secs_tag 152
|
||||||
#define RadioConfig_preferences_tag 1
|
#define RadioConfig_preferences_tag 1
|
||||||
|
|
||||||
/* Struct field encoding specification for nanopb */
|
/* Struct field encoding specification for nanopb */
|
||||||
@ -334,7 +336,8 @@ X(a, STATIC, SINGULAR, UINT32, environmental_measurement_plugin_sensor_pin,
|
|||||||
X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_enabled, 148) \
|
X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_enabled, 148) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_heartbeat, 149) \
|
X(a, STATIC, SINGULAR, BOOL, store_forward_plugin_heartbeat, 149) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, position_flags, 150) \
|
X(a, STATIC, SINGULAR, UINT32, position_flags, 150) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, is_always_powered, 151)
|
X(a, STATIC, SINGULAR, BOOL, is_always_powered, 151) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, auto_screen_carousel_secs, 152)
|
||||||
#define RadioConfig_UserPreferences_CALLBACK NULL
|
#define RadioConfig_UserPreferences_CALLBACK NULL
|
||||||
#define RadioConfig_UserPreferences_DEFAULT NULL
|
#define RadioConfig_UserPreferences_DEFAULT NULL
|
||||||
|
|
||||||
@ -346,8 +349,8 @@ extern const pb_msgdesc_t RadioConfig_UserPreferences_msg;
|
|||||||
#define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg
|
#define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg
|
||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define RadioConfig_size 437
|
#define RadioConfig_size 444
|
||||||
#define RadioConfig_UserPreferences_size 434
|
#define RadioConfig_UserPreferences_size 441
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
Loading…
Reference in New Issue
Block a user