[realtek-ambz2] Make compiling base core possible
This commit is contained in:
@@ -40,6 +40,8 @@ typedef enum {
|
||||
RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC), // CHIPID_8711BG / QFN68
|
||||
MX1290 = RTL8710BN,
|
||||
MX1290V2 = RTL8710BX,
|
||||
// Realtek AmebaZ2
|
||||
RTL8720CF = CPU_MODEL(F_RTL8720C, 0x00), // TODO
|
||||
// Beken 72XX
|
||||
BK7231T = CPU_MODEL(F_BK7231U, 0x1A), // *SCTRL_CHIP_ID = 0x7231a
|
||||
BK7231N = CPU_MODEL(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c
|
||||
|
||||
@@ -20,6 +20,7 @@ extern "C" {
|
||||
#include <rtl8710b.h>
|
||||
#endif
|
||||
#if LT_RTL8720C
|
||||
#include <hal.h>
|
||||
#include <rtl8710c.h>
|
||||
#endif
|
||||
|
||||
|
||||
3
cores/realtek-ambz2/base/fixups/cmd_shell.c
Normal file
3
cores/realtek-ambz2/base/fixups/cmd_shell.c
Normal file
@@ -0,0 +1,3 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2023-04-12. */
|
||||
|
||||
void shell_cmd_init() {}
|
||||
38
cores/realtek-ambz2/base/port/printf.c
Normal file
38
cores/realtek-ambz2/base/port/printf.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2023-04-12. */
|
||||
|
||||
#include <libretiny.h>
|
||||
#include <sdk_private.h>
|
||||
|
||||
#include <printf/printf.h>
|
||||
|
||||
static UART0_Type *uart_dev[4] = {
|
||||
UART0,
|
||||
UART1,
|
||||
UART2,
|
||||
UART3,
|
||||
};
|
||||
|
||||
uint8_t lt_uart_port = 2;
|
||||
|
||||
void putchar_(char c) {
|
||||
putchar_p(c, lt_uart_port);
|
||||
}
|
||||
|
||||
void putchar_p(char c, unsigned long port) {
|
||||
// while (UART_Writable(uart_dev[port]) == 0) {}
|
||||
uart_dev[port]->thr = c;
|
||||
}
|
||||
|
||||
WRAP_PRINTF(rtl_printf);
|
||||
WRAP_SPRINTF(rtl_sprintf);
|
||||
WRAP_SNPRINTF(rtl_snprintf);
|
||||
WRAP_VSNPRINTF(rtl_vsnprintf);
|
||||
WRAP_VSNPRINTF(rtl_vsnprintf_r);
|
||||
WRAP_VPRINTF(rtl_vprintf);
|
||||
WRAP_PRINTF(DiagPrintf);
|
||||
WRAP_SPRINTF(DiagSPrintf);
|
||||
WRAP_SNPRINTF(DiagSnPrintf);
|
||||
WRAP_PRINTF(prvDiagPrintf);
|
||||
WRAP_SPRINTF(prvDiagSPrintf);
|
||||
WRAP_VSPRINTF(VSprintf);
|
||||
WRAP_PRINTF(LOG_PRINTF);
|
||||
18
cores/realtek-ambz2/base/port/printf_port.h
Normal file
18
cores/realtek-ambz2/base/port/printf_port.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <printf_config.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
WRAP_DISABLE_DEF(rtl_printf);
|
||||
WRAP_DISABLE_DEF(DiagPrintf);
|
||||
WRAP_DISABLE_DEF(prvDiagPrintf);
|
||||
WRAP_DISABLE_DEF(LOG_PRINTF);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
Reference in New Issue
Block a user