aboutsummaryrefslogtreecommitdiff
path: root/projects/libhal-test
diff options
context:
space:
mode:
Diffstat (limited to 'projects/libhal-test')
-rw-r--r--projects/libhal-test/Makefile11
-rw-r--r--projects/libhal-test/gettimeofday.c2
-rw-r--r--projects/libhal-test/main.c12
-rw-r--r--projects/libhal-test/printf.c6
4 files changed, 11 insertions, 20 deletions
diff --git a/projects/libhal-test/Makefile b/projects/libhal-test/Makefile
index f58f480..c5dbc84 100644
--- a/projects/libhal-test/Makefile
+++ b/projects/libhal-test/Makefile
@@ -1,12 +1,12 @@
-TEST = cores test-bus test-trng test-hash test-aes-key-wrap test-pbkdf2 test-ecdsa test-rsa test-mkmif
+TEST = cores test-bus test-trng test-hash test-aes-key-wrap test-pbkdf2 test-ecdsa test-rsa
-CFLAGS += -I $(LIBHAL_DIR)
+CFLAGS += -I $(LIBHAL_SRC)
LIBC_OBJS = printf.o gettimeofday.o
-LIBS += $(LIBHAL_DIR)/libhal.a $(LIBTFM_DIR)/libtfm.a
+LIBS += $(LIBHAL_BLD)/libhal.a $(LIBTFM_BLD)/libtfm.a
all: $(TEST:=.elf)
-vpath %.c $(LIBHAL_DIR)/tests $(LIBHAL_DIR)/utils
+vpath %.c $(LIBHAL_SRC)/tests $(LIBHAL_SRC)/utils
# .mo extension for files with main() that need to be wrapped as __main()
%.mo: %.c
@@ -17,9 +17,6 @@ vpath %.c $(LIBHAL_DIR)/tests $(LIBHAL_DIR)/utils
$(OBJCOPY) -O binary $*.elf $*.bin
$(SIZE) $*.elf
-# don't automatically delete objects, to avoid a lot of unnecessary rebuilding
-.SECONDARY: $(BOARD_OBJS) $(LIBC_OBJS)
-
clean:
rm -f *.o *.mo
rm -f *.elf
diff --git a/projects/libhal-test/gettimeofday.c b/projects/libhal-test/gettimeofday.c
index b13485d..f7a87f1 100644
--- a/projects/libhal-test/gettimeofday.c
+++ b/projects/libhal-test/gettimeofday.c
@@ -56,6 +56,8 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
{
uint32_t tick = HAL_GetTick(); /* uptime in ms */
+ tz = tz;
+
tv->tv_sec = tick / 1000;
tv->tv_usec = (tick % 1000) * 1000;
diff --git a/projects/libhal-test/main.c b/projects/libhal-test/main.c
index a40871b..c0d9330 100644
--- a/projects/libhal-test/main.c
+++ b/projects/libhal-test/main.c
@@ -43,18 +43,8 @@ extern void __main(void);
int main(void)
{
stm_init();
-
-#ifdef TARGET_CRYPTECH_DEV_BRIDGE
- // Blink blue LED for six seconds to not upset the Novena at boot.
- led_on(LED_BLUE);
- for (int i = 0; i < 12; i++) {
- HAL_Delay(500);
- led_toggle(LED_BLUE);
- }
- led_off(LED_BLUE);
-#endif
+ HAL_Delay(500);
led_on(LED_GREEN);
- fmc_init();
__main();
diff --git a/projects/libhal-test/printf.c b/projects/libhal-test/printf.c
index 5a15d12..85af09b 100644
--- a/projects/libhal-test/printf.c
+++ b/projects/libhal-test/printf.c
@@ -244,7 +244,7 @@ OK, I found my mistake. The math here is _always_ unsigned */
if (precision != 0)
{
width = max(width, precision);
- if (precision > strlen(where))
+ if (precision > strlen((const char *)where))
flags |= PR_LZ;
precision = 0;
}
@@ -295,7 +295,7 @@ EMIT2: if((flags & PR_LJ) == 0)
count++;
}
/* emit string/char/converted number */
- for(int i = (flags & PR_WS) ? 1 : 0;
+ for(unsigned i = (flags & PR_WS) ? 1 : 0;
i < length; ++i)
{
fn(*where++, &ptr);
@@ -362,6 +362,8 @@ You must write your own putchar()
*****************************************************************************/
int vprintf_help(unsigned c, void **ptr)
{
+ ptr = ptr;
+
putchar(c);
return 0 ;
}