1
0
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:
Pavol Rusnak 2016-05-22 22:23:14 +02:00
parent 9ed3b24edf
commit 0fb6fc05a5
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
7 changed files with 46 additions and 8 deletions

View File

@ -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);

View 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

View File

@ -0,0 +1,6 @@
/*
* Copyright (c) Pavol Rusnak, SatoshiLabs
*
* Licensed under Microsoft Reference Source License (Ms-RSL)
* see LICENSE.md file for details
*/

View 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

View 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

View File

@ -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

@ -1 +1 @@
Subproject commit daf5c296c3ff98cb9f043b365b478ede586ee5d1
Subproject commit 9cee3cdb8fc0444e292308cbbabee12e98e2fd07