Skip to content

Commit

Permalink
lib: increase SD card SPI clock speed to 10 MHz (was 1 MHz)
Browse files Browse the repository at this point in the history
lib: fix incorrect pressed states in controller handlers
  • Loading branch information
and3rson committed Mar 3, 2024
1 parent b8493a5 commit 4ead38b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sdk/lib/lilka/src/lilka/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ void Controller::inputTask(void *arg) {
if (pressed != state->pressed) {
state->justPressed = pressed;
state->justReleased = !pressed;
state->pressed = pressed;
if (self->handlers[i] != NULL) {
self->handlers[i](state->pressed);
}
if (self->globalHandler != NULL) {
self->globalHandler((Button)i, state->pressed);
}
}
state->pressed = pressed;
state->time = millis();
}
xSemaphoreGive(self->semaphore);
Expand Down
2 changes: 1 addition & 1 deletion sdk/lib/lilka/src/lilka/sdcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void SDCard::begin() {
#if LILKA_SDCARD_CS < 0
serial_err("SD init failed: no CS pin");
#else
fs->begin(LILKA_SDCARD_CS, SPI1, 1000000, LILKA_SDROOT);
fs->begin(LILKA_SDCARD_CS, SPI1, 10000000, LILKA_SDROOT); // TODO: is 10 MHz OK for all cards?
sdcard_type_t cardType = fs->cardType();

if (cardType == CARD_NONE) {
Expand Down

0 comments on commit 4ead38b

Please sign in to comment.