Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions VortexEngine/src/Menus/MenuList/GlobalBrightness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ void GlobalBrightness::showBrightnessSelection()

// ==================== KEYCHAIN_MODE STUFF ====================

// don't worry about this stuff
// The general timer for keychain mode to remain active
#define KEYCHAIN_MODE_TIMER_MS 2100
#define KEYCHAIN_MODE_TIMER_TICKS MS_TO_TICKS(KEYCHAIN_MODE_TIMER_MS)
// the number of clicks needed to exit keychain mode
#define KEYCHAIN_MODE_EXIT_CLICKS 8
#define KEYCHAIN_MODE_SLEEP_S 10
#define KEYCHAIN_MODE_SLEEP_TICKS SEC_TO_TICKS(KEYCHAIN_MODE_SLEEP_S)
// This is the duration of idle time on blank before it will auto-sleep
// give a solid 300 seconds (5 minutes) before it goes to sleep
#define KEYCHAIN_MODE_SLEEP_TICKS SEC_TO_TICKS(300)

// bonus simulate keychain_mode in this menu
Menu::MenuAction GlobalBrightness::runKeychainMode()
Expand Down
40 changes: 15 additions & 25 deletions VortexEngine/src/Modes/Modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,7 @@ void Modes::play()
// full save/load to/from buffer
bool Modes::saveToBuffer(ByteStream &modesBuffer)
{
if (!serializeSaveHeader(modesBuffer)) {
return false;
}
// serialize all modes data into the modesBuffer
if (!serialize(modesBuffer)) {
return false;
}
DEBUG_LOGF("Serialized all modes, uncompressed size: %u", modesBuffer.size());
if (!modesBuffer.compress()) {
return false;
}
// This API is removed for the DUO
return true;
}

Expand Down Expand Up @@ -145,20 +135,6 @@ bool Modes::saveHeader()
if (!serializeSaveHeader(headerBuffer)) {
return false;
}
// the number of modes
if (!headerBuffer.serialize8(m_numModes)) {
return false;
}
// only on the duo just save some extra stuff to the header slot
#ifdef VORTEX_EMBEDDED
// Duo also saves the build number to the save header so the chromalink can
// read it out, other devices just have the version hardcoded into their
// editor connection hello message. Don't do this in VortexLib because
// it will alter the savefile format and break compatibility
if (!headerBuffer.serialize8((uint8_t)VORTEX_BUILD_NUMBER)) {
return false;
}
#endif
if (!Storage::write(0, headerBuffer)) {
return false;
}
Expand Down Expand Up @@ -287,6 +263,20 @@ bool Modes::serializeSaveHeader(ByteStream &saveBuffer)
if (!saveBuffer.serialize8((uint8_t)Leds::getBrightness())) {
return false;
}
// the number of modes
if (!saveBuffer.serialize8(m_numModes)) {
return false;
}
// only on the duo just save some extra stuff to the header slot
#ifdef VORTEX_EMBEDDED
// Duo also saves the build number to the save header so the chromalink can
// read it out, other devices just have the version hardcoded into their
// editor connection hello message. Don't do this in VortexLib because
// it will alter the savefile format and break compatibility
if (!saveBuffer.serialize8((uint8_t)VORTEX_BUILD_NUMBER)) {
return false;
}
#endif
DEBUG_LOGF("Serialized all modes, uncompressed size: %u", saveBuffer.size());
return true;
}
Expand Down
Binary file modified VortexEngine/tests/tests_general.tar.gz
Binary file not shown.