Change logger to use LOG_IP makefile directive

This commit is contained in:
Ash 2018-05-10 21:18:56 +10:00
parent 8c5287175c
commit 94235612fe
No known key found for this signature in database
GPG Key ID: 461BAD1D1531729D
4 changed files with 10 additions and 4 deletions

View File

@ -6,6 +6,10 @@ ifeq ($(filter $(DEVKITARM)/bin,$(PATH)),)
export PATH:=$(DEVKITARM)/bin:$(PATH)
endif
ifneq ($(LOG_IP),)
CFLAGS += -DLOG_IP=$(LOG_IP)
endif
CC = arm-none-eabi-gcc
LINK = arm-none-eabi-gcc
AS = arm-none-eabi-as

View File

@ -5,7 +5,7 @@
#include "socket.h"
#include "logger.h"
#ifdef DEBUG_LOGGER
#ifdef LOG_IP
static int log_socket = 0;
int log_init(unsigned int ipAddress)

View File

@ -5,9 +5,7 @@
extern "C" {
#endif
//#define DEBUG_LOGGER 1
#ifdef DEBUG_LOGGER
#ifdef LOG_IP
int log_init(unsigned int ip);
void log_deinit();
void log_printf(const char *format, ...);

View File

@ -210,7 +210,11 @@ static int wupserver_thread(void *arg)
usleep(1000);
}
#ifdef LOG_IP
log_init(LOG_IP);
#else
log_init(0xC0A8B203);
#endif
//print(0, 0, "opened /dev/socket !");
usleep(5*1000*1000);