diff --git a/firmware/hw_layer/mmc_card_access.cpp b/firmware/hw_layer/mmc_card_access.cpp index d78a1a2c9b..571671be48 100644 --- a/firmware/hw_layer/mmc_card_access.cpp +++ b/firmware/hw_layer/mmc_card_access.cpp @@ -14,15 +14,44 @@ static char *buffer[2048]; void handleTsR(char *input) { - if (input[1] == 0 && input[2] == 7) { + const uint16_t* data16 = reinterpret_cast(input); + + if (input[0] == 0 && input[1] == 1) { scheduleMsg(&sharedLogger, "TS_SD: RTC read command"); memset(buffer, 0, 9); - } + } else if (input[0] == 0 && input[1] == 0x11) { + int length = data16[2]; + scheduleMsg(&sharedLogger, "TS_SD: fetch buffer command, length=%d", length); + + + if (length == 16) { + + } else { + // SD read directory command + + } + + + } else if (input[0] == 0 && input[1] == 0x14) { + scheduleMsg(&sharedLogger, "TS_SD: fetch data command blockNumber="); + + } else { + scheduleMsg(&sharedLogger, "TS_SD: unexpected r"); + } } void handleTsW(char *input) { + const uint16_t* data16 = reinterpret_cast(input); + if (input[0] == 0 && input[1] == 0x11) { + int code = data16[2]; + scheduleMsg(&sharedLogger, "TS_SD: w, code=%d", code); + + + } else { + scheduleMsg(&sharedLogger, "TS_SD: unexpected w"); + } }