Bsongis/ram saving (#6685)
RAM saving. Stacks reduced to have some more RAM available than 2.2 on all boards
This commit is contained in:
+9
-16
@@ -28,13 +28,9 @@ ModelData g_model;
|
||||
Clipboard clipboard;
|
||||
#endif
|
||||
|
||||
uint8_t unexpectedShutdown = 0;
|
||||
|
||||
uint16_t vbattRTC;
|
||||
|
||||
/* ARM: mixer duration in 0.5us */
|
||||
uint16_t maxMixerDuration;
|
||||
GlobalData globalData;
|
||||
|
||||
uint16_t maxMixerDuration; // step = 0.01ms
|
||||
uint8_t heartbeat;
|
||||
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
@@ -672,11 +668,6 @@ getvalue_t convert16bitsTelemValue(source_t channel, ls_telemetry_value_t value)
|
||||
return value;
|
||||
}
|
||||
|
||||
ls_telemetry_value_t minTelemValue(source_t channel)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ls_telemetry_value_t maxTelemValue(source_t channel)
|
||||
{
|
||||
return 30000;
|
||||
@@ -1841,12 +1832,14 @@ void opentxInit()
|
||||
// * radios without CPU controlled power can only use Reset status register (if available)
|
||||
if (UNEXPECTED_SHUTDOWN()) {
|
||||
TRACE("Unexpected Shutdown detected");
|
||||
unexpectedShutdown = 1;
|
||||
globalData.unexpectedShutdown = 1;
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
globalData.sdcardPresent = SD_CARD_PRESENT();
|
||||
|
||||
// SDCARD related stuff, only done if not unexpectedShutdown
|
||||
if (!unexpectedShutdown) {
|
||||
if (!globalData.unexpectedShutdown) {
|
||||
sdInit();
|
||||
|
||||
#if defined(AUTOUPDATE)
|
||||
@@ -1882,7 +1875,7 @@ void opentxInit()
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
if (!unexpectedShutdown) {
|
||||
if (!globalData.unexpectedShutdown) {
|
||||
// g_model.topbarData is still zero here (because it was not yet read from SDCARD),
|
||||
// but we only remember the pointer to in in constructor.
|
||||
// The storageReadAll() needs topbar object, so it must be created here
|
||||
@@ -1896,7 +1889,7 @@ void opentxInit()
|
||||
// handling of storage for radios that have no EEPROM
|
||||
#if !defined(EEPROM)
|
||||
#if defined(RAMBACKUP)
|
||||
if (unexpectedShutdown) {
|
||||
if (globalData.unexpectedShutdown) {
|
||||
// SDCARD not available, try to restore last model from RAM
|
||||
TRACE("rambackupRestore");
|
||||
rambackupRestore();
|
||||
@@ -1952,7 +1945,7 @@ void opentxInit()
|
||||
backlightOn();
|
||||
}
|
||||
|
||||
if (!unexpectedShutdown) {
|
||||
if (!globalData.unexpectedShutdown) {
|
||||
opentxStart();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user