aboutsummaryrefslogtreecommitdiff
path: root/stmhal
diff options
context:
space:
mode:
authorDamien George2014-06-01 13:32:54 +0100
committerDamien George2014-06-01 13:32:54 +0100
commitfb510b3bf90eccc8e0d400c6622b2e94c2bfa8e9 (patch)
tree9160abef8ff03cba6ba2d1d5664f5fb706917355 /stmhal
parentc60a261ef03f906ae1973f93c63169a5236f0b1f (diff)
Rename bultins config variables to MICROPY_PY_BUILTINS_*.
This renames: MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT See issue #35 for discussion.
Diffstat (limited to 'stmhal')
-rw-r--r--stmhal/modtime.c4
-rw-r--r--stmhal/mpconfigport.h2
-rw-r--r--stmhal/printf.c4
-rw-r--r--stmhal/servo.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/stmhal/modtime.c b/stmhal/modtime.c
index 2e50a58df..4fbee3129 100644
--- a/stmhal/modtime.c
+++ b/stmhal/modtime.c
@@ -74,11 +74,11 @@ STATIC mp_obj_t time_localtime(void) {
MP_DEFINE_CONST_FUN_OBJ_0(time_localtime_obj, time_localtime);
STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
-#if MICROPY_ENABLE_FLOAT
+#if MICROPY_PY_BUILTINS_FLOAT
if (MP_OBJ_IS_INT(seconds_o)) {
#endif
HAL_Delay(1000 * mp_obj_get_int(seconds_o));
-#if MICROPY_ENABLE_FLOAT
+#if MICROPY_PY_BUILTINS_FLOAT
} else {
HAL_Delay((uint32_t)(1000 * mp_obj_get_float(seconds_o)));
}
diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h
index 33b81336c..36a60dfa7 100644
--- a/stmhal/mpconfigport.h
+++ b/stmhal/mpconfigport.h
@@ -44,7 +44,7 @@
*/
#define MICROPY_ENABLE_LFN (1)
#define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
-#define MICROPY_PY_FROZENSET (1)
+#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_CMATH (1)
diff --git a/stmhal/printf.c b/stmhal/printf.c
index 3f88a9c5a..6cfeda263 100644
--- a/stmhal/printf.c
+++ b/stmhal/printf.c
@@ -41,7 +41,7 @@
#include "uart.h"
#include "usb.h"
-#if MICROPY_ENABLE_FLOAT
+#if MICROPY_PY_BUILTINS_FLOAT
#include "formatfloat.h"
#endif
@@ -162,7 +162,7 @@ int pfenv_printf(const pfenv_t *pfenv, const char *fmt, va_list args) {
case 'P': // ?
chrs += pfenv_print_int(pfenv, va_arg(args, int), 0, 16, 'A', flags, fill, width);
break;
-#if MICROPY_ENABLE_FLOAT
+#if MICROPY_PY_BUILTINS_FLOAT
case 'e':
case 'E':
case 'f':
diff --git a/stmhal/servo.c b/stmhal/servo.c
index e44e129ef..3da445fa8 100644
--- a/stmhal/servo.c
+++ b/stmhal/servo.c
@@ -271,7 +271,7 @@ STATIC mp_obj_t pyb_servo_angle(uint n_args, const mp_obj_t *args) {
// get angle
return mp_obj_new_int((self->pulse_cur - self->pulse_centre) * 90 / self->pulse_angle_90);
} else {
-#if MICROPY_ENABLE_FLOAT
+#if MICROPY_PY_BUILTINS_FLOAT
self->pulse_dest = self->pulse_centre + self->pulse_angle_90 * mp_obj_get_float(args[1]) / 90.0;
#else
self->pulse_dest = self->pulse_centre + self->pulse_angle_90 * mp_obj_get_int(args[1]) / 90;
@@ -301,7 +301,7 @@ STATIC mp_obj_t pyb_servo_speed(uint n_args, const mp_obj_t *args) {
// get speed
return mp_obj_new_int((self->pulse_cur - self->pulse_centre) * 100 / self->pulse_speed_100);
} else {
-#if MICROPY_ENABLE_FLOAT
+#if MICROPY_PY_BUILTINS_FLOAT
self->pulse_dest = self->pulse_centre + self->pulse_speed_100 * mp_obj_get_float(args[1]) / 100.0;
#else
self->pulse_dest = self->pulse_centre + self->pulse_speed_100 * mp_obj_get_int(args[1]) / 100;