Skip to content

Commit 4c249d5

Browse files
committed
Enabled SysTick interrupt for time.sleep to work. Cleaned up optimization settings.
1 parent ecba079 commit 4c249d5

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

ports/analog/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,31 +141,31 @@ SRC_S += supervisor/cpu.s \
141141
$(STARTUPFILE)
142142

143143
# Needed to compile some MAX32 headers
144-
CFLAGS += -D$(MCU_VARIANT_UPPER) \
144+
CFLAGS += -D$(MCU_VARIANT_UPPER) \
145145
-DTARGET_REV=0x4131 \
146146
-DTARGET=$(MCU_VARIANT_UPPER) \
147147
-DIAR_PRAGMAS=0 \
148148
-DRISCV_LOAD=0 \
149149
-DCONFIG_TRUSTED_EXECUTION_SECURE=0
150150

151151
# todo: add these for linkerfiles later on so that it's easier to add new boards
152-
# -DFLASH_ORIGIN=0x10000000 \
153-
# -DFLASH_SIZE=0x340000 \
154-
# -DSRAM_ORIGIN=0x20000000 \
155-
# -DSRAM_SIZE=0x100000
152+
# -DFLASH_ORIGIN \
153+
# -DFLASH_SIZE \
154+
# -DSRAM_ORIGIN \
155+
# -DSRAM_SIZE
156156

157157
CPU_CORE=cortex-m4
158158
CFLAGS += -mthumb -mcpu=$(CPU_CORE) -mfloat-abi=softfp -mfpu=fpv4-sp-d16
159159

160-
# NOTE: Start with DEBUG ONLY settings for now
160+
# NOTE: Start with DEBUG=1 defaults for now
161161
ifeq ($(DEBUG),)
162162
DEBUG ?= 1
163163
endif
164164

165165
ifeq ($(DEBUG),1)
166-
COPT = -Og -ggdb3 -Os
166+
COPT = -ggdb3 -Og -Os
167167
else
168-
COPT += -Os #opt completely off to start
168+
COPT += -Os
169169
endif
170170

171171
# TinyUSB CFLAGS

ports/analog/supervisor/port.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,14 @@ static uint32_t tick_flag = 0;
6565
// defined by cmsis core files
6666
extern void NVIC_SystemReset(void) NORETURN;
6767

68+
// FIXME: Currently have an issue with time.sleep b/c MXC_Delay uses SysTick,
69+
// and SysTick ISR isn't happening. Seems that MXC_Delay results in inf. loop
6870
safe_mode_t port_init(void) {
6971
int err = E_NO_ERROR;
7072

7173
// 1ms tick timer
7274
SysTick_Config(SystemCoreClock / 1000);
75+
NVIC_EnableIRQ(SysTick_IRQn); // FIXME: Test with NVIC Enable here before committing
7376

7477
// Enable GPIO (enables clocks + common init for ports)
7578
for (int i = 0; i < MXC_CFG_GPIO_INSTANCES; i++) {

0 commit comments

Comments
 (0)