-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
94 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
text data bss dec hex filename | ||
191909 66512 504429 762850 ba3e2 build/template.elf | ||
192025 66512 504357 762894 ba40e build/template.elf |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
build | ||
.cache | ||
llvm | ||
.cscope* |
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,28 @@ | ||
## Directory Structure | ||
|
||
``` | ||
. | ||
├── docs | ||
├── external | ||
│ └── libmcu | ||
├── include | ||
├── ports | ||
│ └── esp-idf | ||
├── src | ||
└── tests | ||
├── fakes | ||
├── mocks | ||
├── runners | ||
├── src | ||
└── stubs | ||
``` | ||
|
||
| Directory | Desc. | | ||
| --------- | ------------------------------------------------------------------- | | ||
| docs | Documentation | | ||
| external | Third-party libraries or SDK. e.g. ESP-IDF | | ||
| include | The project header files | | ||
| ports | Wrappers or glue code to bring third-party drivers into the project | | ||
| src | Application code. No hardware or platform-specific code | | ||
| tests | Test codes | | ||
|
Submodule libmcu
updated
33 files
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,22 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Kyunghwan Kwon <k@libmcu.org> | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#ifndef LOGGER_H | ||
#define LOGGER_H | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include "libmcu/logging.h" | ||
|
||
void logger_init(void); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif /* LOGGER_H */ |
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Kyunghwan Kwon <k@libmcu.org> | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#include "logger.h" | ||
#include <stdio.h> | ||
#include "libmcu/board.h" | ||
|
||
static size_t logger_writer(const void *data, size_t size) | ||
{ | ||
unused(size); | ||
static char buf[LOGGING_MESSAGE_MAXLEN]; | ||
size_t len = logging_stringify(buf, sizeof(buf)-2, data); | ||
|
||
buf[len++] = '\n'; | ||
buf[len] = '\0'; | ||
|
||
const size_t rc = fwrite(buf, len, 1, stdout); | ||
|
||
return rc == 0? len : 0; | ||
} | ||
|
||
static void initialize_backend_stdout(void) | ||
{ | ||
static struct logging_backend log_console = { | ||
.write = logger_writer, | ||
}; | ||
|
||
logging_add_backend(&log_console); | ||
} | ||
|
||
void logger_init(void) | ||
{ | ||
logging_init(board_get_time_since_boot_ms); | ||
initialize_backend_stdout(); | ||
} |
This file was deleted.
Oops, something went wrong.
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