IAR host os none work well with ea4357
This commit is contained in:
parent
dea4583549
commit
c35e668dc4
|
@ -41,11 +41,11 @@
|
||||||
#if CFG_PRINTF_TARGET != PRINTF_TARGET_SEMIHOST
|
#if CFG_PRINTF_TARGET != PRINTF_TARGET_SEMIHOST
|
||||||
|
|
||||||
#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
|
#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
|
||||||
#define retarget_getchar() board_uart_getchar()
|
#define retarget_getchar() board_uart_getchar()
|
||||||
#define retarget_putchar(c) board_uart_putchar(c);
|
#define retarget_putchar(c) board_uart_putchar(c);
|
||||||
#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
|
#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
|
||||||
volatile int32_t ITM_RxBuffer; // keil variable to read from SWO
|
volatile int32_t ITM_RxBuffer; // keil variable to read from SWO
|
||||||
#define retarget_getchar() ITM_ReceiveChar()
|
#define retarget_getchar() ITM_ReceiveChar()
|
||||||
#define retarget_putchar(c) ITM_SendChar(c)
|
#define retarget_putchar(c) ITM_SendChar(c)
|
||||||
#else
|
#else
|
||||||
#error Target is not implemented yet
|
#error Target is not implemented yet
|
||||||
|
@ -68,17 +68,14 @@ int __sys_write (int iFileHandle, char *buf, int length)
|
||||||
{
|
{
|
||||||
(void) iFileHandle;
|
(void) iFileHandle;
|
||||||
|
|
||||||
int ret = length;
|
|
||||||
for (int i=0; i<length; i++)
|
for (int i=0; i<length; i++)
|
||||||
{
|
{
|
||||||
if (buf[i] == '\n')
|
if (buf[i] == '\n') retarget_putchar('\r');
|
||||||
{
|
|
||||||
retarget_putchar('\r');
|
|
||||||
ret++;
|
|
||||||
}
|
|
||||||
retarget_putchar( buf[i] );
|
retarget_putchar( buf[i] );
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called by bottom level of scanf routine within RedLib C library to read
|
// Called by bottom level of scanf routine within RedLib C library to read
|
||||||
|
@ -113,14 +110,14 @@ int fgetc(FILE *f)
|
||||||
|
|
||||||
int fputc(int ch, FILE *f)
|
int fputc(int ch, FILE *f)
|
||||||
{
|
{
|
||||||
_ttywrch(ch)
|
_ttywrch(ch);
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// IAR
|
// IAR
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
#elif 0 // defined __ICCARM__ TODO could not able to retarget to UART with IAR
|
#elif defined __ICCARM__ // TODO could not able to retarget to UART with IAR
|
||||||
|
|
||||||
#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
|
#if CFG_PRINTF_TARGET == PRINTF_TARGET_UART
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -133,18 +130,14 @@ size_t __write(int handle, const unsigned char *buf, size_t length)
|
||||||
/* Check for stdout and stderr (only necessary if FILE descriptors are enabled.) */
|
/* Check for stdout and stderr (only necessary if FILE descriptors are enabled.) */
|
||||||
if (handle != 1 && handle != 2) return -1;
|
if (handle != 1 && handle != 2) return -1;
|
||||||
|
|
||||||
size_t ret = length;
|
|
||||||
for (size_t i=0; i<length; i++)
|
for (size_t i=0; i<length; i++)
|
||||||
{
|
{
|
||||||
if (buf[i] == '\n')
|
if (buf[i] == '\n') retarget_putchar('\r');
|
||||||
{
|
|
||||||
board_uart_putchar('\r');
|
retarget_putchar( buf[i] );
|
||||||
ret++;
|
|
||||||
}
|
|
||||||
board_uart_putchar( buf[i] );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t __read(int handle, unsigned char *buf, size_t bufSize)
|
size_t __read(int handle, unsigned char *buf, size_t bufSize)
|
||||||
|
@ -152,7 +145,7 @@ size_t __read(int handle, unsigned char *buf, size_t bufSize)
|
||||||
/* Check for stdin (only necessary if FILE descriptors are enabled) */
|
/* Check for stdin (only necessary if FILE descriptors are enabled) */
|
||||||
if (handle != 0) return -1;
|
if (handle != 0) return -1;
|
||||||
|
|
||||||
/*size_t i;
|
size_t i;
|
||||||
for (i=0; i<bufSize; i++)
|
for (i=0; i<bufSize; i++)
|
||||||
{
|
{
|
||||||
uint8_t ch = board_uart_getchar();
|
uint8_t ch = board_uart_getchar();
|
||||||
|
@ -160,8 +153,7 @@ size_t __read(int handle, unsigned char *buf, size_t bufSize)
|
||||||
buf[i] = ch;
|
buf[i] = ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
return i; */
|
return i;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGUseCmsis</name>
|
<name>OGUseCmsis</name>
|
||||||
<state>1</state>
|
<state>0</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGUseCmsisDspLib</name>
|
<name>OGUseCmsisDspLib</name>
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
<OPTFL>
|
<OPTFL>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>1</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<IsCurrentTarget>0</IsCurrentTarget>
|
<IsCurrentTarget>1</IsCurrentTarget>
|
||||||
</OPTFL>
|
</OPTFL>
|
||||||
<CpuCode>8</CpuCode>
|
<CpuCode>8</CpuCode>
|
||||||
<Books>
|
<Books>
|
||||||
|
@ -738,7 +738,7 @@
|
||||||
<OPTFL>
|
<OPTFL>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>1</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<IsCurrentTarget>1</IsCurrentTarget>
|
<IsCurrentTarget>0</IsCurrentTarget>
|
||||||
</OPTFL>
|
</OPTFL>
|
||||||
<CpuCode>8</CpuCode>
|
<CpuCode>8</CpuCode>
|
||||||
<Books>
|
<Books>
|
||||||
|
@ -926,7 +926,7 @@
|
||||||
<Focus>0</Focus>
|
<Focus>0</Focus>
|
||||||
<ColumnNumber>0</ColumnNumber>
|
<ColumnNumber>0</ColumnNumber>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<TopLine>110</TopLine>
|
<TopLine>111</TopLine>
|
||||||
<CurrentLine>112</CurrentLine>
|
<CurrentLine>112</CurrentLine>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\src\main.c</PathWithFileName>
|
<PathWithFileName>..\src\main.c</PathWithFileName>
|
||||||
|
@ -972,10 +972,10 @@
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<Focus>0</Focus>
|
<Focus>0</Focus>
|
||||||
<ColumnNumber>37</ColumnNumber>
|
<ColumnNumber>54</ColumnNumber>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<TopLine>122</TopLine>
|
<TopLine>123</TopLine>
|
||||||
<CurrentLine>129</CurrentLine>
|
<CurrentLine>137</CurrentLine>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\src\mouse_app.c</PathWithFileName>
|
<PathWithFileName>..\src\mouse_app.c</PathWithFileName>
|
||||||
<FilenameWithoutPath>mouse_app.c</FilenameWithoutPath>
|
<FilenameWithoutPath>mouse_app.c</FilenameWithoutPath>
|
||||||
|
@ -1006,7 +1006,7 @@
|
||||||
<Focus>0</Focus>
|
<Focus>0</Focus>
|
||||||
<ColumnNumber>38</ColumnNumber>
|
<ColumnNumber>38</ColumnNumber>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<TopLine>144</TopLine>
|
<TopLine>135</TopLine>
|
||||||
<CurrentLine>150</CurrentLine>
|
<CurrentLine>150</CurrentLine>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\src\msc_app.c</PathWithFileName>
|
<PathWithFileName>..\src\msc_app.c</PathWithFileName>
|
||||||
|
@ -1484,9 +1484,9 @@
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<Focus>0</Focus>
|
<Focus>0</Focus>
|
||||||
<ColumnNumber>2</ColumnNumber>
|
<ColumnNumber>4</ColumnNumber>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<TopLine>3184</TopLine>
|
<TopLine>3185</TopLine>
|
||||||
<CurrentLine>3196</CurrentLine>
|
<CurrentLine>3196</CurrentLine>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\..\..\vendor\fatfs\ff.c</PathWithFileName>
|
<PathWithFileName>..\..\..\vendor\fatfs\ff.c</PathWithFileName>
|
||||||
|
@ -1556,10 +1556,10 @@
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<Focus>0</Focus>
|
<Focus>0</Focus>
|
||||||
<ColumnNumber>3</ColumnNumber>
|
<ColumnNumber>22</ColumnNumber>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<TopLine>0</TopLine>
|
<TopLine>79</TopLine>
|
||||||
<CurrentLine>0</CurrentLine>
|
<CurrentLine>88</CurrentLine>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\..\bsp\boards\printf_retarget.c</PathWithFileName>
|
<PathWithFileName>..\..\bsp\boards\printf_retarget.c</PathWithFileName>
|
||||||
<FilenameWithoutPath>printf_retarget.c</FilenameWithoutPath>
|
<FilenameWithoutPath>printf_retarget.c</FilenameWithoutPath>
|
||||||
|
@ -1694,7 +1694,7 @@
|
||||||
<Focus>0</Focus>
|
<Focus>0</Focus>
|
||||||
<ColumnNumber>30</ColumnNumber>
|
<ColumnNumber>30</ColumnNumber>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<TopLine>145</TopLine>
|
<TopLine>146</TopLine>
|
||||||
<CurrentLine>153</CurrentLine>
|
<CurrentLine>153</CurrentLine>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName>
|
<PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName>
|
||||||
|
|
243
tinyusb/tusb.h
243
tinyusb/tusb.h
|
@ -1,121 +1,122 @@
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
@file tusb.h
|
@file tusb.h
|
||||||
@author hathach (tinyusb.org)
|
@author hathach (tinyusb.org)
|
||||||
|
|
||||||
@section LICENSE
|
@section LICENSE
|
||||||
|
|
||||||
Software License Agreement (BSD License)
|
Software License Agreement (BSD License)
|
||||||
|
|
||||||
Copyright (c) 2013, hathach (tinyusb.org)
|
Copyright (c) 2013, hathach (tinyusb.org)
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the copyright holders nor the
|
3. Neither the name of the copyright holders nor the
|
||||||
names of its contributors may be used to endorse or promote products
|
names of its contributors may be used to endorse or promote products
|
||||||
derived from this software without specific prior written permission.
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
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
|
INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
This file is part of the tinyusb stack.
|
This file is part of the tinyusb stack.
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
/** \file
|
/** \file
|
||||||
* \brief Tiny USB header
|
* \brief Tiny USB header
|
||||||
*
|
*
|
||||||
* \note Tiny USB header Note
|
* \note Tiny USB header Note
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _TUSB_H_
|
#ifndef _TUSB_H_
|
||||||
#define _TUSB_H_
|
#define _TUSB_H_
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// INCLUDE
|
// INCLUDE
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
#include "common/common.h"
|
#include "common/common.h"
|
||||||
#include "hal/hal.h"
|
#include "hal/hal.h"
|
||||||
#include "osal/osal.h"
|
#include "osal/osal.h"
|
||||||
|
|
||||||
//------------- HOST -------------//
|
//------------- HOST -------------//
|
||||||
#if MODE_HOST_SUPPORTED
|
#if MODE_HOST_SUPPORTED
|
||||||
#include "host/usbh.h"
|
#include "host/usbh.h"
|
||||||
|
|
||||||
#if HOST_CLASS_HID
|
#if HOST_CLASS_HID
|
||||||
#include "class/hid_host.h"
|
#include "class/hid_host.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TUSB_CFG_HOST_MSC
|
#if TUSB_CFG_HOST_MSC
|
||||||
#include "class/msc_host.h"
|
#include "class/msc_host.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TUSB_CFG_HOST_CDC
|
#if TUSB_CFG_HOST_CDC
|
||||||
#include "class/cdc_host.h"
|
#include "class/cdc_host.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TUSB_CFG_HOST_CUSTOM_CLASS
|
#if TUSB_CFG_HOST_CUSTOM_CLASS
|
||||||
#include "class/custom_class.h"
|
#include "class/custom_class.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//------------- DEVICE -------------//
|
//------------- DEVICE -------------//
|
||||||
#if MODE_DEVICE_SUPPORTED
|
#if MODE_DEVICE_SUPPORTED
|
||||||
#include "device/usbd.h"
|
#include "device/usbd.h"
|
||||||
|
|
||||||
#if DEVICE_CLASS_HID
|
#if DEVICE_CLASS_HID
|
||||||
#include "class/hid_device.h"
|
#include "class/hid_device.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TUSB_CFG_DEVICE_CDC
|
#if TUSB_CFG_DEVICE_CDC
|
||||||
#include "class/cdc_device.h"
|
#include "class/cdc_device.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TUSB_CFG_DEVICE_MSC
|
#if TUSB_CFG_DEVICE_MSC
|
||||||
#include "class/msc_device.h"
|
#include "class/msc_device.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// APPLICATION API
|
// APPLICATION API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
tusb_error_t tusb_init(void);
|
tusb_error_t tusb_init(void);
|
||||||
|
|
||||||
// TODO merge with tick_tock
|
// TODO merge with tick_tock
|
||||||
#if TUSB_CFG_OS == TUSB_OS_NONE
|
#if TUSB_CFG_OS == TUSB_OS_NONE
|
||||||
void tusb_task_runner(void);
|
void tusb_task_runner(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TUSB_CFG_OS == TUSB_OS_NONE && !defined(_TEST_)
|
#if TUSB_CFG_OS == TUSB_OS_NONE && !defined(_TEST_)
|
||||||
static inline void tusb_tick_tock(void) ATTR_ALWAYS_INLINE;
|
static inline void tusb_tick_tock(void) ATTR_ALWAYS_INLINE;
|
||||||
static inline void tusb_tick_tock(void)
|
static inline void tusb_tick_tock(void)
|
||||||
{
|
{
|
||||||
osal_tick_tock();
|
osal_tick_tock();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _TUSB_H_ */
|
#endif /* _TUSB_H_ */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue