Implemented Buffer SaveStates
This commit is contained in:
1 parent
508a4ed064
commit
791f02209d
13 files changed
+328
-69
No files matched your search
+9
-4
@@ -1535,8 +1535,11 @@ static bool check_chiptype(bool getDeviceData) {
|
||||
|
||||
if (!getDeviceData) return retval;
|
||||
|
||||
save_restoreGB(GRAPH_SAVE);
|
||||
save_restoreDB(GRAPH_SAVE);
|
||||
//Save the state of the Graph and Demod Buffers
|
||||
buffer_savestate_t saveState_gb = save_bufferS32(g_GraphBuffer, g_GraphTraceLen);
|
||||
buffer_savestate_t saveState_db = save_buffer8(g_DemodBuffer, g_DemodBufferLen);
|
||||
saveState_db.clock = g_DemodClock;
|
||||
saveState_db.offset = g_DemodStartIdx;
|
||||
|
||||
//check for em4x05/em4x69 chips first
|
||||
uint32_t word = 0;
|
||||
@@ -1575,8 +1578,10 @@ static bool check_chiptype(bool getDeviceData) {
|
||||
|
||||
PrintAndLogEx(INFO, "Couldn't identify a chipset");
|
||||
out:
|
||||
save_restoreGB(GRAPH_RESTORE);
|
||||
save_restoreDB(GRAPH_RESTORE);
|
||||
restore_buffer8(saveState_db, g_DemodBuffer);
|
||||
g_DemodClock = saveState_db.clock;
|
||||
g_DemodStartIdx = saveState_db.offset;
|
||||
restore_bufferS32(saveState_gb, g_GraphBuffer);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user