mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 20:50:14 +01:00
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.
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user