Merge pull request 'misc-minor-fixes' (#35) from misc-minor-fixes into main
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m23s
Check code formatting / Check-C-Format (push) Successful in 7s
Check code formatting / Check-Python-Flake8 (push) Successful in 9s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 4s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s

Reviewed-on: #35
Reviewed-by: Stefan Kratochwil <kratochwil-la@gmx.de>
This commit was merged in pull request #35.
This commit is contained in:
2025-08-24 15:36:59 +00:00
3 changed files with 8 additions and 4 deletions

View File

@@ -50,10 +50,14 @@ static uint32_t get_fifo_read_value_blocking(struct audiocore_obj *obj)
const long flags = save_and_disable_interrupts();
const uint32_t value = obj->fifo_read_value;
obj->fifo_read_value = 0;
restore_interrupts(flags);
if (value & AUDIOCORE_FIFO_DATA_FLAG)
if (value & AUDIOCORE_FIFO_DATA_FLAG) {
restore_interrupts(flags);
return value & ~AUDIOCORE_FIFO_DATA_FLAG;
}
__wfi();
restore_interrupts(flags);
__nop(); // Ensure at least two instructions between enable interrupts and subsequent disable
__nop();
}
}

View File

@@ -253,7 +253,7 @@ bool sd_cmd_write(uint8_t cmd, uint32_t arg, unsigned datalen, uint8_t data[cons
int timeout = 0;
bool got_done = false;
for (timeout = 0; timeout < 8192; ++timeout) {
for (timeout = 0; timeout < 131072; ++timeout) {
sd_spi_read_blocking(0xff, buf, 1);
if (buf[0] != 0x0) {
got_done = true;