build hello fw with GCC Toolchain v2020.04.1 (set GPIO_IOF_EN). Remove obsolete function write_hex
This commit is contained in:
@ -25,8 +25,7 @@ LIBWRAP_SRCS := \
|
||||
sys/isatty.c \
|
||||
sys/times.c \
|
||||
sys/sbrk.c \
|
||||
sys/_exit.c \
|
||||
misc/write_hex.c
|
||||
sys/_exit.c
|
||||
|
||||
LIBWRAP_SRCS := $(foreach f,$(LIBWRAP_SRCS),$(LIBWRAP_DIR)/$(f))
|
||||
LIBWRAP_OBJS := $(LIBWRAP_SRCS:.c=.o)
|
||||
|
@ -1,19 +0,0 @@
|
||||
/* See LICENSE of license details. */
|
||||
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include "platform.h"
|
||||
|
||||
void write_hex(int fd, uint32_t hex)
|
||||
{
|
||||
uint8_t ii;
|
||||
uint8_t jj;
|
||||
char towrite;
|
||||
write(fd , "0x", 2);
|
||||
for (ii = 8 ; ii > 0; ii--) {
|
||||
jj = ii - 1;
|
||||
uint8_t digit = ((hex & (0xF << (jj*4))) >> (jj*4));
|
||||
towrite = digit < 0xA ? ('0' + digit) : ('A' + (digit - 0xA));
|
||||
write(fd, &towrite, 1);
|
||||
}
|
||||
}
|
@ -10,7 +10,6 @@ void __wrap__exit(int code)
|
||||
//*leds = (~(code));
|
||||
|
||||
write(STDERR_FILENO, message, sizeof(message) - 1);
|
||||
write_hex(STDERR_FILENO, code);
|
||||
write(STDERR_FILENO, "\n", 1);
|
||||
|
||||
for (;;);
|
||||
|
Reference in New Issue
Block a user