diff --git a/bsp/tms320f28379d/.config b/bsp/tms320f28379d/.config
index 4d68f71848..2ef26e73e3 100644
--- a/bsp/tms320f28379d/.config
+++ b/bsp/tms320f28379d/.config
@@ -8,17 +8,19 @@ CONFIG_SOC_TMS320F28X=y
# RT-Thread Kernel
#
CONFIG_RT_NAME_MAX=8
+CONFIG_RT_USING_ARCH_DATA_TYPE=y
+# CONFIG_RT_USING_SMP is not set
CONFIG_RT_ALIGN_SIZE=4
CONFIG_RT_THREAD_PRIORITY_8=y
# CONFIG_RT_THREAD_PRIORITY_32 is not set
# CONFIG_RT_THREAD_PRIORITY_256 is not set
CONFIG_RT_THREAD_PRIORITY_MAX=8
CONFIG_RT_TICK_PER_SECOND=100
-CONFIG_RT_USING_OVERFLOW_CHECK=y
+# CONFIG_RT_USING_OVERFLOW_CHECK is not set
CONFIG_RT_USING_HOOK=y
CONFIG_RT_USING_IDLE_HOOK=y
CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
-CONFIG_IDLE_THREAD_STACK_SIZE=256
+CONFIG_IDLE_THREAD_STACK_SIZE=1024
# CONFIG_RT_USING_TIMER_SOFT is not set
CONFIG_RT_DEBUG=y
CONFIG_RT_DEBUG_COLOR=y
@@ -62,7 +64,8 @@ CONFIG_RT_USING_DEVICE=y
# CONFIG_RT_USING_INTERRUPT_INFO is not set
CONFIG_RT_USING_CONSOLE=y
CONFIG_RT_CONSOLEBUF_SIZE=128
-CONFIG_RT_CONSOLE_DEVICE_NAME="uart"
+CONFIG_RT_CONSOLE_DEVICE_NAME="scia"
+CONFIG_RT_VER_NUM=0x40001
CONFIG_ARCH_TIDSP=y
CONFIG_ARCH_TIDSP_C28X=y
CONFIG_ARCH_CPU_STACK_GROWS_UPWARD=y
@@ -106,11 +109,13 @@ CONFIG_RT_USING_DEVICE_IPC=y
CONFIG_RT_PIPE_BUFSZ=512
CONFIG_RT_USING_SERIAL=y
CONFIG_RT_SERIAL_USING_DMA=y
+CONFIG_RT_SERIAL_RB_BUFSZ=64
# CONFIG_RT_USING_CAN is not set
# CONFIG_RT_USING_HWTIMER is not set
# CONFIG_RT_USING_CPUTIME is not set
# CONFIG_RT_USING_I2C is not set
CONFIG_RT_USING_PIN=y
+# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
@@ -121,6 +126,7 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_AUDIO is not set
+# CONFIG_RT_USING_SENSOR is not set
#
# Using WiFi
@@ -174,6 +180,7 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_LOGTRACE is not set
# CONFIG_RT_USING_RYM is not set
# CONFIG_RT_USING_ULOG is not set
+# CONFIG_RT_USING_UTEST is not set
#
# RT-Thread online packages
@@ -184,10 +191,12 @@ CONFIG_RT_USING_PIN=y
#
# CONFIG_PKG_USING_PAHOMQTT is not set
# CONFIG_PKG_USING_WEBCLIENT is not set
+# CONFIG_PKG_USING_WEBNET is not set
# CONFIG_PKG_USING_MONGOOSE is not set
# CONFIG_PKG_USING_WEBTERMINAL is not set
# CONFIG_PKG_USING_CJSON is not set
# CONFIG_PKG_USING_JSMN is not set
+# CONFIG_PKG_USING_LIBMODBUS is not set
# CONFIG_PKG_USING_LJSON is not set
# CONFIG_PKG_USING_EZXML is not set
# CONFIG_PKG_USING_NANOPB is not set
@@ -205,6 +214,7 @@ CONFIG_RT_USING_PIN=y
# Wiced WiFi
#
# CONFIG_PKG_USING_WLAN_WICED is not set
+# CONFIG_PKG_USING_RW007 is not set
# CONFIG_PKG_USING_COAP is not set
# CONFIG_PKG_USING_NOPOLL is not set
# CONFIG_PKG_USING_NETUTILS is not set
@@ -218,6 +228,9 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_GAGENT_CLOUD is not set
# CONFIG_PKG_USING_ALI_IOTKIT is not set
# CONFIG_PKG_USING_AZURE is not set
+# CONFIG_PKG_USING_TENCENT_IOTKIT is not set
+# CONFIG_PKG_USING_NIMBLE is not set
+# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
#
# security packages
@@ -238,6 +251,7 @@ CONFIG_RT_USING_PIN=y
#
# CONFIG_PKG_USING_OPENMV is not set
# CONFIG_PKG_USING_MUPDF is not set
+# CONFIG_PKG_USING_STEMWIN is not set
#
# tools packages
@@ -247,6 +261,9 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_EASYLOGGER is not set
# CONFIG_PKG_USING_SYSTEMVIEW is not set
# CONFIG_PKG_USING_RDB is not set
+# CONFIG_PKG_USING_QRCODE is not set
+# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
+# CONFIG_PKG_USING_ADBD is not set
#
# system packages
@@ -262,10 +279,12 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
# CONFIG_PKG_USING_CMSIS is not set
# CONFIG_PKG_USING_DFS_YAFFS is not set
+# CONFIG_PKG_USING_LITTLEFS is not set
#
# peripheral libraries and drivers
#
+# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X is not set
# CONFIG_PKG_USING_AHT10 is not set
@@ -273,6 +292,12 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set
+# CONFIG_PKG_USING_BUTTON is not set
+# CONFIG_PKG_USING_MPU6XXX is not set
+# CONFIG_PKG_USING_PCF8574 is not set
+# CONFIG_PKG_USING_SX12XX is not set
+# CONFIG_PKG_USING_SIGNAL_LED is not set
+# CONFIG_PKG_USING_KENDRYTE_SDK is not set
#
# miscellaneous packages
@@ -286,10 +311,8 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_CANFESTIVAL is not set
# CONFIG_PKG_USING_ZLIB is not set
# CONFIG_PKG_USING_DSTR is not set
-
-#
-# sample package
-#
+# CONFIG_PKG_USING_TINYFRAME is not set
+# CONFIG_PKG_USING_KENDRYTE_DEMO is not set
#
# samples: kernel and components samples
@@ -298,8 +321,6 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
-
-#
-# example package: hello
-#
# CONFIG_PKG_USING_HELLO is not set
+# CONFIG_PKG_USING_VI is not set
+# CONFIG_PKG_USING_NNOM is not set
diff --git a/bsp/tms320f28379d/.cproject b/bsp/tms320f28379d/.cproject
index d2f74c22d6..a4aacf5b46 100644
--- a/bsp/tms320f28379d/.cproject
+++ b/bsp/tms320f28379d/.cproject
@@ -38,6 +38,7 @@
+
@@ -51,8 +52,9 @@
-
+
+
@@ -60,7 +62,7 @@
-
+
diff --git a/bsp/tms320f28379d/.project b/bsp/tms320f28379d/.project
index bab120e2b9..52f4b72a6c 100644
--- a/bsp/tms320f28379d/.project
+++ b/bsp/tms320f28379d/.project
@@ -25,6 +25,11 @@
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+ DeviceDrivers
+ 2
+ virtual:/virtual
+
Kernel
2
@@ -35,5 +40,15 @@
2
PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c28x
+
+ DeviceDrivers/serial.c
+ 1
+ PARENT-2-PROJECT_LOC/components/drivers/serial/serial.c
+
+
+ DeviceDrivers/src
+ 2
+ PARENT-2-PROJECT_LOC/components/drivers/src
+
diff --git a/bsp/tms320f28379d/.settings/org.eclipse.core.resources.prefs b/bsp/tms320f28379d/.settings/org.eclipse.core.resources.prefs
index 288ca292c6..7fca5cb12c 100644
--- a/bsp/tms320f28379d/.settings/org.eclipse.core.resources.prefs
+++ b/bsp/tms320f28379d/.settings/org.eclipse.core.resources.prefs
@@ -1,4 +1,8 @@
eclipse.preferences.version=1
+encoding//Debug/DeviceDrivers/src/subdir_rules.mk=UTF-8
+encoding//Debug/DeviceDrivers/src/subdir_vars.mk=UTF-8
+encoding//Debug/DeviceDrivers/subdir_rules.mk=UTF-8
+encoding//Debug/DeviceDrivers/subdir_vars.mk=UTF-8
encoding//Debug/Kernel/subdir_rules.mk=UTF-8
encoding//Debug/Kernel/subdir_vars.mk=UTF-8
encoding//Debug/applications/subdir_rules.mk=UTF-8
diff --git a/bsp/tms320f28379d/README.md b/bsp/tms320f28379d/README.md
index b1d60dfd6f..507fdbc0f9 100644
--- a/bsp/tms320f28379d/README.md
+++ b/bsp/tms320f28379d/README.md
@@ -23,7 +23,13 @@ TMS320F28379D 是一款功能强大的 32 位浮点微控制器单元 (MCU),
## 3. 烧写及执行
-连接开发板电源后,使用 CCS 中的烧写功能可直接通过板载 XDS100v2 仿真器烧写并执行。
+连接开发板电源后,使用 CCS 中的烧写功能可直接通过板载 XDS100v2 仿真器烧写并执行。在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
+```bash
+ \ | /
+- RT - Thread Operating System
+ / | \ 4.0.1 build Feb 21 2019
+ 2006 - 2019 Copyright by rt-thread team
+ ```
## 4. 驱动支持情况及计划
@@ -31,10 +37,10 @@ TMS320F28379D 是一款功能强大的 32 位浮点微控制器单元 (MCU),
| ------ | ---- | :------: |
| CPU Timer | 支持 | |
| GPIO | 支持 | |
-| SCI | 开发中 | SCIA/B,预计2018年9月底实现 |
-| ePWM | | 预计2019年10月支持 |
-| ADC | | 预计2019年10月支持 |
-| DAC | | 预计2019/Q4支持|
+| SCI | 支持 | SCIA |
+| ePWM | | 预计2019年3月支持 |
+| ADC | | 预计2019/Q2支持 |
+| DAC | | |
| I2C | | |
| SPI | | |
| CAN | | |
diff --git a/bsp/tms320f28379d/applications/startup.c b/bsp/tms320f28379d/applications/startup.c
index 301e63a00a..523a45b3b7 100644
--- a/bsp/tms320f28379d/applications/startup.c
+++ b/bsp/tms320f28379d/applications/startup.c
@@ -47,6 +47,8 @@ void rtthread_startup(void)
/* init board */
rt_hw_board_init();
+ rt_hw_interrupt_disable();
+
/* show version */
rt_show_version();
diff --git a/bsp/tms320f28379d/drivers/board.c b/bsp/tms320f28379d/drivers/board.c
index 7960d80d1b..432b5df259 100644
--- a/bsp/tms320f28379d/drivers/board.c
+++ b/bsp/tms320f28379d/drivers/board.c
@@ -10,16 +10,16 @@
*/
#include
#include "board.h"
+#include "drv_sci.h"
#include "F28x_Project.h"
extern interrupt void RTOSINT_Handler();
-
/**
* This is the timer interrupt service routine.
*
*/
-interrupt void cpu_timer2_isr (void)
+interrupt void cpu_timer2_isr(void)
{
CpuTimer2Regs.TCR.all = 0x8000;
/* enter interrupt */
@@ -30,7 +30,6 @@ interrupt void cpu_timer2_isr (void)
rt_interrupt_leave();
}
-
/**
* This function will initial STM32 board.
*/
@@ -60,6 +59,9 @@ void rt_hw_board_init()
#ifdef RT_USING_HEAP
rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
#endif
+
+ rt_hw_sci_init();
+
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init();
#endif
diff --git a/bsp/tms320f28379d/drivers/board.h b/bsp/tms320f28379d/drivers/board.h
index 2a221a73f9..9f2a057850 100644
--- a/bsp/tms320f28379d/drivers/board.h
+++ b/bsp/tms320f28379d/drivers/board.h
@@ -11,13 +11,15 @@
#ifndef __BOARD_H__
#define __BOARD_H__
+
#include
#define C28X_SRAM_END 0x00020000
-
#define HEAP_BEGIN 0x0000E000
#define HEAP_END C28X_SRAM_END
+
extern void rt_hw_board_init(void);
+
#endif
diff --git a/bsp/tms320f28379d/drivers/drv_sci.c b/bsp/tms320f28379d/drivers/drv_sci.c
new file mode 100644
index 0000000000..ae0390d1bf
--- /dev/null
+++ b/bsp/tms320f28379d/drivers/drv_sci.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2006-2018, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2019-02-02 xuzhuoyi first version
+ */
+
+#include "rtdevice.h"
+#include "board.h"
+#include "drv_sci.h"
+#include "F2837xD_device.h"
+#include "F2837xD_sci.h"
+
+typedef long off_t;
+#include "F2837xD_sci_io.h"
+
+#ifdef RT_USING_SERIAL
+
+#define LOG_TAG "drv.sci"
+
+/* c28x uart driver class */
+struct c28x_uart
+{
+ const char *name;
+ volatile struct SCI_REGS *sci_regs;
+ struct rt_serial_device serial;
+};
+
+static struct c28x_uart uart_obj[3] = {0};
+
+static rt_err_t c28x_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
+{
+ struct c28x_uart *uart;
+ RT_ASSERT(serial != RT_NULL);
+ RT_ASSERT(cfg != RT_NULL);
+ uart = (struct c28x_uart *)serial->parent.user_data;
+ RT_ASSERT(uart != RT_NULL);
+
+ EALLOW;
+
+ // default config
+
+ // 1 stop bit, No loopback
+ // No parity,8 char bits,
+ // async mode, idle-line protocol
+ uart->sci_regs->SCICCR.all = 0x0007;
+
+ // enable TX, RX, internal SCICLK,
+ // Disable RX ERR, SLEEP, TXWAKE
+ uart->sci_regs->SCICTL1.all = 0x0003;
+
+ uart->sci_regs->SCICTL2.bit.TXINTENA = 1;
+ uart->sci_regs->SCICTL2.bit.RXBKINTENA = 1;
+
+ uart->sci_regs->SCIHBAUD.all = 0x0000; // 115200 baud @LSPCLK = 22.5MHz (90 MHz SYSCLK).
+ uart->sci_regs->SCILBAUD.all = 53;
+
+ uart->sci_regs->SCICTL1.all = 0x0023; // Relinquish SCI from Reset
+
+ switch (cfg->data_bits)
+ {
+ case DATA_BITS_5:
+ uart->sci_regs->SCICCR.bit.SCICHAR = 4;
+ break;
+ case DATA_BITS_6:
+ uart->sci_regs->SCICCR.bit.SCICHAR = 5;
+ break;
+ case DATA_BITS_7:
+ uart->sci_regs->SCICCR.bit.SCICHAR = 6;
+ break;
+ case DATA_BITS_8:
+ uart->sci_regs->SCICCR.bit.SCICHAR = 7;
+ break;
+ default:
+ uart->sci_regs->SCICCR.bit.SCICHAR = 7;
+ break;
+ }
+ switch (cfg->stop_bits)
+ {
+ case STOP_BITS_1:
+ uart->sci_regs->SCICCR.bit.STOPBITS = 0;
+ break;
+ case STOP_BITS_2:
+ uart->sci_regs->SCICCR.bit.STOPBITS = 1;
+ break;
+ default:
+ uart->sci_regs->SCICCR.bit.STOPBITS = 0;
+ break;
+ }
+ switch (cfg->parity)
+ {
+ case PARITY_NONE:
+ uart->sci_regs->SCICCR.bit.PARITYENA = 0;
+ break;
+ case PARITY_ODD:
+ uart->sci_regs->SCICCR.bit.PARITYENA = 1;
+ uart->sci_regs->SCICCR.bit.PARITY = 0;
+ break;
+ case PARITY_EVEN:
+ uart->sci_regs->SCICCR.bit.PARITYENA = 1;
+ uart->sci_regs->SCICCR.bit.PARITY = 1;
+ break;
+ default:
+ uart->sci_regs->SCICCR.bit.PARITYENA = 0;
+ break;
+ }
+
+ EDIS;
+
+ return RT_EOK;
+}
+
+static rt_err_t c28x_control(struct rt_serial_device *serial, int cmd, void *arg)
+{
+ struct c28x_uart *uart;
+ uart = (struct c28x_uart *)serial->parent.user_data;
+
+ EALLOW;
+
+ switch (cmd)
+ {
+ /* disable interrupt */
+ case RT_DEVICE_CTRL_CLR_INT:
+ /* disable interrupt */
+ uart->sci_regs->SCICTL2.bit.TXINTENA = 0;
+ uart->sci_regs->SCICTL2.bit.RXBKINTENA = 0;
+ break;
+ /* enable interrupt */
+ case RT_DEVICE_CTRL_SET_INT:
+ /* enable interrupt */
+ uart->sci_regs->SCICTL2.bit.TXINTENA = 1;
+ uart->sci_regs->SCICTL2.bit.RXBKINTENA = 1;
+ break;
+ }
+ return RT_EOK;
+}
+
+static int c28x_putc(struct rt_serial_device *serial, char c)
+{
+ SCI_write(0, &c, 1);
+ return 1;
+}
+
+static int c28x_getc(struct rt_serial_device *serial)
+{
+ char ch;
+ SCI_read(0, &ch, 1);
+ return ch;
+}
+
+static const struct rt_uart_ops c28x_uart_ops =
+{
+ .configure = c28x_configure,
+ .control = c28x_control,
+ .putc = c28x_putc,
+ .getc = c28x_getc,
+};
+
+int rt_hw_sci_init(void)
+{
+ EALLOW;
+
+ GpioCtrlRegs.GPBMUX1.bit.GPIO42 = 3;
+ GpioCtrlRegs.GPBMUX1.bit.GPIO43 = 3;
+ GpioCtrlRegs.GPBGMUX1.bit.GPIO42 = 3;
+ GpioCtrlRegs.GPBGMUX1.bit.GPIO43 = 3;
+
+ GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 2;
+ GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 2;
+ GpioCtrlRegs.GPAGMUX2.bit.GPIO18 = 0;
+ GpioCtrlRegs.GPAGMUX2.bit.GPIO19 = 0;
+
+ GpioCtrlRegs.GPBMUX2.bit.GPIO56 = 2;
+ GpioCtrlRegs.GPEMUX1.bit.GPIO139 = 2;
+ GpioCtrlRegs.GPBGMUX2.bit.GPIO56 = 1;
+ GpioCtrlRegs.GPEGMUX1.bit.GPIO139 = 1;
+
+ CpuSysRegs.PCLKCR7.bit.SCI_A = 1;
+ CpuSysRegs.PCLKCR7.bit.SCI_B = 1;
+ CpuSysRegs.PCLKCR7.bit.SCI_C = 1;
+
+ EDIS;
+
+ struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
+ rt_err_t result = 0;
+
+ uart_obj[0].serial.ops = &c28x_uart_ops;
+ uart_obj[0].serial.config = config;
+ uart_obj[0].name = "scia";
+ uart_obj[0].sci_regs = &SciaRegs;
+
+ uart_obj[1].serial.ops = &c28x_uart_ops;
+ uart_obj[1].serial.config = config;
+ uart_obj[1].name = "scib";
+ uart_obj[1].sci_regs = &ScibRegs;
+
+ uart_obj[2].serial.ops = &c28x_uart_ops;
+ uart_obj[2].serial.config = config;
+ uart_obj[2].name = "scic";
+ uart_obj[2].sci_regs = &ScicRegs;
+
+
+ /* register UART device */
+ result = rt_hw_serial_register(&uart_obj[0].serial, uart_obj[0].name,
+ RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
+ &uart_obj[0]);
+
+ /* register UART device */
+ result = rt_hw_serial_register(&uart_obj[1].serial, uart_obj[1].name,
+ RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
+ &uart_obj[1]);
+
+ /* register UART device */
+ result = rt_hw_serial_register(&uart_obj[2].serial, uart_obj[2].name,
+ RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
+ &uart_obj[2]);
+
+ return result;
+}
+
+#endif /* RT_USING_SERIAL */
diff --git a/bsp/tms320f28379d/drivers/drv_sci.h b/bsp/tms320f28379d/drivers/drv_sci.h
new file mode 100644
index 0000000000..60fb12bd9b
--- /dev/null
+++ b/bsp/tms320f28379d/drivers/drv_sci.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2006-2018, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2019-02-02 xuzhuoyi first version
+ */
+
+#ifndef __DRV_SCI_H__
+#define __DRV_SCI_H__
+
+int rt_hw_sci_init(void);
+
+#endif /* __DRV_SCI_H__ */
diff --git a/bsp/tms320f28379d/libraries/common/include/stdint.h b/bsp/tms320f28379d/libraries/common/include/stdint.h
new file mode 100644
index 0000000000..824f5e607d
--- /dev/null
+++ b/bsp/tms320f28379d/libraries/common/include/stdint.h
@@ -0,0 +1,523 @@
+/*****************************************************************************/
+/* STDINT.H */
+/* */
+/* Copyright (c) 2002 Texas Instruments Incorporated */
+/* http://www.ti.com/ */
+/* */
+/* Redistribution and use in source and binary forms, with or without */
+/* modification, are permitted provided that the following conditions */
+/* are met: */
+/* */
+/* Redistributions of source code must retain the above copyright */
+/* notice, this list of conditions and the following disclaimer. */
+/* */
+/* Redistributions in binary form must reproduce the above copyright */
+/* notice, this list of conditions and the following disclaimer in */
+/* the documentation and/or other materials provided with the */
+/* distribution. */
+/* */
+/* Neither the name of Texas Instruments Incorporated nor the names */
+/* of its contributors may be used to endorse or promote products */
+/* derived from this software without specific prior written */
+/* permission. */
+/* */
+/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
+/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
+/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
+/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
+/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
+/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
+/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
+/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
+/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
+/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
+/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+/* */
+/*****************************************************************************/
+#ifndef _STDINT_H_
+#define _STDINT_H_
+
+#if __has_include()
+#include
+#else
+/* 7.18.1.1 Exact-width integer types */
+
+#if defined(__MSP430__) || defined(__TMS320C55X_PLUS_BYTE__)
+ typedef signed char int8_t;
+ typedef unsigned char uint8_t;
+ typedef int int16_t;
+ typedef unsigned int uint16_t;
+ typedef long int32_t;
+ typedef unsigned long uint32_t;
+#elif defined(_TMS320C5XX) || defined(__TMS320C55X__)
+ typedef int int16_t;
+ typedef unsigned int uint16_t;
+ typedef long int32_t;
+ typedef unsigned long uint32_t;
+#elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__ARP32__) || \
+ defined(__PRU__) || defined(__FROZEN__)
+ typedef signed char int8_t;
+ typedef unsigned char uint8_t;
+ typedef short int16_t;
+ typedef unsigned short uint16_t;
+ typedef int int32_t;
+ typedef unsigned int uint32_t;
+#elif defined (__TMS320C2000__)
+#if defined(__TMS320C28XX_CLA__)
+ typedef short int16_t;
+ typedef unsigned short uint16_t;
+ typedef int int32_t;
+ typedef unsigned int uint32_t;
+#else
+ typedef int int16_t;
+ typedef unsigned int uint16_t;
+ typedef long int32_t;
+ typedef unsigned long uint32_t;
+#endif
+#endif
+
+#if defined(__TMS320C55X__)
+ typedef long long int40_t;
+ typedef unsigned long long uint40_t;
+#elif defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)
+ typedef __int40_t int40_t;
+ typedef unsigned __int40_t uint40_t;
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__ARP32__) || \
+ defined(__MSP430__) || defined(__PRU__) || defined(__FROZEN__)
+ typedef long long int64_t;
+ typedef unsigned long long uint64_t;
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ typedef long long int64_t;
+ typedef unsigned long long uint64_t;
+#endif
+#endif
+
+/* 7.18.1.2 Minimum-width integer types */
+
+#if defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \
+ defined(__TMS320C55X_PLUS_BYTE__) || defined(__ARP32__) || \
+ defined(__PRU__) || defined(__FROZEN__)
+ typedef int8_t int_least8_t;
+ typedef uint8_t uint_least8_t;
+#elif defined(__TMS320C2000__) || defined(_TMS320C5XX) || defined(__TMS320C55X__)
+ typedef int16_t int_least8_t;
+ typedef uint16_t uint_least8_t;
+#endif
+
+ typedef int16_t int_least16_t;
+ typedef uint16_t uint_least16_t;
+ typedef int32_t int_least32_t;
+ typedef uint32_t uint_least32_t;
+
+#if defined(__TMS320C55X__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__))
+ typedef int40_t int_least40_t;
+ typedef uint40_t uint_least40_t;
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
+ typedef int64_t int_least64_t;
+ typedef uint64_t uint_least64_t;
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ typedef int64_t int_least64_t;
+ typedef uint64_t uint_least64_t;
+#else
+/* sorry, [u]int_least64_t not implemented for C27X, CLA */
+#endif
+#elif defined(_TMS320C5XX) || defined(__TMS320C55X__)
+/* sorry, [u]int_least64_t not implemented for C54x, C55x */
+#endif
+
+/* 7.18.1.3 Fastest minimum-width integer types */
+
+#if defined(_TMS320C5XX) || defined(__TMS320C55X__) || defined(__MSP430__)
+ typedef int16_t int_fast8_t;
+ typedef uint16_t uint_fast8_t;
+ typedef int16_t int_fast16_t;
+ typedef uint16_t uint_fast16_t;
+#elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__ARP32__) || \
+ defined(__PRU__) || defined(__FROZEN__)
+ typedef int32_t int_fast8_t;
+ typedef uint32_t uint_fast8_t;
+ typedef int32_t int_fast16_t;
+ typedef uint32_t uint_fast16_t;
+#elif defined (__TMS320C2000__)
+#if defined(__TMS320C28XX_CLA__)
+ typedef int32_t int_fast8_t;
+ typedef uint32_t uint_fast8_t;
+ typedef int32_t int_fast16_t;
+ typedef uint32_t uint_fast16_t;
+#else
+ typedef int16_t int_fast8_t;
+ typedef uint16_t uint_fast8_t;
+ typedef int16_t int_fast16_t;
+ typedef uint16_t uint_fast16_t;
+#endif
+#endif
+
+ typedef int32_t int_fast32_t;
+ typedef uint32_t uint_fast32_t;
+
+#if defined(__TMS320C55X__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__))
+ typedef int40_t int_fast40_t;
+ typedef uint40_t uint_fast40_t;
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
+ typedef int64_t int_fast64_t;
+ typedef uint64_t uint_fast64_t;
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ typedef int64_t int_fast64_t;
+ typedef uint64_t uint_fast64_t;
+#else
+/* sorry, [u]int_fast64_t not implemented for C27X, CLA */
+#endif
+#elif defined(_TMS320C5XX) || defined(__TMS320C55X__)
+/* sorry, [u]int_fast64_t not implemented for C54x, C55x */
+#endif
+
+typedef uint_fast8_t uint8_t;
+typedef int_fast8_t int8_t;
+
+/* 7.18.1.4 Integer types capable of holding object pointers */
+#if defined(_TMS320C5XX) || defined(__TMS320C55X__) || \
+ (defined(__MSP430__) && defined(__LARGE_CODE_MODEL__)) || \
+ defined(__FROZEN__)
+ typedef long intptr_t;
+ typedef unsigned long uintptr_t;
+#elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \
+ defined(__ARP32__) || defined(__PRU__)
+ typedef int intptr_t;
+ typedef unsigned int uintptr_t;
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28XX_CLA__)
+ typedef short intptr_t;
+ typedef unsigned short uintptr_t;
+#else
+ typedef long intptr_t;
+ typedef unsigned long uintptr_t;
+#endif
+#endif
+
+/* 7.18.1.5 Greatest-width integer types */
+#if defined(__TMS320C55X__) || defined(__ARM_ARCH) || defined(_TMS320C6X) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) || \
+ defined(__FROZEN__)
+ typedef long long intmax_t;
+ typedef unsigned long long uintmax_t;
+#elif defined(_TMS320C5XX)
+ typedef long intmax_t;
+ typedef unsigned long uintmax_t;
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ typedef long long intmax_t;
+ typedef unsigned long long uintmax_t;
+#else /* C27X or CLA */
+ typedef long intmax_t;
+ typedef unsigned long uintmax_t;
+#endif
+#endif
+
+/*
+ According to footnotes in the 1999 C standard, "C++ implementations
+ should define these macros only when __STDC_LIMIT_MACROS is defined
+ before is included."
+*/
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+
+/* 7.18.2 Limits of specified width integer types */
+
+#if defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \
+ defined(__TMS320C55X_PLUS_BYTE__) || defined(__ARP32__) || \
+ defined(__PRU__) || defined(__FROZEN__)
+ #define INT8_MAX 0x7f
+ #define INT8_MIN (-INT8_MAX-1)
+ #define UINT8_MAX 0xff
+#endif
+
+ #define INT16_MAX 0x7fff
+ #define INT16_MIN (-INT16_MAX-1)
+ #define UINT16_MAX 0xffff
+
+ #define INT32_MAX 0x7fffffff
+ #define INT32_MIN (-INT32_MAX-1)
+ #define UINT32_MAX 0xffffffff
+
+#if defined(__TMS320C55X__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__))
+ #define INT40_MAX 0x7fffffffff
+ #define INT40_MIN (-INT40_MAX-1)
+ #define UINT40_MAX 0xffffffffff
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
+ #define INT64_MAX 0x7fffffffffffffff
+ #define INT64_MIN (-INT64_MAX-1)
+ #define UINT64_MAX 0xffffffffffffffff
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ #define INT64_MAX 0x7fffffffffffffff
+ #define INT64_MIN (-INT64_MAX-1)
+ #define UINT64_MAX 0xffffffffffffffff
+#endif
+#endif
+
+#if defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \
+ defined(__TMS320C55X_PLUS_BYTE__) || defined(__ARP32__) || \
+ defined(__PRU__) || defined(__FROZEN__)
+ #define INT_LEAST8_MAX (INT8_MAX)
+ #define INT_LEAST8_MIN (INT8_MIN)
+ #define UINT_LEAST8_MAX (UINT8_MAX)
+#elif defined(__TMS320C2000__) || defined(_TMS320C5XX) || defined(__TMS320C55X__)
+ #define INT_LEAST8_MAX (INT16_MAX)
+ #define INT_LEAST8_MIN (INT16_MIN)
+ #define UINT_LEAST8_MAX (UINT16_MAX)
+#endif
+
+ #define INT_LEAST16_MAX (INT16_MAX)
+ #define INT_LEAST16_MIN (INT16_MIN)
+ #define UINT_LEAST16_MAX (UINT16_MAX)
+ #define INT_LEAST32_MAX (INT32_MAX)
+ #define INT_LEAST32_MIN (INT32_MIN)
+ #define UINT_LEAST32_MAX (UINT32_MAX)
+
+#if defined(__TMS320C55X__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__))
+ #define INT_LEAST40_MAX (INT40_MAX)
+ #define INT_LEAST40_MIN (INT40_MIN)
+ #define UINT_LEAST40_MAX (UINT40_MAX)
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
+ #define INT_LEAST64_MAX (INT64_MAX)
+ #define INT_LEAST64_MIN (INT64_MIN)
+ #define UINT_LEAST64_MAX (UINT64_MAX)
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ #define INT_LEAST64_MAX (INT64_MAX)
+ #define INT_LEAST64_MIN (INT64_MIN)
+ #define UINT_LEAST64_MAX (UINT64_MAX)
+#endif
+#endif
+
+#if defined(_TMS320C5XX) || defined(__TMS320C55X__)
+ #define INT_FAST8_MAX (INT16_MAX)
+ #define INT_FAST8_MIN (INT16_MIN)
+ #define UINT_FAST8_MAX (UINT16_MAX)
+ #define INT_FAST16_MAX (INT16_MAX)
+ #define INT_FAST16_MIN (INT16_MIN)
+ #define UINT_FAST16_MAX (UINT16_MAX)
+#elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__ARP32__) || \
+ defined(__PRU__) || defined(__FROZEN__)
+ #define INT_FAST8_MAX (INT32_MAX)
+ #define INT_FAST8_MIN (INT32_MIN)
+ #define UINT_FAST8_MAX (UINT32_MAX)
+ #define INT_FAST16_MAX (INT32_MAX)
+ #define INT_FAST16_MIN (INT32_MIN)
+ #define UINT_FAST16_MAX (UINT32_MAX)
+#elif defined(__MSP430__)
+ #define INT_FAST8_MAX (INT16_MAX)
+ #define INT_FAST8_MIN (INT16_MIN)
+ #define UINT_FAST8_MAX (UINT16_MAX)
+ #define INT_FAST16_MAX (INT16_MAX)
+ #define INT_FAST16_MIN (INT16_MIN)
+ #define UINT_FAST16_MAX (UINT16_MAX)
+#elif defined (__TMS320C2000__)
+#if defined(__TMS320C28XX_CLA__)
+ #define INT_FAST8_MAX (INT32_MAX)
+ #define INT_FAST8_MIN (INT32_MIN)
+ #define UINT_FAST8_MAX (UINT32_MAX)
+ #define INT_FAST16_MAX (INT32_MAX)
+ #define INT_FAST16_MIN (INT32_MIN)
+ #define UINT_FAST16_MAX (UINT32_MAX)
+#else
+ #define INT_FAST8_MAX (INT16_MAX)
+ #define INT_FAST8_MIN (INT16_MIN)
+ #define UINT_FAST8_MAX (UINT16_MAX)
+ #define INT_FAST16_MAX (INT16_MAX)
+ #define INT_FAST16_MIN (INT16_MIN)
+ #define UINT_FAST16_MAX (UINT16_MAX)
+#endif
+#endif
+
+ #define INT_FAST32_MAX (INT32_MAX)
+ #define INT_FAST32_MIN (INT32_MIN)
+ #define UINT_FAST32_MAX (UINT32_MAX)
+
+#if defined(__TMS320C55X__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__))
+ #define INT_FAST40_MAX (INT40_MAX)
+ #define INT_FAST40_MIN (INT40_MIN)
+ #define UINT_FAST40_MAX (UINT40_MAX)
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
+ #define INT_FAST64_MAX (INT64_MAX)
+ #define INT_FAST64_MIN (INT64_MIN)
+ #define UINT_FAST64_MAX (UINT64_MAX)
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ #define INT_FAST64_MAX (INT64_MAX)
+ #define INT_FAST64_MIN (INT64_MIN)
+ #define UINT_FAST64_MAX (UINT64_MAX)
+#endif
+#endif
+
+#if defined(__MSP430__) && !defined(__LARGE_CODE_MODEL__)
+ #define INTPTR_MAX (INT16_MAX)
+ #define INTPTR_MIN (INT16_MIN)
+ #define UINTPTR_MAX (UINT16_MAX)
+#elif defined(__FROZEN__)
+ #define INTPTR_MAX (INT64_MAX)
+ #define INTPTR_MIN (INT64_MIN)
+ #define UINTPTR_MAX (UINT64_MAX)
+#else
+ #define INTPTR_MAX (INT32_MAX)
+ #define INTPTR_MIN (INT32_MIN)
+ #define UINTPTR_MAX (UINT32_MAX)
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
+ #define INTMAX_MIN (INT64_MIN)
+ #define INTMAX_MAX (INT64_MAX)
+ #define UINTMAX_MAX (UINT64_MAX)
+#elif defined(__TMS320C55X__)
+ #define INTMAX_MIN (INT40_MIN)
+ #define INTMAX_MAX (INT40_MAX)
+ #define UINTMAX_MAX (UINT40_MAX)
+#elif defined(_TMS320C5XX)
+ #define INTMAX_MIN (INT32_MIN)
+ #define INTMAX_MAX (INT32_MAX)
+ #define UINTMAX_MAX (UINT32_MAX)
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ #define INTMAX_MIN (INT64_MIN)
+ #define INTMAX_MAX (INT64_MAX)
+ #define UINTMAX_MAX (UINT64_MAX)
+#else
+ #define INTMAX_MIN (INT32_MIN)
+ #define INTMAX_MAX (INT32_MAX)
+ #define UINTMAX_MAX (UINT32_MAX)
+#endif
+#endif
+
+/* 7.18.3 Limits of other integer types */
+
+#if defined(_TMS320C5XX) || defined(__TMS320C55X__) || \
+ (defined(__MSP430__) && !defined(__LONG_PTRDIFF_T__))
+ #define PTRDIFF_MAX (INT16_MAX)
+ #define PTRDIFF_MIN (INT16_MIN)
+#elif defined(__TMS320C2000__) || defined(__MSP430__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) || \
+ defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__)
+ #define PTRDIFF_MAX (INT32_MAX)
+ #define PTRDIFF_MIN (INT32_MIN)
+#elif defined(__FROZEN__)
+ #define PTRDIFF_MAX (INT64_MAX)
+ #define PTRDIFF_MIN (INT64_MIN)
+#endif
+
+#if defined(_TMS320C5XX) || defined(__TMS320C55X__) || defined(__MSP430__)
+ #define SIG_ATOMIC_MIN (INT16_MIN)
+ #define SIG_ATOMIC_MAX (INT16_MAX)
+#elif defined(__TMS320C2000__) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__)
+ #define SIG_ATOMIC_MIN (INT32_MIN)
+ #define SIG_ATOMIC_MAX (INT32_MAX)
+#endif
+
+#if defined(_TMS320C5XX) || defined(__TMS320C55X__) || \
+ (defined(__MSP430__) && !defined(__LONG_PTRDIFF_T__))
+ #define SIZE_MAX (UINT16_MAX)
+#elif defined(__TMS320C2000__) || defined(__MSP430__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) || \
+ defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__)
+ #define SIZE_MAX (UINT32_MAX)
+#elif defined(__FROZEN__)
+ #define SIZE_MAX (UINT64_MAX)
+#endif
+
+#ifndef WCHAR_MAX
+#if !defined(__TI_WCHAR_T_BITS__) || __TI_WCHAR_T_BITS__ == 16
+#define WCHAR_MAX 0xffffu
+#else
+#define WCHAR_MAX 0xffffffffu
+#endif
+#endif
+
+#ifndef WCHAR_MIN
+#define WCHAR_MIN 0
+#endif
+
+#if defined(_TMS320C5XX) || defined(__TMS320C55X__) || defined(__MSP430__)
+ #define WINT_MIN (INT16_MIN)
+ #define WINT_MAX (INT16_MAX)
+#elif defined(__TMS320C2000__) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__)
+ #define WINT_MIN (INT32_MIN)
+ #define WINT_MAX (INT32_MAX)
+#endif
+
+/* 7.18.4.1 Macros for minimum-width integer constants */
+
+/*
+ There is a defect report filed against the C99 standard concerning how
+ the (U)INTN_C macros should be implemented. Please refer to --
+ http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_209.htm
+ for more information. These macros are implemented according to the
+ suggestion given at this web site.
+*/
+
+ #define INT8_C(value) ((int_least8_t)(value))
+ #define UINT8_C(value) ((uint_least8_t)(value))
+ #define INT16_C(value) ((int_least16_t)(value))
+ #define UINT16_C(value) ((uint_least16_t)(value))
+ #define INT32_C(value) ((int_least32_t)(value))
+ #define UINT32_C(value) ((uint_least32_t)(value))
+
+#if defined(__TMS320C55X__) || \
+ (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__))
+ #define INT40_C(value) ((int_least40_t)(value))
+ #define UINT40_C(value) ((uint_least40_t)(value))
+#endif
+
+#if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \
+ defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__)
+ #define INT64_C(value) ((int_least64_t)(value))
+ #define UINT64_C(value) ((uint_least64_t)(value))
+#elif defined(__TMS320C2000__)
+#if defined(__TMS320C28X__) || \
+ (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__))
+ #define INT64_C(value) ((int_least64_t)(value))
+ #define UINT64_C(value) ((uint_least64_t)(value))
+#endif
+#endif
+
+/* 7.18.4.2 Macros for greatest-width integer constants */
+
+ #define INTMAX_C(value) ((intmax_t)(value))
+ #define UINTMAX_C(value) ((uintmax_t)(value))
+
+#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
+#endif
+#endif /* _STDINT_H_ */
diff --git a/bsp/tms320f28379d/rtconfig.h b/bsp/tms320f28379d/rtconfig.h
index 139789a5b2..f825d9ef74 100644
--- a/bsp/tms320f28379d/rtconfig.h
+++ b/bsp/tms320f28379d/rtconfig.h
@@ -9,15 +9,15 @@
/* RT-Thread Kernel */
#define RT_NAME_MAX 8
+#define RT_USING_ARCH_DATA_TYPE
#define RT_ALIGN_SIZE 4
#define RT_THREAD_PRIORITY_8
#define RT_THREAD_PRIORITY_MAX 8
#define RT_TICK_PER_SECOND 100
-#define RT_USING_OVERFLOW_CHECK
#define RT_USING_HOOK
#define RT_USING_IDLE_HOOK
#define RT_IDEL_HOOK_LIST_SIZE 4
-#define IDLE_THREAD_STACK_SIZE 256
+#define IDLE_THREAD_STACK_SIZE 1024
#define RT_DEBUG
#define RT_DEBUG_COLOR
@@ -40,7 +40,8 @@
#define RT_USING_DEVICE
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
-#define RT_CONSOLE_DEVICE_NAME "uart"
+#define RT_CONSOLE_DEVICE_NAME "scia"
+#define RT_VER_NUM 0x40001
#define ARCH_TIDSP
#define ARCH_TIDSP_C28X
#define ARCH_CPU_STACK_GROWS_UPWARD
@@ -70,6 +71,7 @@
#define RT_PIPE_BUFSZ 512
#define RT_USING_SERIAL
#define RT_SERIAL_USING_DMA
+#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_PIN
/* Using WiFi */
@@ -138,12 +140,8 @@
/* miscellaneous packages */
-/* sample package */
-
/* samples: kernel and components samples */
-
-/* example package: hello */
-
+#include "rtconfig_project.h"
#endif
diff --git a/bsp/tms320f28379d/rtconfig_project.h b/bsp/tms320f28379d/rtconfig_project.h
new file mode 100644
index 0000000000..df4eb0c1cd
--- /dev/null
+++ b/bsp/tms320f28379d/rtconfig_project.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2006-2019, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2019-03-27 xuzhuoyi the first version
+ */
+
+#ifndef __RTCONFIG_PROJECT_H__
+#define __RTCONFIG_PROJECT_H__
+
+typedef signed char rt_int8_t; /**< 8bit integer type */
+typedef signed short rt_int16_t; /**< 16bit integer type */
+typedef signed long rt_int32_t; /**< 32bit integer type */
+typedef signed long long rt_int64_t; /**< 64bit integer type */
+typedef unsigned char rt_uint8_t; /**< 8bit unsigned integer type */
+typedef unsigned short rt_uint16_t; /**< 16bit unsigned integer type */
+typedef unsigned long rt_uint32_t; /**< 32bit unsigned integer type */
+typedef unsigned long long rt_uint64_t; /**< 64bit unsigned integer type */
+
+#endif