]> the.earth.li Git - esp8266-clock.git/commitdiff
Update for SDK 3.0.4 main
authorJonathan McDowell <noodles@earth.li>
Sun, 11 Jul 2021 16:16:10 +0000 (17:16 +0100)
committerJonathan McDowell <noodles@earth.li>
Sun, 11 Jul 2021 16:16:10 +0000 (17:16 +0100)
Add missing crypto library for linking, remove stdbool as it conflicts
with c_types from the SDK and include the user_pre_init() setup function
now required.

Makefile
max7219.c
user_main.c

index 572e7a320341d06c51450b413250e73ffe37163c..401642aba8b967e255eaff60607502edcf85847b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ LD = xtensa-lx106-elf-gcc
 OBJCOPY = xtensa-lx106-elf-objcopy
 OBJDUMP = xtensa-lx106-elf-objdump
 
-LIBS = -lc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lmain
+LIBS = -lc -lcrypto -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lmain
 
 CFLAGS = -Wall -Os -fno-inline-functions -mlongcalls -DICACHE_FLASH -I. \
         -I$(SDKDIR)/xtensa-lx106-elf/include
index 0aa7bd6d3d34ce74e9a33784ed84813bf20713a2..3793d6347a71e8315bc63f6e3f2ed38bca17bf4b 100644 (file)
--- a/max7219.c
+++ b/max7219.c
@@ -14,7 +14,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-#include <stdbool.h>
 #include <stdint.h>
 #include <stdlib.h>
 
index 26150f8bbe640c9552e245be23ba3df7957b2084..8bd1628975429e79b388f43edeca12916ea0ad90 100644 (file)
@@ -144,6 +144,42 @@ void ICACHE_FLASH_ATTR wifi_init(void)
        wifi_set_event_handler_cb(wifi_callback);
 }
 
+#define SYSTEM_PARTITION_CUSTOMER_PRIV_PARAM SYSTEM_PARTITION_CUSTOMER_BEGIN
+
+void user_pre_init(void)
+{
+       partition_item_t p_table[] = {
+               { SYSTEM_PARTITION_BOOTLOADER,          0x00000, 0x01000 },
+               { SYSTEM_PARTITION_OTA_1,               0x01000, 0x76000 },
+               { SYSTEM_PARTITION_OTA_2,               0x81000, 0x76000 },
+               { SYSTEM_PARTITION_RF_CAL,              0xFB000, 0x01000 },
+               { SYSTEM_PARTITION_PHY_DATA,            0xFC000, 0x01000 },
+               { SYSTEM_PARTITION_SYSTEM_PARAMETER,    0xFD000, 0x03000 },
+       };
+       uint32_t map = system_get_flash_size_map();
+
+       switch (map) {
+       case FLASH_SIZE_8M_MAP_512_512: /* 1MB /  8Mb */
+               break;
+       case FLASH_SIZE_32M_MAP_512_512: /* 4MB / 32Mb */
+               /* Fix up system partition table bits */
+               p_table[5].addr += 0x300000;
+               p_table[6].addr += 0x300000;
+               p_table[7].addr += 0x300000;
+               break;
+       default:
+               os_printf("Unknown flash map %u\n", map);
+               while(1) ;
+       }
+
+       if (!system_partition_table_regist(p_table,
+                               sizeof(p_table)/sizeof(p_table[0]),
+                               map)) {
+               os_printf("system_partition_table_regist fail\n");
+               while(1);
+       }
+}
+
 void user_init(void)
 {
        /* Fix up UART0 baud rate */