stmhal: Enable patch_program in cc3k driver, with key.

This commit is contained in:
Damien George 2014-09-30 23:43:38 +01:00
parent e5cc4b2503
commit de37775a26
2 changed files with 10 additions and 6 deletions

View File

@ -218,9 +218,8 @@ SRC_MOD += $(addprefix $(CC3000_DIR)/src/,\
ccspi.c \
inet_ntop.c \
inet_pton.c \
)
# patch.c \
# patch_prog.c \
patch.c \
patch_prog.c \
)
endif

View File

@ -288,11 +288,16 @@ STATIC mp_obj_t cc3k_patch_version(mp_obj_t self_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(cc3k_patch_version_obj, cc3k_patch_version);
STATIC mp_obj_t cc3k_patch_program(mp_obj_t self_in) {
//patch_prog_start();
STATIC mp_obj_t cc3k_patch_program(mp_obj_t self_in, mp_obj_t key_in) {
const char *key = mp_obj_str_get_str(key_in);
if (key[0] == 'p' && key[1] == 'g' && key[2] == 'm' && key[3] == '\0') {
patch_prog_start();
} else {
printf("please pass 'pgm' as argument in order to program\n");
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(cc3k_patch_program_obj, cc3k_patch_program);
STATIC MP_DEFINE_CONST_FUN_OBJ_2(cc3k_patch_program_obj, cc3k_patch_program);
STATIC const mp_map_elem_t cc3k_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_connect), (mp_obj_t)&cc3k_connect_obj },