mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-25 07:48:10 +00:00
modtrezorio: remove mocks
This commit is contained in:
parent
bc6d9b47a3
commit
48ef409fdb
@ -222,8 +222,11 @@ SOURCE_UNIX = [
|
|||||||
'vendor/micropython/ports/unix/moduselect.c',
|
'vendor/micropython/ports/unix/moduselect.c',
|
||||||
'vendor/micropython/ports/unix/alloc.c',
|
'vendor/micropython/ports/unix/alloc.c',
|
||||||
'embed/unix/common.c',
|
'embed/unix/common.c',
|
||||||
'embed/unix/touch.c',
|
|
||||||
'embed/unix/flash.c',
|
'embed/unix/flash.c',
|
||||||
|
'embed/unix/sdcard.c',
|
||||||
|
'embed/unix/sbu.c',
|
||||||
|
'embed/unix/touch.c',
|
||||||
|
'embed/unix/usb.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
SOURCE_EMIT_NATIVE = ['vendor/micropython/py/emitnative.c']
|
SOURCE_EMIT_NATIVE = ['vendor/micropython/py/emitnative.c']
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "norcow.h"
|
#include "norcow.h"
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "../../trezorhal/flash.h"
|
#include "flash.h"
|
||||||
|
|
||||||
#ifndef NORCOW_SECTORS
|
#ifndef NORCOW_SECTORS
|
||||||
#define NORCOW_SECTORS {FLASH_SECTOR_STORAGE_1, FLASH_SECTOR_STORAGE_2}
|
#define NORCOW_SECTORS {FLASH_SECTOR_STORAGE_1, FLASH_SECTOR_STORAGE_2}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define __NORCOW_H__
|
#define __NORCOW_H__
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "../../trezorhal/secbool.h"
|
#include "secbool.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Storage parameters:
|
* Storage parameters:
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "norcow.h"
|
#include "norcow.h"
|
||||||
#include "../../trezorhal/flash.h"
|
#include "flash.h"
|
||||||
|
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/obj.h"
|
#include "py/obj.h"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "../../trezorhal/secbool.h"
|
#include "secbool.h"
|
||||||
#include "py/obj.h"
|
#include "py/obj.h"
|
||||||
|
|
||||||
void storage_init(void);
|
void storage_init(void);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* see LICENSE file for details
|
* see LICENSE file for details
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../trezorhal/flash.h"
|
#include "flash.h"
|
||||||
|
|
||||||
/// class FlashOTP:
|
/// class FlashOTP:
|
||||||
/// '''
|
/// '''
|
||||||
|
@ -8,15 +8,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if defined TREZOR_STM32
|
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
#include "touch.h"
|
#include "touch.h"
|
||||||
#include "pendsv.h"
|
|
||||||
#elif defined TREZOR_UNIX
|
void pendsv_kbd_intr(void);
|
||||||
#include "unix-msg-mock.h"
|
void mp_hal_set_vcp_iface(int iface_num);
|
||||||
#else
|
|
||||||
#error Unsupported TREZOR port. Only STM32 and UNIX ports are supported.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define TOUCH_IFACE (255)
|
#define TOUCH_IFACE (255)
|
||||||
#define POLL_READ (0x0000)
|
#define POLL_READ (0x0000)
|
||||||
|
@ -5,13 +5,7 @@
|
|||||||
* see LICENSE file for details
|
* see LICENSE file for details
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined TREZOR_STM32
|
|
||||||
#include "sbu.h"
|
#include "sbu.h"
|
||||||
#elif defined TREZOR_UNIX
|
|
||||||
#include "unix-sbu-mock.h"
|
|
||||||
#else
|
|
||||||
#error Unsupported TREZOR port. Only STM32 and UNIX ports are supported.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// class SBU:
|
/// class SBU:
|
||||||
/// '''
|
/// '''
|
||||||
|
@ -5,13 +5,7 @@
|
|||||||
* 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
|
|
||||||
|
|
||||||
/// class SDCard:
|
/// class SDCard:
|
||||||
/// '''
|
/// '''
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef __TREZORUNIX_COMMON_H__
|
#ifndef __TREZORUNIX_COMMON_H__
|
||||||
#define __TREZORUNIX_COMMON_H__
|
#define __TREZORUNIX_COMMON_H__
|
||||||
|
|
||||||
#include "../trezorhal/secbool.h"
|
#include "secbool.h"
|
||||||
|
|
||||||
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func);
|
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func);
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "../trezorhal/flash.h"
|
#include "flash.h"
|
||||||
|
|
||||||
#ifndef FLASH_FILE
|
#ifndef FLASH_FILE
|
||||||
#define FLASH_FILE "/var/tmp/trezor.config"
|
#define FLASH_FILE "/var/tmp/trezor.flash"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SECTOR_COUNT 24
|
#define SECTOR_COUNT 24
|
||||||
|
1
embed/unix/flash.h
Symbolic link
1
embed/unix/flash.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/flash.h
|
@ -5,7 +5,7 @@
|
|||||||
* see LICENSE file for details
|
* see LICENSE file for details
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../trezorhal/sbu.h"
|
#include "sbu.h"
|
||||||
|
|
||||||
void sbu_init(void)
|
void sbu_init(void)
|
||||||
{
|
{
|
1
embed/unix/sbu.h
Symbolic link
1
embed/unix/sbu.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/sbu.h
|
@ -5,7 +5,7 @@
|
|||||||
* see LICENSE file for details
|
* see LICENSE file for details
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../trezorhal/sdcard.h"
|
#include "sdcard.h"
|
||||||
|
|
||||||
void sdcard_init(void) {
|
void sdcard_init(void) {
|
||||||
}
|
}
|
1
embed/unix/sdcard.h
Symbolic link
1
embed/unix/sdcard.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/sdcard.h
|
1
embed/unix/secbool.h
Symbolic link
1
embed/unix/secbool.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/secbool.h
|
@ -11,7 +11,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "embed/trezorhal/touch.h"
|
#include "touch.h"
|
||||||
|
|
||||||
void __shutdown(void);
|
void __shutdown(void);
|
||||||
|
|
||||||
|
1
embed/unix/touch.h
Symbolic link
1
embed/unix/touch.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/touch.h
|
@ -13,8 +13,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../../trezorhal/usb.h"
|
#include "usb.h"
|
||||||
#include "../../trezorhal/touch.h"
|
#include "touch.h"
|
||||||
|
|
||||||
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func);
|
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func);
|
||||||
|
|
1
embed/unix/usb.h
Symbolic link
1
embed/unix/usb.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/usb.h
|
1
embed/unix/usb_hid-defs.h
Symbolic link
1
embed/unix/usb_hid-defs.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/usb_hid-defs.h
|
1
embed/unix/usb_vcp-defs.h
Symbolic link
1
embed/unix/usb_vcp-defs.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../trezorhal/usb_vcp-defs.h
|
Loading…
Reference in New Issue
Block a user