# HG changeset patch # User Ethan Zonca # Date 2016-03-25 23:06:22 # Node ID 28c7e1414fd9a962a0efcec00afd8de9966f03c2 # Parent 4202475a75753467c7d0eb87fd4f09906395f2ee Disabled link-time optimization which fixed jump to rst vector on encode, downside is code size grew diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -38,9 +38,12 @@ SI5351_INCLUDES = -Ilib/si5351 JTENCODE_INCLUDES = -Ilib/jtencode # USER_CFLAGS: user C flags (enable warnings, enable debug info) -USER_CFLAGS = -Wall -g -ffunction-sections -fdata-sections -Os -fno-common --function-sections -fdata-sections -flto +USER_CFLAGS = -Wall -g -ffunction-sections -fdata-sections -Os -fno-common --function-sections -fdata-sections +#USER_CFLAGS += -flto + # USER_LDFLAGS: user LD flags -USER_LDFLAGS = -flto -fno-exceptions -ffunction-sections -fdata-sections -Wl,--gc-sections +USER_LDFLAGS = -fno-exceptions -ffunction-sections -fdata-sections -Wl,--gc-sections +#USER_LDFLAGS += -flto USER_LDFLAGS += --static #USER_LDFLAGS += -nostartfiles diff --git a/STM32F031G6_FLASH.ld b/STM32F031G6_FLASH.ld --- a/STM32F031G6_FLASH.ld +++ b/STM32F031G6_FLASH.ld @@ -35,7 +35,7 @@ ENTRY(Reset_Handler) /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0; /* required amount of heap */ -_Min_Stack_Size = 0x300; /* required amount of stack */ +_Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -15,7 +15,6 @@ void sysclk_init(void); -//#define WSPR_DEFAULT_FREQ 14097100UL #define WSPR_DEFAULT_FREQ 10140100UL #define WSPR_TONE_SPACING 146 // ~1.46 Hz #define WSPR_CTC 10672 // CTC value for WSPR @@ -34,31 +33,29 @@ volatile uint8_t proceed = 0; void encode_wspr(void) { - uint8_t i; - //for(i=0; i<255; i++) - // tx_buffer[i] = 0; - + // Encode message to transmit wspr_encode(call, loc, dbm, tx_buffer); + // Key transmitter + si5351_output_enable(SI5351_CLK0, 1); - //si5351_output_enable(SI5351_CLK0, 1); - + // Loop through and transmit symbols TODO: Do this from an ISR or ISR-triggered main loop function call (optimal) + uint8_t i; for(i=0; i 6000) + if(HAL_GetTick() - last_wspr > 120000) { + encode_wspr(); last_wspr = HAL_GetTick(); }