mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
further changes to trezor.storage
This commit is contained in:
parent
9ed3b24edf
commit
0fb6fc05a5
@ -16,6 +16,8 @@
|
||||
|
||||
#if MICROPY_PY_TREZORSTORAGE
|
||||
|
||||
#include "storage.h"
|
||||
|
||||
typedef struct _mp_obj_Storage_t {
|
||||
mp_obj_base_t base;
|
||||
} mp_obj_Storage_t;
|
||||
@ -27,12 +29,12 @@ STATIC mp_obj_t mod_TrezorStorage_Storage_make_new(const mp_obj_type_t *type, si
|
||||
return MP_OBJ_FROM_PTR(o);
|
||||
}
|
||||
|
||||
STATIC mp_obj_t mod_TrezorStorage_Storage_get(mp_obj_t self, mp_obj_t name, mp_obj_t defval) {
|
||||
STATIC mp_obj_t mod_TrezorStorage_Storage_get(mp_obj_t self, mp_obj_t key, mp_obj_t defval) {
|
||||
return mp_const_none;
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorStorage_Storage_get_obj, mod_TrezorStorage_Storage_get);
|
||||
|
||||
STATIC mp_obj_t mod_TrezorStorage_Storage_set(mp_obj_t self, mp_obj_t name, mp_obj_t value) {
|
||||
STATIC mp_obj_t mod_TrezorStorage_Storage_set(mp_obj_t self, mp_obj_t key, mp_obj_t value) {
|
||||
return mp_const_none;
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_TrezorStorage_Storage_set_obj, mod_TrezorStorage_Storage_set);
|
||||
|
8
extmod/modtrezorstorage/storage-stmhal.h
Normal file
8
extmod/modtrezorstorage/storage-stmhal.h
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) Pavol Rusnak, SatoshiLabs
|
||||
*
|
||||
* Licensed under Microsoft Reference Source License (Ms-RSL)
|
||||
* see LICENSE.md file for details
|
||||
*/
|
||||
|
||||
#include STM32_HAL_H
|
6
extmod/modtrezorstorage/storage-unix.h
Normal file
6
extmod/modtrezorstorage/storage-unix.h
Normal file
@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) Pavol Rusnak, SatoshiLabs
|
||||
*
|
||||
* Licensed under Microsoft Reference Source License (Ms-RSL)
|
||||
* see LICENSE.md file for details
|
||||
*/
|
12
extmod/modtrezorstorage/storage.c
Normal file
12
extmod/modtrezorstorage/storage.c
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) Pavol Rusnak, SatoshiLabs
|
||||
*
|
||||
* Licensed under Microsoft Reference Source License (Ms-RSL)
|
||||
* see LICENSE.md file for details
|
||||
*/
|
||||
|
||||
#if defined STM32_HAL_H
|
||||
#include "storage-stmhal.h"
|
||||
#else
|
||||
#include "storage-unix.h"
|
||||
#endif
|
11
extmod/modtrezorstorage/storage.h
Normal file
11
extmod/modtrezorstorage/storage.h
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) Pavol Rusnak, SatoshiLabs
|
||||
*
|
||||
* Licensed under Microsoft Reference Source License (Ms-RSL)
|
||||
* see LICENSE.md file for details
|
||||
*/
|
||||
|
||||
#ifndef __STORAGE_H__
|
||||
#define __STORAGE_H__
|
||||
|
||||
#endif
|
@ -2,10 +2,9 @@ from TrezorStorage import Storage
|
||||
|
||||
_storage = Storage()
|
||||
|
||||
|
||||
def get(name, defval=None):
|
||||
return _storage.get(name, defval)
|
||||
def get(key, defval=None):
|
||||
return _storage.get(key, defval)
|
||||
|
||||
|
||||
def set(name, value):
|
||||
return _storage.set(name, value)
|
||||
def set(key, value):
|
||||
return _storage.set(key, value)
|
||||
|
2
vendor/micropython
vendored
2
vendor/micropython
vendored
@ -1 +1 @@
|
||||
Subproject commit daf5c296c3ff98cb9f043b365b478ede586ee5d1
|
||||
Subproject commit 9cee3cdb8fc0444e292308cbbabee12e98e2fd07
|
Loading…
Reference in New Issue
Block a user