Compare commits
1 Commits
main
...
bug/playba
| Author | SHA1 | Date | |
|---|---|---|---|
| 41cfe794bf |
Submodule software/lib/micropython updated: ccdecf255d...281615c157
@@ -90,9 +90,9 @@ static mp_obj_t audiocore_put(mp_obj_t self_in, mp_obj_t buffer)
|
||||
(void)self;
|
||||
mp_buffer_info_t bufinfo;
|
||||
if (!mp_get_buffer(buffer, &bufinfo, MP_BUFFER_READ))
|
||||
mp_raise_ValueError("not a read buffer");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("not a read buffer"));
|
||||
if (bufinfo.typecode != 'b' && bufinfo.typecode != 'B')
|
||||
mp_raise_ValueError("unsupported buffer type");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("unsupported buffer type"));
|
||||
unsigned to_copy = bufinfo.len;
|
||||
|
||||
const uint32_t flags = spin_lock_blocking(shared_context.lock);
|
||||
@@ -144,7 +144,7 @@ static mp_obj_t audiocore_set_volume(mp_obj_t self_in, mp_obj_t volume_obj)
|
||||
struct audiocore_obj *self = MP_OBJ_TO_PTR(self_in);
|
||||
const int volume = mp_obj_get_int(volume_obj);
|
||||
if (volume < 0 || volume > 255)
|
||||
mp_raise_ValueError("volume out of range");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("volume out of range"));
|
||||
multicore_fifo_push_blocking(AUDIOCORE_CMD_SET_VOLUME);
|
||||
multicore_fifo_push_blocking(AUDIOCORE_MAX_VOLUME * volume / 255);
|
||||
wake_core1();
|
||||
|
||||
@@ -66,9 +66,9 @@ static mp_obj_t sdcard_readblocks(mp_obj_t self_obj, mp_obj_t block_obj, mp_obj_
|
||||
const int start_block = mp_obj_get_int(block_obj);
|
||||
mp_buffer_info_t bufinfo;
|
||||
if (!mp_get_buffer(buf_obj, &bufinfo, MP_BUFFER_WRITE))
|
||||
mp_raise_ValueError("Not a write buffer");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("Not a write buffer"));
|
||||
if (bufinfo.len % SD_SECTOR_SIZE != 0)
|
||||
mp_raise_ValueError("Buffer length is invalid");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("Buffer length is invalid"));
|
||||
const int nblocks = bufinfo.len / SD_SECTOR_SIZE;
|
||||
for (int block = 0; block < nblocks; block++) {
|
||||
// TODO: Implement CMD18 read multiple blocks
|
||||
@@ -85,9 +85,9 @@ static mp_obj_t sdcard_writeblocks(mp_obj_t self_obj, mp_obj_t block_obj, mp_obj
|
||||
const int start_block = mp_obj_get_int(block_obj);
|
||||
mp_buffer_info_t bufinfo;
|
||||
if (!mp_get_buffer(buf_obj, &bufinfo, MP_BUFFER_READ))
|
||||
mp_raise_ValueError("Not a read buffer");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("Not a read buffer"));
|
||||
if (bufinfo.len % SD_SECTOR_SIZE != 0)
|
||||
mp_raise_ValueError("Buffer length is invalid");
|
||||
mp_raise_ValueError(MP_ERROR_TEXT("Buffer length is invalid"));
|
||||
const int nblocks = bufinfo.len / SD_SECTOR_SIZE;
|
||||
for (int block = 0; block < nblocks; block++) {
|
||||
// TODO: Implement CMD25 write multiple blocks
|
||||
|
||||
Reference in New Issue
Block a user