mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 20:19:23 +00:00
unix: enable modtrezorio, mock sdcard
This commit is contained in:
parent
9f352959ee
commit
f7d72741fd
@ -5,7 +5,13 @@
|
|||||||
* see LICENSE file for details
|
* see LICENSE file for details
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined TREZOR_STM32
|
||||||
#include "sdcard.h"
|
#include "sdcard.h"
|
||||||
|
#elif defined TREZOR_UNIX
|
||||||
|
#include "unix-sdcard-mock.h"
|
||||||
|
#else
|
||||||
|
#error Unsupported TREZOR port. Only STM32 and UNIX ports are supported.
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _mp_obj_SDCard_t {
|
typedef struct _mp_obj_SDCard_t {
|
||||||
mp_obj_base_t base;
|
mp_obj_base_t base;
|
||||||
|
31
micropython/extmod/modtrezorio/unix-sdcard-mock.h
Normal file
31
micropython/extmod/modtrezorio/unix-sdcard-mock.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include "../../trezorhal/sdcard.h"
|
||||||
|
|
||||||
|
#define SD_ERROR 41U
|
||||||
|
|
||||||
|
int sdcard_init(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool sdcard_is_present(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool sdcard_power_on(void) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool sdcard_power_off(void) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t sdcard_get_capacity_in_bytes(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t sdcard_read_blocks(void *dest, uint32_t block_num, uint32_t num_blocks) {
|
||||||
|
return SD_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t sdcard_write_blocks(const void *src, uint32_t block_num, uint32_t num_blocks) {
|
||||||
|
return SD_ERROR;
|
||||||
|
}
|
@ -2,7 +2,7 @@ MICROPY_PY_TREZORCONFIG = 1
|
|||||||
|
|
||||||
MICROPY_PY_TREZORCRYPTO = 1
|
MICROPY_PY_TREZORCRYPTO = 1
|
||||||
|
|
||||||
MICROPY_PY_TREZORIO = 0
|
MICROPY_PY_TREZORIO = 1
|
||||||
|
|
||||||
MICROPY_PY_TREZORMSG = 1
|
MICROPY_PY_TREZORMSG = 1
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@
|
|||||||
|
|
||||||
#define MICROPY_PY_TREZORCONFIG (1)
|
#define MICROPY_PY_TREZORCONFIG (1)
|
||||||
#define MICROPY_PY_TREZORCRYPTO (1)
|
#define MICROPY_PY_TREZORCRYPTO (1)
|
||||||
#define MICROPY_PY_TREZORIO (0)
|
#define MICROPY_PY_TREZORIO (1)
|
||||||
#define MICROPY_PY_TREZORMSG (1)
|
#define MICROPY_PY_TREZORMSG (1)
|
||||||
#define MICROPY_PY_TREZORUI (1)
|
#define MICROPY_PY_TREZORUI (1)
|
||||||
#define MICROPY_PY_TREZORUTILS (1)
|
#define MICROPY_PY_TREZORUTILS (1)
|
||||||
|
Loading…
Reference in New Issue
Block a user