summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/samd/fatfs_port.c8
-rw-r--r--ports/samd/machine_rtc.c4
-rw-r--r--ports/samd/modmachine.c8
-rw-r--r--ports/samd/mpconfigport.h1
-rw-r--r--ports/samd/samd_soc.c4
5 files changed, 1 insertions, 24 deletions
diff --git a/ports/samd/fatfs_port.c b/ports/samd/fatfs_port.c
index a3e3f1b67..91912d97d 100644
--- a/ports/samd/fatfs_port.c
+++ b/ports/samd/fatfs_port.c
@@ -33,13 +33,5 @@
extern uint32_t time_offset;
MP_WEAK DWORD get_fattime(void) {
- #if MICROPY_PY_MACHINE_RTC
return (RTC->MODE2.CLOCK.reg >> 1) + (20 << 25);
- #else
- extern void rtc_gettime(timeutils_struct_time_t *tm);
- timeutils_struct_time_t tm;
- timeutils_seconds_since_epoch_to_struct_time(mp_hal_ticks_ms_64() / 1000 + time_offset, &tm);
- return ((tm.tm_year - 1980) << 25) | ((tm.tm_mon) << 21) | ((tm.tm_mday) << 16) |
- ((tm.tm_hour) << 11) | ((tm.tm_min) << 5) | (tm.tm_sec / 2);
- #endif
}
diff --git a/ports/samd/machine_rtc.c b/ports/samd/machine_rtc.c
index e6237f3f3..1f0c9f4dc 100644
--- a/ports/samd/machine_rtc.c
+++ b/ports/samd/machine_rtc.c
@@ -31,8 +31,6 @@
#include "extmod/modmachine.h"
#include "sam.h"
-#if MICROPY_PY_MACHINE_RTC
-
typedef struct _machine_rtc_obj_t {
mp_obj_base_t base;
mp_obj_t callback;
@@ -177,5 +175,3 @@ MP_DEFINE_CONST_OBJ_TYPE(
make_new, machine_rtc_make_new,
locals_dict, &machine_rtc_locals_dict
);
-
-#endif // MICROPY_PY_MACHINE_RTC
diff --git a/ports/samd/modmachine.c b/ports/samd/modmachine.c
index 9aab705bf..c39aec95e 100644
--- a/ports/samd/modmachine.c
+++ b/ports/samd/modmachine.c
@@ -48,16 +48,10 @@
#define LIGHTSLEEP_CPU_FREQ 200000
-#if MICROPY_PY_MACHINE_RTC
-#define MICROPY_PY_MACHINE_RTC_ENTRY { MP_ROM_QSTR(MP_QSTR_RTC), MP_ROM_PTR(&machine_rtc_type) },
-#else
-#define MICROPY_PY_MACHINE_RTC_ENTRY
-#endif
-
#define MICROPY_PY_MACHINE_EXTRA_GLOBALS \
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) }, \
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) }, \
- MICROPY_PY_MACHINE_RTC_ENTRY \
+ { MP_ROM_QSTR(MP_QSTR_RTC), MP_ROM_PTR(&machine_rtc_type) }, \
\
/* Class constants. */ \
/* Use numerical constants instead of the symbolic names, */ \
diff --git a/ports/samd/mpconfigport.h b/ports/samd/mpconfigport.h
index 21c29be24..466a4d775 100644
--- a/ports/samd/mpconfigport.h
+++ b/ports/samd/mpconfigport.h
@@ -109,7 +109,6 @@
#define MICROPY_PY_RANDOM (1)
#define MICROPY_PY_DEFLATE (1)
#define MICROPY_PY_ASYNCIO (1)
-#define MICROPY_PY_MACHINE_RTC (1)
#ifndef MICROPY_PY_MACHINE_ADC
#define MICROPY_PY_MACHINE_ADC (1)
#endif
diff --git a/ports/samd/samd_soc.c b/ports/samd/samd_soc.c
index dcfff9dc2..259640e93 100644
--- a/ports/samd/samd_soc.c
+++ b/ports/samd/samd_soc.c
@@ -38,9 +38,7 @@
#include "tusb.h"
#include "mphalport.h"
-#if MICROPY_PY_MACHINE_RTC
extern void machine_rtc_start(bool force);
-#endif
static void usb_init(void) {
// Init USB clock
@@ -124,9 +122,7 @@ void samd_init(void) {
#if defined(MCU_SAMD51)
mp_hal_ticks_cpu_enable();
#endif
- #if MICROPY_PY_MACHINE_RTC
machine_rtc_start(false);
- #endif
}
#if MICROPY_PY_MACHINE_I2C || MICROPY_PY_MACHINE_SPI || MICROPY_PY_MACHINE_UART