-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sd, udp, tcp * logging 30 mins on car
- Loading branch information
Showing
38 changed files
with
28,928 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
add_library(log INTERFACE) | ||
|
||
# Find directories for '#include', this directroy for the simple lib | ||
target_include_directories(log INTERFACE .) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#ifndef __LOG_H__ | ||
#define __LOG_H__ | ||
|
||
#include <stdio.h> | ||
#include <stdbool.h> | ||
|
||
extern void _log_str(char* data); | ||
extern char log_buffer[]; | ||
|
||
#define log_printf(...) do { \ | ||
sprintf(log_buffer, __VA_ARGS__); \ | ||
_log_str(log_buffer); \ | ||
} while(false) | ||
// #define log_printf(...) sprintf(log_buffer, __VA_ARGS__) | ||
|
||
|
||
#define ANSI_RED "\x1b[31m" | ||
#define ANSI_GREEN "\x1b[32m" | ||
#define ANSI_YELLOW "\x1b[33m" | ||
#define ANSI_BLUE "\x1b[34m" | ||
#define ANSI_MAGENTA "\x1b[35m" | ||
#define ANSI_CYAN "\x1b[36m" | ||
#define ANSI_RESET "\x1b[37m" | ||
|
||
#define __mu_log_color(color, ...) do { \ | ||
log_printf("%s", color); \ | ||
log_printf(__VA_ARGS__); \ | ||
log_printf("%s", ANSI_RESET); \ | ||
} while(false) | ||
|
||
#ifdef DEBUG_LOG | ||
|
||
# define log_msg(...) log_printf(__VA_ARGS__) | ||
# define log_int(n) (log_printf("%s == %d\n", (#n), (n))) | ||
# define log_str(s) (log_printf("%s == %s\n", (#s), (s))) | ||
# define log_char(c) (log_printf("%s == '%c'\n", (#c), (c))) | ||
# define log_addr(addr) (log_printf("%s == %p\n", (#addr), (void*)(addr))) | ||
# define log_red(...) __mu_log_color(ANSI_RED, __VA_ARGS__) | ||
# define log_green(...) __mu_log_color(ANSI_GREEN, __VA_ARGS__) | ||
# define log_yellow(...) __mu_log_color(ANSI_YELLOW, __VA_ARGS__) | ||
# define log_blue(...) __mu_log_color(ANSI_BLUE, __VA_ARGS__) | ||
# define log_magenta(...) __mu_log_color(ANSI_MAGENTA, __VA_ARGS__) | ||
# define log_cyan(...) __mu_log_color(ANSI_CYAN, __VA_ARGS__) | ||
|
||
#else | ||
|
||
# define log_msg(...) | ||
# define log_int(n) | ||
# define log_str(s) | ||
# define log_char(c) | ||
# define log_addr(addr) | ||
# define log_red(...) | ||
# define log_green(...) | ||
# define log_yellow(...) | ||
# define log_blue(...) | ||
# define log_magenta(...) | ||
# define log_cyan(...) | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
set(TARGET_NAME W5500) | ||
add_library(${TARGET_NAME}) | ||
|
||
set(LIB_DIR ${CMAKE_SOURCE_DIR}/common/modules/Wiznet) | ||
|
||
# Find all .c sources in project | ||
# Only using Ethernet for now | ||
file(GLOB_RECURSE glob_sources ${LIB_DIR}/W5500/Ethernet/*.c) | ||
target_sources(${TARGET_NAME} PRIVATE ${glob_sources}) | ||
|
||
# Find directories for '#include' | ||
# Only using Ethernet for now | ||
RECURSE_DIRECTORIES(${LIB_DIR} "W5500/Ethernet/*.h" include_dirs) | ||
message("${include_dirs}") | ||
|
||
target_include_directories(${TARGET_NAME} PUBLIC ${include_dirs}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$_TARGETNAME configure -event gdb-detach { | ||
resume | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.