From 26cbc91373cdfff43317da01e102617ed5885655 Mon Sep 17 00:00:00 2001 From: danicampora Date: Mon, 2 Mar 2015 14:11:02 +0100 Subject: cc3200: Place functions only used while booting in a special section. Such functions are never used after MicroPython has started, and they remain in RAM wasting space. Now they are placed in a special section named "boot" which sits just before the heap, allowing us to extend the effective heap area up to the new boot section. Right now, this gives us back ~1K, but in the future, more functions might end up in there as well. --- cc3200/mods/pybrtc.c | 1 + cc3200/mods/pybsd.c | 1 + 2 files changed, 2 insertions(+) (limited to 'cc3200/mods') diff --git a/cc3200/mods/pybrtc.c b/cc3200/mods/pybrtc.c index 5d6c2a7ca..1844a6d7f 100644 --- a/cc3200/mods/pybrtc.c +++ b/cc3200/mods/pybrtc.c @@ -51,6 +51,7 @@ /// rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0)) /// print(rtc.datetime()) +__attribute__ ((section (".boot"))) void pybrtc_init(void) { // if RTC was previously set leave it alone if (MAP_PRCMSysResetCauseGet() == PRCM_POWER_ON) { diff --git a/cc3200/mods/pybsd.c b/cc3200/mods/pybsd.c index 4ae877250..6d326ded5 100644 --- a/cc3200/mods/pybsd.c +++ b/cc3200/mods/pybsd.c @@ -79,6 +79,7 @@ STATIC mp_obj_t pybsd_enable (mp_obj_t self_in); /****************************************************************************** DECLARE PUBLIC FUNCTIONS ******************************************************************************/ +__attribute__ ((section (".boot"))) void pybsd_init0 (void) { // allocate memory for the sd file system ASSERT ((pybsd_obj.fatfs = mem_Malloc(sizeof(FATFS))) != NULL); -- cgit v1.2.3