mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-05 04:39:10 +02:00
Fix reading memory when they are mapped.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -231,6 +231,9 @@ int flash_program_uintptr (uintptr_t addr, uintptr_t data) {
|
|||||||
return flash_program_block(addr, (const uint8_t *)&data, sizeof(uintptr_t));
|
return flash_program_block(addr, (const uint8_t *)&data, sizeof(uintptr_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern const uintptr_t start_data_pool;
|
||||||
|
extern const uintptr_t end_rom_pool;
|
||||||
|
|
||||||
uint8_t *flash_read(uintptr_t addr) {
|
uint8_t *flash_read(uintptr_t addr) {
|
||||||
uintptr_t addr_alg = addr & -FLASH_SECTOR_SIZE;
|
uintptr_t addr_alg = addr & -FLASH_SECTOR_SIZE;
|
||||||
#ifndef ENABLE_EMULATION
|
#ifndef ENABLE_EMULATION
|
||||||
@@ -251,6 +254,7 @@ uint8_t *flash_read(uintptr_t addr) {
|
|||||||
#ifndef ENABLE_EMULATION
|
#ifndef ENABLE_EMULATION
|
||||||
mutex_exit(&mtx_flash);
|
mutex_exit(&mtx_flash);
|
||||||
#else
|
#else
|
||||||
|
if (addr >= start_data_pool && addr <= end_rom_pool)
|
||||||
v += (uintptr_t)map;
|
v += (uintptr_t)map;
|
||||||
#endif
|
#endif
|
||||||
return v;
|
return v;
|
||||||
|
|||||||
Reference in New Issue
Block a user