modtrezorio: remove mocks

This commit is contained in:
Pavol Rusnak 2017-12-15 00:06:09 +01:00
parent bc6d9b47a3
commit 48ef409fdb
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
23 changed files with 29 additions and 33 deletions

View File

@ -222,8 +222,11 @@ SOURCE_UNIX = [
'vendor/micropython/ports/unix/moduselect.c',
'vendor/micropython/ports/unix/alloc.c',
'embed/unix/common.c',
'embed/unix/touch.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']

View File

@ -3,7 +3,7 @@
#include "norcow.h"
#include "common.h"
#include "../../trezorhal/flash.h"
#include "flash.h"
#ifndef NORCOW_SECTORS
#define NORCOW_SECTORS {FLASH_SECTOR_STORAGE_1, FLASH_SECTOR_STORAGE_2}

View File

@ -2,7 +2,7 @@
#define __NORCOW_H__
#include <stdint.h>
#include "../../trezorhal/secbool.h"
#include "secbool.h"
/*
* Storage parameters:

View File

@ -9,7 +9,8 @@
#include "common.h"
#include "norcow.h"
#include "../../trezorhal/flash.h"
#include "flash.h"
#include "py/runtime.h"
#include "py/obj.h"

View File

@ -7,7 +7,7 @@
#include <stdint.h>
#include <stddef.h>
#include "../../trezorhal/secbool.h"
#include "secbool.h"
#include "py/obj.h"
void storage_init(void);

View File

@ -5,7 +5,7 @@
* see LICENSE file for details
*/
#include "../../trezorhal/flash.h"
#include "flash.h"
/// class FlashOTP:
/// '''

View File

@ -8,15 +8,11 @@
#include <string.h>
#include <unistd.h>
#if defined TREZOR_STM32
#include "usb.h"
#include "touch.h"
#include "pendsv.h"
#elif defined TREZOR_UNIX
#include "unix-msg-mock.h"
#else
#error Unsupported TREZOR port. Only STM32 and UNIX ports are supported.
#endif
void pendsv_kbd_intr(void);
void mp_hal_set_vcp_iface(int iface_num);
#define TOUCH_IFACE (255)
#define POLL_READ (0x0000)

View File

@ -5,13 +5,7 @@
* see LICENSE file for details
*/
#if defined TREZOR_STM32
#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:
/// '''

View File

@ -5,13 +5,7 @@
* see LICENSE file for details
*/
#if defined TREZOR_STM32
#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:
/// '''

View File

@ -1,7 +1,7 @@
#ifndef __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);

View File

@ -14,10 +14,10 @@
#include <sys/types.h>
#include "common.h"
#include "../trezorhal/flash.h"
#include "flash.h"
#ifndef FLASH_FILE
#define FLASH_FILE "/var/tmp/trezor.config"
#define FLASH_FILE "/var/tmp/trezor.flash"
#endif
#define SECTOR_COUNT 24

1
embed/unix/flash.h Symbolic link
View File

@ -0,0 +1 @@
../trezorhal/flash.h

View File

@ -5,7 +5,7 @@
* see LICENSE file for details
*/
#include "../../trezorhal/sbu.h"
#include "sbu.h"
void sbu_init(void)
{

1
embed/unix/sbu.h Symbolic link
View File

@ -0,0 +1 @@
../trezorhal/sbu.h

View File

@ -5,7 +5,7 @@
* see LICENSE file for details
*/
#include "../../trezorhal/sdcard.h"
#include "sdcard.h"
void sdcard_init(void) {
}

1
embed/unix/sdcard.h Symbolic link
View File

@ -0,0 +1 @@
../trezorhal/sdcard.h

1
embed/unix/secbool.h Symbolic link
View File

@ -0,0 +1 @@
../trezorhal/secbool.h

View File

@ -11,7 +11,7 @@
#endif
#include "options.h"
#include "embed/trezorhal/touch.h"
#include "touch.h"
void __shutdown(void);

1
embed/unix/touch.h Symbolic link
View File

@ -0,0 +1 @@
../trezorhal/touch.h

View File

@ -13,8 +13,8 @@
#include <stdlib.h>
#include <string.h>
#include "../../trezorhal/usb.h"
#include "../../trezorhal/touch.h"
#include "usb.h"
#include "touch.h"
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
View File

@ -0,0 +1 @@
../trezorhal/usb.h

1
embed/unix/usb_hid-defs.h Symbolic link
View File

@ -0,0 +1 @@
../trezorhal/usb_hid-defs.h

1
embed/unix/usb_vcp-defs.h Symbolic link
View File

@ -0,0 +1 @@
../trezorhal/usb_vcp-defs.h