Skip to content

Commit

Permalink
lib: increase SD card SPI clock speed to 20 MHz (was 10 MHz)
Browse files Browse the repository at this point in the history
lib: fix incorrect pressed states in controller handlers (again)
  • Loading branch information
and3rson committed Mar 3, 2024
1 parent 4ead38b commit 5ee6873
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sdk/lib/lilka/src/lilka/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ void Controller::inputTask(void *arg) {
}
bool pressed = !digitalRead(self->pins[i]);
if (pressed != state->pressed) {
state->pressed = pressed;
state->justPressed = pressed;
state->justReleased = !pressed;
state->pressed = pressed;
if (self->handlers[i] != NULL) {
self->handlers[i](state->pressed);
self->handlers[i](pressed);
}
if (self->globalHandler != NULL) {
self->globalHandler((Button)i, state->pressed);
self->globalHandler((Button)i, pressed);
}
}
state->time = millis();
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, 10000000, LILKA_SDROOT); // TODO: is 10 MHz OK for all cards?
fs->begin(LILKA_SDCARD_CS, SPI1, 20000000, LILKA_SDROOT); // TODO: is 20 MHz OK for all cards?
sdcard_type_t cardType = fs->cardType();

if (cardType == CARD_NONE) {
Expand Down

0 comments on commit 5ee6873

Please sign in to comment.