From 95cc1ff542cac5af726b89b87bbeedc7d140aeb7 Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Wed, 10 Jun 2015 19:30:56 +0200 Subject: [PATCH] cc3200: Re-name pyb.hard_reset() to pyb.reset(). --- cc3200/mods/modpyb.c | 17 ++++++++++------- cc3200/qstrdefsport.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cc3200/mods/modpyb.c b/cc3200/mods/modpyb.c index 1e8dc1f0ee..b56502589a 100644 --- a/cc3200/mods/modpyb.c +++ b/cc3200/mods/modpyb.c @@ -82,17 +82,17 @@ extern OsiTaskHandle xSimpleLinkSpawnTaskHndl; /// /// The `pyb` module contains specific functions related to the pyboard. -/// \function hard_reset() -/// Resets the pyboard in a manner similar to pushing the external RESET -/// button. -STATIC mp_obj_t pyb_hard_reset(void) { +/// \function reset() +/// Resets the pyboard in a manner similar to pushing the external +/// reset button. +STATIC mp_obj_t pyb_reset(void) { // disable wlan wlan_stop(SL_STOP_TIMEOUT_LONG); // reset the cpu and it's peripherals MAP_PRCMMCUReset(true); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_hard_reset_obj, pyb_hard_reset); +STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_reset_obj, pyb_reset); #ifdef DEBUG /// \function info([dump_alloc_table]) @@ -126,7 +126,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_info_obj, 0, 1, pyb_info); /// \function freq() /// Returns the CPU frequency: (F_CPU). STATIC mp_obj_t pyb_freq(void) { - return mp_obj_new_int(HAL_FCPU_HZ); + mp_obj_t tuple[1] = { + mp_obj_new_int(HAL_FCPU_HZ), + }; + return mp_obj_new_tuple(1, tuple); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_freq_obj, pyb_freq); @@ -250,7 +253,7 @@ MP_DECLARE_CONST_FUN_OBJ(pyb_main_obj); // defined in main.c STATIC const mp_map_elem_t pyb_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_pyb) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_hard_reset), (mp_obj_t)&pyb_hard_reset_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_reset), (mp_obj_t)&pyb_reset_obj }, #ifdef DEBUG { MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, #endif diff --git a/cc3200/qstrdefsport.h b/cc3200/qstrdefsport.h index 6fa176d1ac..c9e1314cbf 100644 --- a/cc3200/qstrdefsport.h +++ b/cc3200/qstrdefsport.h @@ -30,7 +30,7 @@ Q(__name__) Q(help) Q(pyb) Q(info) -Q(hard_reset) +Q(reset) Q(main) Q(sync) Q(gc)