summaryrefslogtreecommitdiff
path: root/ports/esp8266/modmachine.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp8266/modmachine.c')
-rw-r--r--ports/esp8266/modmachine.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/ports/esp8266/modmachine.c b/ports/esp8266/modmachine.c
index 35d4918bd..e6be0c1af 100644
--- a/ports/esp8266/modmachine.c
+++ b/ports/esp8266/modmachine.c
@@ -84,13 +84,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_reset_cause_obj, machine_reset_cause);
STATIC mp_obj_t machine_unique_id(void) {
uint32_t id = system_get_chip_id();
- return mp_obj_new_bytes((byte*)&id, sizeof(id));
+ return mp_obj_new_bytes((byte *)&id, sizeof(id));
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_unique_id_obj, machine_unique_id);
STATIC mp_obj_t machine_idle(void) {
uint32_t t = mp_hal_ticks_cpu();
- asm("waiti 0");
+ asm ("waiti 0");
t = mp_hal_ticks_cpu() - t;
ets_event_poll(); // handle any events after possibly a long wait (eg feed WDT)
return MP_OBJ_NEW_SMALL_INT(t);
@@ -112,7 +112,7 @@ STATIC mp_obj_t machine_lightsleep(size_t n_args, const mp_obj_t *args) {
ets_event_poll();
if (wifi_mode == NULL_MODE) {
// Can only idle if the wifi is off
- asm("waiti 0");
+ asm ("waiti 0");
}
}
return mp_const_none;
@@ -256,11 +256,11 @@ STATIC mp_obj_t esp_timer_init_helper(esp_timer_obj_t *self, size_t n_args, cons
{ MP_QSTR_callback, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
{ MP_QSTR_period, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0xffffffff} },
{ MP_QSTR_tick_hz, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1000} },
-#if MICROPY_PY_BUILTINS_FLOAT
+ #if MICROPY_PY_BUILTINS_FLOAT
{ MP_QSTR_freq, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
-#else
+ #else
{ MP_QSTR_freq, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0xffffffff} },
-#endif
+ #endif
};
// parse args
@@ -272,7 +272,7 @@ STATIC mp_obj_t esp_timer_init_helper(esp_timer_obj_t *self, size_t n_args, cons
os_timer_disarm(&self->timer);
os_timer_setfn(&self->timer, esp_timer_cb, self);
-#if MICROPY_PY_BUILTINS_FLOAT
+ #if MICROPY_PY_BUILTINS_FLOAT
if (args[ARG_freq].u_obj != mp_const_none) {
mp_float_t freq = mp_obj_get_float(args[ARG_freq].u_obj);
if (freq < 0.001) {
@@ -281,11 +281,11 @@ STATIC mp_obj_t esp_timer_init_helper(esp_timer_obj_t *self, size_t n_args, cons
esp_timer_arm_us(self, (mp_int_t)(1000000 / freq), args[ARG_mode].u_int);
}
}
-#else
+ #else
if (args[ARG_freq].u_int != 0xffffffff) {
esp_timer_arm_us(self, 1000000 / args[ARG_freq].u_int, args[ARG_mode].u_int);
}
-#endif
+ #endif
else {
mp_int_t period = args[ARG_period].u_int;
mp_int_t hz = args[ARG_tick_hz].u_int;
@@ -333,7 +333,7 @@ const mp_obj_type_t esp_timer_type = {
.name = MP_QSTR_Timer,
.print = esp_timer_print,
.make_new = esp_timer_make_new,
- .locals_dict = (mp_obj_dict_t*)&esp_timer_locals_dict,
+ .locals_dict = (mp_obj_dict_t *)&esp_timer_locals_dict,
};
// this bit is unused in the Xtensa PS register
@@ -434,7 +434,7 @@ STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table
const mp_obj_module_t mp_module_machine = {
.base = { &mp_type_module },
- .globals = (mp_obj_dict_t*)&machine_module_globals,
+ .globals = (mp_obj_dict_t *)&machine_module_globals,
};
#endif // MICROPY_PY_MACHINE