kopia lustrzana https://github.com/bristol-seds/pico-tracker
Added support and example for libm
rodzic
80c7440f81
commit
9955b7d050
2
Makefile
2
Makefile
|
@ -95,7 +95,7 @@ endif
|
|||
CFLAGS += $(COMPILATION_FLAGS) -Wall -Wextra $(ACCEPT_WARN) -std=gnu99 \
|
||||
-ffunction-sections -fdata-sections $(ARCH_FLAGS)
|
||||
ASFLAGS += -Wall $(ARCH_FLAGS) -a=/dev/null
|
||||
LDFLAGS += $(COMPILATION_FLAGS) -lm $(LINKER_FLAGS) -lm -Wextra $(ARCH_FLAGS)
|
||||
LDFLAGS += $(COMPILATION_FLAGS) $(LINKER_FLAGS) -Wextra $(ARCH_FLAGS)
|
||||
|
||||
# Compilation Defines
|
||||
#
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
GROUP(libgcc.a libc.a libm.a)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "pindefs.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "semihosting.h"
|
||||
|
||||
int main(void)
|
||||
|
@ -41,7 +42,12 @@ int main(void)
|
|||
/* Configure the SysTick for 50ms interrupts */
|
||||
SysTick_Config(SystemCoreClock / 20);
|
||||
|
||||
semihost_printf("Hello World\n");
|
||||
volatile double d, dd;
|
||||
|
||||
d = 2;
|
||||
dd = sqrt(d);
|
||||
|
||||
semihost_printf("Hello World %f\n", dd);
|
||||
|
||||
while (1);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue