mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-11-16 04:24:33 +00:00
Compare commits
16 Commits
8286196d9f
...
v1.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
350b1080ea | ||
|
|
50e7ae7e87 | ||
|
|
61712bbd13 | ||
|
|
3ea936e80c | ||
|
|
b2f35dcf3f | ||
|
|
412d548f9c | ||
|
|
54326fcb82 | ||
|
|
db900ce5c0 | ||
|
|
95f4228da1 | ||
|
|
f07bb06437 | ||
|
|
625c8f2126 | ||
|
|
6d20d222b8 | ||
|
|
2c55f26f00 | ||
|
|
5f26d0e1f8 | ||
|
|
ed2d2b0d70 | ||
|
|
17ef8ff63e |
@@ -35,27 +35,7 @@
|
||||
|
||||
void rt_init_thread_entry(void* parameter)
|
||||
{
|
||||
/* LwIP Initialization */
|
||||
#ifdef RT_USING_LWIP
|
||||
{
|
||||
extern void lwip_sys_init(void);
|
||||
|
||||
/* register ethernetif device */
|
||||
eth_system_device_init();
|
||||
|
||||
rt_hw_stm32_eth_init();
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init lwip system */
|
||||
lwip_sys_init();
|
||||
rt_kprintf("TCP/IP initialized!\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
//FS
|
||||
|
||||
//GUI
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
float f_var1;
|
||||
@@ -92,16 +72,9 @@ int rt_application_init()
|
||||
{
|
||||
rt_thread_t init_thread;
|
||||
|
||||
#if (RT_THREAD_PRIORITY_MAX == 32)
|
||||
init_thread = rt_thread_create("init",
|
||||
rt_init_thread_entry, RT_NULL,
|
||||
2048, 8, 20);
|
||||
#else
|
||||
init_thread = rt_thread_create("init",
|
||||
rt_init_thread_entry, RT_NULL,
|
||||
2048, 80, 20);
|
||||
#endif
|
||||
|
||||
2048, RT_THREAD_PRIORITY_MAX/3, 20);
|
||||
if (init_thread != RT_NULL)
|
||||
rt_thread_startup(init_thread);
|
||||
|
||||
|
||||
@@ -85,9 +85,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -138,8 +138,6 @@ void rt_init_thread_entry(void* parameter)
|
||||
/* register ethernetif device */
|
||||
eth_system_device_init();
|
||||
rt_hw_macb_init();
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
/* init lwip system */
|
||||
lwip_sys_init();
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ int main(void)
|
||||
#endif
|
||||
|
||||
rt_system_scheduler_init();
|
||||
rt_device_init_all();
|
||||
rt_application_init();
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
|
||||
@@ -62,9 +62,6 @@ void rtthread_startup(void)
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM,
|
||||
&uart0);
|
||||
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
rt_console_set_device("uart0");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -65,11 +65,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -114,9 +114,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
/* init all devices */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init finsh */
|
||||
#ifdef RT_USING_FINSH
|
||||
finsh_system_init();
|
||||
|
||||
@@ -55,11 +55,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -118,8 +118,6 @@ void rtthread_startup(void)
|
||||
/* init sd card device */
|
||||
rt_hw_sdcard_init();
|
||||
#endif
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
@@ -118,8 +118,6 @@ void rtthread_startup(void)
|
||||
/* init sd card device */
|
||||
rt_hw_sdcard_init();
|
||||
#endif
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
@@ -118,8 +118,6 @@ void rtthread_startup(void)
|
||||
/* init sd card device */
|
||||
rt_hw_sdcard_init();
|
||||
#endif
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
@@ -76,11 +76,6 @@ void rtthread_startup(void)
|
||||
rt_thread_idle_sethook(rt_hw_led_flash);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -76,11 +76,6 @@ void rtthread_startup(void)
|
||||
rt_thread_idle_sethook(rt_hw_led_flash);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -19,14 +19,20 @@
|
||||
#include <rtthread.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
#include <components.h>
|
||||
#endif
|
||||
#ifdef RT_USING_LWIP
|
||||
#include <emac.h>
|
||||
#include <netif/ethernetif.h>
|
||||
extern int lwip_system_init(void);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
#include <dfs_fs.h>
|
||||
#include <sd.h>
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
#include <shell.h>
|
||||
#include <finsh.h>
|
||||
#endif
|
||||
|
||||
/* thread phase init */
|
||||
@@ -38,21 +44,40 @@ void rt_init_thread_entry(void *parameter)
|
||||
#ifdef RT_USING_LWIP
|
||||
/* register Ethernet interface device */
|
||||
lpc17xx_emac_hw_init();
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
/* initialization RT-Thread Components */
|
||||
rt_components_init();
|
||||
/* initialize lwip stack */
|
||||
/* register ethernetif device */
|
||||
eth_system_device_init();
|
||||
|
||||
/* initialize lwip system */
|
||||
lwip_system_init();
|
||||
rt_kprintf("TCP/IP initialized!\n");
|
||||
#endif
|
||||
|
||||
/* Filesystem Initialization */
|
||||
#ifdef RT_USING_DFS
|
||||
rt_hw_sdcard_init();
|
||||
|
||||
/* initialize the device file system */
|
||||
dfs_init();
|
||||
|
||||
#ifdef RT_USING_DFS_ELMFAT
|
||||
/* initialize the elm chan FatFS file system*/
|
||||
elm_init();
|
||||
#endif
|
||||
|
||||
/* mount sd card fat partition 1 as root directory */
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
|
||||
rt_kprintf("File System initialized!\n");
|
||||
else
|
||||
rt_kprintf("File System init failed!\n");
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
/* initialize finsh */
|
||||
finsh_system_init();
|
||||
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
int rt_application_init()
|
||||
|
||||
@@ -16,20 +16,13 @@
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
|
||||
#include "LPC17xx.h"
|
||||
#include "board.h"
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
#include "sd.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup LPC17
|
||||
* @addtogroup LPC176x
|
||||
*/
|
||||
|
||||
/*@{*/
|
||||
|
||||
extern int rt_application_init(void);
|
||||
#include <board.h>
|
||||
extern int rt_application_init(void);
|
||||
|
||||
#ifdef __CC_ARM
|
||||
extern int Image$$RW_IRAM1$$ZI$$Limit;
|
||||
@@ -84,14 +77,6 @@ void rtthread_startup(void)
|
||||
/* initialize scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
#ifdef RT_USING_DFS
|
||||
rt_hw_sdcard_init();
|
||||
#endif
|
||||
/* initialize all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* initialize application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>Variant</name>
|
||||
<version>19</version>
|
||||
<state>37</state>
|
||||
<version>20</version>
|
||||
<state>38</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>GEndianMode</name>
|
||||
@@ -87,7 +87,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>OGLastSavedByProductVersion</name>
|
||||
<state>6.30.6.53380</state>
|
||||
<state>6.50.2.4581</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>GeneralEnableMisra</name>
|
||||
@@ -137,13 +137,13 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>GFPUCoreSlave</name>
|
||||
<version>19</version>
|
||||
<state>37</state>
|
||||
<version>20</version>
|
||||
<state>38</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>GBECoreSlave</name>
|
||||
<version>19</version>
|
||||
<state>37</state>
|
||||
<version>20</version>
|
||||
<state>38</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OGUseCmsis</name>
|
||||
@@ -294,21 +294,20 @@
|
||||
<option>
|
||||
<name>CCIncludePath2</name>
|
||||
<state></state>
|
||||
<state>$PROJ_DIR$\..\..\include</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src</state>
|
||||
<state>$PROJ_DIR$\applications</state>
|
||||
<state>$PROJ_DIR$\CMSIS\CM3\DeviceSupport\NXP\LPC17xx</state>
|
||||
<state>$PROJ_DIR$\drivers</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\include</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\include\ipv4</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\include\netif</state>
|
||||
<state>$PROJ_DIR$\..\..\components\CMSIS\Include</state>
|
||||
<state>$PROJ_DIR$\.</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\include\ipv4</state>
|
||||
<state>$PROJ_DIR$\applications</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\arch\include</state>
|
||||
<state>$PROJ_DIR$\..\..\include</state>
|
||||
<state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m3</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\include</state>
|
||||
<state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
|
||||
<state>$PROJ_DIR$\..\..\components\init</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\arch\include</state>
|
||||
<state>$PROJ_DIR$\..\..\components\finsh</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\include\netif</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCStdIncCheck</name>
|
||||
@@ -401,6 +400,10 @@
|
||||
<name>IccFloatSemantics</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCOptimizationNoSizeConstraints</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
@@ -620,7 +623,7 @@
|
||||
<name>ILINK</name>
|
||||
<archiveVersion>0</archiveVersion>
|
||||
<data>
|
||||
<version>14</version>
|
||||
<version>15</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
@@ -788,10 +791,6 @@
|
||||
<name>CrcAlign</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcAlgo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcPoly</name>
|
||||
<state>0x11021</state>
|
||||
@@ -894,6 +893,16 @@
|
||||
<name>IlinkStackCallGraphFile</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcAlgorithm</name>
|
||||
<version>0</version>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcUnitSize</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
@@ -950,7 +959,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>Variant</name>
|
||||
<version>19</version>
|
||||
<version>20</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
@@ -1058,12 +1067,12 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>GFPUCoreSlave</name>
|
||||
<version>19</version>
|
||||
<version>20</version>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>GBECoreSlave</name>
|
||||
<version>19</version>
|
||||
<version>20</version>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
@@ -1215,21 +1224,20 @@
|
||||
<option>
|
||||
<name>CCIncludePath2</name>
|
||||
<state></state>
|
||||
<state>$PROJ_DIR$\..\..\include</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src</state>
|
||||
<state>$PROJ_DIR$\applications</state>
|
||||
<state>$PROJ_DIR$\CMSIS\CM3\DeviceSupport\NXP\LPC17xx</state>
|
||||
<state>$PROJ_DIR$\drivers</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\include</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\include\ipv4</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\include\netif</state>
|
||||
<state>$PROJ_DIR$\..\..\components\CMSIS\Include</state>
|
||||
<state>$PROJ_DIR$\.</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\include\ipv4</state>
|
||||
<state>$PROJ_DIR$\applications</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\arch\include</state>
|
||||
<state>$PROJ_DIR$\..\..\include</state>
|
||||
<state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m3</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\include</state>
|
||||
<state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
|
||||
<state>$PROJ_DIR$\..\..\components\init</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\arch\include</state>
|
||||
<state>$PROJ_DIR$\..\..\components\finsh</state>
|
||||
<state>$PROJ_DIR$\..\..\components\net\lwip\src\include\netif</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCStdIncCheck</name>
|
||||
@@ -1322,6 +1330,10 @@
|
||||
<name>IccFloatSemantics</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCOptimizationNoSizeConstraints</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
@@ -1541,7 +1553,7 @@
|
||||
<name>ILINK</name>
|
||||
<archiveVersion>0</archiveVersion>
|
||||
<data>
|
||||
<version>14</version>
|
||||
<version>15</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>0</debug>
|
||||
<option>
|
||||
@@ -1709,10 +1721,6 @@
|
||||
<name>CrcAlign</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcAlgo</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcPoly</name>
|
||||
<state>0x11021</state>
|
||||
@@ -1815,6 +1823,16 @@
|
||||
<name>IlinkStackCallGraphFile</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcAlgorithm</name>
|
||||
<version>0</version>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CrcUnitSize</name>
|
||||
<version>0</version>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
@@ -1865,12 +1883,6 @@
|
||||
<name>$PROJ_DIR$\CMSIS\CM3\DeviceSupport\NXP\LPC17xx\system_LPC17xx.c</name>
|
||||
</file>
|
||||
</group>
|
||||
<group>
|
||||
<name>Components</name>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\init\components.c</name>
|
||||
</file>
|
||||
</group>
|
||||
<group>
|
||||
<name>CORTEX-M3</name>
|
||||
<file>
|
||||
@@ -1994,109 +2006,109 @@
|
||||
<group>
|
||||
<name>LwIP</name>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\api_lib.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\api_lib.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\api_msg.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\api_msg.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\autoip.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\autoip.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\def.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\def.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\dhcp.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\dhcp.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\dns.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\dns.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\err.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\err.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\netif\etharp.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\netif\etharp.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\netif\ethernetif.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\netif\ethernetif.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\icmp.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\icmp.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\igmp.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\igmp.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\inet.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet_chksum.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\inet_chksum.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\init.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\init.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\ip.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_addr.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\ip_addr.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_frag.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\ipv4\ip_frag.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\memp.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\memp.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\netbuf.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\netbuf.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\netdb.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\netdb.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\netif.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\netif.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\netifapi.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\netifapi.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\pbuf.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\pbuf.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\raw.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\raw.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\netif\slipif.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\netif\slipif.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\sockets.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\sockets.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\stats.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\stats.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\sys.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\sys.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\arch\sys_arch.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\tcp.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\tcp.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\tcp_in.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\tcp_in.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\tcp_out.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\tcp_out.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\api\tcpip.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\api\tcpip.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\timers.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\timers.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip\src\core\udp.c</name>
|
||||
<name>$PROJ_DIR$\..\..\components\net\lwip-1.4.1\src\core\udp.c</name>
|
||||
</file>
|
||||
</group>
|
||||
</project>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile></SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
@@ -43,14 +44,14 @@
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\obj\</OutputDirectory>
|
||||
<OutputDirectory>.\build\</OutputDirectory>
|
||||
<OutputName>rtthread-lpc</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\obj\</ListingPath>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
@@ -97,6 +98,7 @@
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
@@ -136,6 +138,7 @@
|
||||
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
|
||||
<RestoreFunctions>0</RestoreFunctions>
|
||||
<RestoreToolbox>1</RestoreToolbox>
|
||||
<RestoreTracepoints>0</RestoreTracepoints>
|
||||
</Target>
|
||||
<RunDebugAfterBuild>0</RunDebugAfterBuild>
|
||||
<TargetSelection>7</TargetSelection>
|
||||
@@ -164,9 +167,14 @@
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4099</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>Segger\JL2CM3.dll</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
@@ -344,11 +352,12 @@
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>.;..\..\components\CMSIS\Include;..\..\components\finsh;..\..\components\init;..\..\components\net\lwip\src;..\..\components\net\lwip\src\arch\include;..\..\components\net\lwip\src\include;..\..\components\net\lwip\src\include\ipv4;..\..\components\net\lwip\src\include\netif;..\..\include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m3;CMSIS\CM3\DeviceSupport\NXP\LPC17xx;applications;drivers</IncludePath>
|
||||
<IncludePath>.;..\..\components\CMSIS\Include;..\..\components\finsh;..\..\components\net\lwip-1.4.1\src;..\..\components\net\lwip-1.4.1\src\arch\include;..\..\components\net\lwip-1.4.1\src\include;..\..\components\net\lwip-1.4.1\src\include\ipv4;..\..\components\net\lwip-1.4.1\src\include\netif;..\..\include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m3;CMSIS\CM3\DeviceSupport\NXP\LPC17xx;applications;drivers</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
@@ -359,6 +368,7 @@
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -385,6 +395,21 @@
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>CMSIS</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>system_LPC17xx.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>CMSIS\CM3\DeviceSupport\NXP\LPC17xx\system_LPC17xx.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>startup_LPC17xx.s</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>CMSIS\CM3\DeviceSupport\NXP\LPC17xx\startup\arm\startup_LPC17xx.s</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Applications</GroupName>
|
||||
<Files>
|
||||
@@ -405,21 +430,6 @@
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>CMSIS</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>system_LPC17xx.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>CMSIS\CM3\DeviceSupport\NXP\LPC17xx\system_LPC17xx.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>startup_LPC17xx.s</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>CMSIS\CM3\DeviceSupport\NXP\LPC17xx\startup\arm\startup_LPC17xx.s</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Drivers</GroupName>
|
||||
<Files>
|
||||
@@ -553,6 +563,16 @@
|
||||
<Group>
|
||||
<GroupName>finsh</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>shell.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\shell.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>symbol.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\symbol.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>cmd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -593,11 +613,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\finsh_parser.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>finsh_token.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\finsh_token.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>finsh_var.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -609,24 +624,9 @@
|
||||
<FilePath>..\..\components\finsh\finsh_vm.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>shell.c</FileName>
|
||||
<FileName>finsh_token.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\shell.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>symbol.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\symbol.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Components</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>components.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\init\components.c</FilePath>
|
||||
<FilePath>..\..\components\finsh\finsh_token.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
@@ -636,177 +636,177 @@
|
||||
<File>
|
||||
<FileName>api_lib.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\api_lib.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\api_lib.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>api_msg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\api_msg.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\api_msg.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>err.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\err.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\err.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netbuf.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\netbuf.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\netbuf.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netdb.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\netdb.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\netdb.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netifapi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\netifapi.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\netifapi.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sockets.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\sockets.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\sockets.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcpip.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\tcpip.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\tcpip.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sys_arch.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\arch\sys_arch.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\arch\sys_arch.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>def.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\def.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\def.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>dhcp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\dhcp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\dhcp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>dns.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\dns.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\dns.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>init.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\init.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\init.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>memp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\memp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\memp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netif.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\netif.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\netif.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>pbuf.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\pbuf.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\pbuf.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>raw.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\raw.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\raw.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stats.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\stats.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\stats.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sys.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\sys.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\sys.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\tcp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\tcp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcp_in.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\tcp_in.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\tcp_in.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcp_out.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\tcp_out.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\tcp_out.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>timers.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\timers.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\timers.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>udp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\udp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\udp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>autoip.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\autoip.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\autoip.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>icmp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\icmp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\icmp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>igmp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\igmp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\igmp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>inet.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\inet.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\inet.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>inet_chksum.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\inet_chksum.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\inet_chksum.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ip.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\ip.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\ip.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ip_addr.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\ip_addr.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\ip_addr.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ip_frag.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\ip_frag.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\ip_frag.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>etharp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\netif\etharp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\netif\etharp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ethernetif.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\netif\ethernetif.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\netif\ethernetif.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>slipif.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\netif\slipif.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\netif\slipif.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart0"
|
||||
// </section>
|
||||
|
||||
// <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="true" />
|
||||
#define RT_USING_COMPONENTS_INIT
|
||||
// <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="false" />
|
||||
// #define RT_USING_COMPONENTS_INIT
|
||||
// <section name="RT_USING_FINSH" description="Using finsh as shell, which is a C-Express shell" default="true" >
|
||||
#define RT_USING_FINSH
|
||||
// <bool name="FINSH_USING_SYMTAB" description="Using symbol table in finsh shell" default="true" />
|
||||
@@ -99,7 +99,7 @@
|
||||
// <section name="RT_USING_DFS" description="Device file system" default="true" >
|
||||
// #define RT_USING_DFS
|
||||
// <bool name="DFS_USING_WORKDIR" description="Using working directory" default="true" />
|
||||
// #define DFS_USING_WORKDIR
|
||||
#define DFS_USING_WORKDIR
|
||||
// <integer name="DFS_FILESYSTEMS_MAX" description="The maximal number of mounted file system" default="4" />
|
||||
#define DFS_FILESYSTEMS_MAX 2
|
||||
// <integer name="DFS_FD_MAX" description="The maximal number of opened files" default="4" />
|
||||
@@ -107,12 +107,14 @@
|
||||
// <bool name="RT_USING_DFS_ELMFAT" description="Using ELM FatFs" default="true" />
|
||||
#define RT_USING_DFS_ELMFAT
|
||||
// <integer name="RT_DFS_ELM_USE_LFN" description="Support long file name" default="0">
|
||||
// <item description="Disable">0</item>
|
||||
// <item description="LFN1">1</item>
|
||||
// <item description="LFN1">2</item>
|
||||
// <item description="LFN3">3</item>
|
||||
// </integer>
|
||||
#define RT_DFS_ELM_USE_LFN 1
|
||||
#define RT_DFS_ELM_USE_LFN 0
|
||||
// <integer name="RT_DFS_ELM_MAX_LFN" description="Maximal size of file name length" default="256" />
|
||||
#define RT_DFS_ELM_MAX_LFN 64
|
||||
#define RT_DFS_ELM_MAX_LFN 256
|
||||
// <bool name="RT_USING_DFS_YAFFS2" description="Using YAFFS2" default="false" />
|
||||
// #define RT_USING_DFS_YAFFS2
|
||||
// <bool name="RT_USING_DFS_UFFS" description="Using UFFS" default="false" />
|
||||
|
||||
169
bsp/lpc176x/template.uvopt
Normal file
169
bsp/lpc176x/template.uvopt
Normal file
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_opt.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>RT-Thread LPC17xx</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>1</RunSim>
|
||||
<RunTarget>0</RunTarget>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>8</CpuCode>
|
||||
<DllOpt>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments>-MPU</SimDllArguments>
|
||||
<SimDlgDllName>DARMP1.DLL</SimDlgDllName>
|
||||
<SimDlgDllArguments>-pLPC1768</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments>-MPU</TargetDllArguments>
|
||||
<TargetDlgDllName>TARMP1.DLL</TargetDlgDllName>
|
||||
<TargetDlgDllArguments>-pLPC1768</TargetDlgDllArguments>
|
||||
</DllOpt>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>0</tRtrace>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<nTsel>7</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>Segger\JL2CM3.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U20090928 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD10000000 -FC800 -FN1 -FF0LPC_IAP_512 -FS00 -FL080000</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-O463 -S0 -C0 -FO7 -FD10000000 -FC800 -FN1 -FF0LPC_IAP_512 -FS00 -FL080000)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>0</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
</ProjectOpt>
|
||||
@@ -30,6 +30,7 @@
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile></SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
@@ -43,14 +44,14 @@
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\obj\</OutputDirectory>
|
||||
<OutputDirectory>.\build\</OutputDirectory>
|
||||
<OutputName>rtthread-lpc</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\obj\</ListingPath>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
@@ -61,6 +62,8 @@
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
@@ -95,6 +98,7 @@
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
@@ -115,7 +119,7 @@
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
<Simulator>
|
||||
<UseSimulator>1</UseSimulator>
|
||||
<UseSimulator>0</UseSimulator>
|
||||
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
|
||||
<RunToMain>1</RunToMain>
|
||||
<RestoreBreakpoints>1</RestoreBreakpoints>
|
||||
@@ -126,17 +130,18 @@
|
||||
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
|
||||
</Simulator>
|
||||
<Target>
|
||||
<UseTarget>0</UseTarget>
|
||||
<UseTarget>1</UseTarget>
|
||||
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
|
||||
<RunToMain>0</RunToMain>
|
||||
<RunToMain>1</RunToMain>
|
||||
<RestoreBreakpoints>1</RestoreBreakpoints>
|
||||
<RestoreWatchpoints>1</RestoreWatchpoints>
|
||||
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
|
||||
<RestoreFunctions>0</RestoreFunctions>
|
||||
<RestoreToolbox>1</RestoreToolbox>
|
||||
<RestoreTracepoints>0</RestoreTracepoints>
|
||||
</Target>
|
||||
<RunDebugAfterBuild>0</RunDebugAfterBuild>
|
||||
<TargetSelection>5</TargetSelection>
|
||||
<TargetSelection>7</TargetSelection>
|
||||
<SimDlls>
|
||||
<CpuDll></CpuDll>
|
||||
<CpuDllArguments></CpuDllArguments>
|
||||
@@ -162,9 +167,14 @@
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4099</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>Segger\JL2CM3.dll</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
@@ -342,6 +352,7 @@
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -357,6 +368,7 @@
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
|
||||
@@ -65,8 +65,6 @@ void rt_init_thread_entry(void *parameter)
|
||||
|
||||
/* register ethernetif device */
|
||||
lpc17xx_emac_hw_init();
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init lwip system */
|
||||
lwip_sys_init();
|
||||
@@ -83,8 +81,6 @@ void rt_init_thread_entry(void *parameter)
|
||||
|
||||
/* init lcd */
|
||||
rt_hw_lcd_init();
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* find lcd device */
|
||||
lcd = rt_device_find("lcd");
|
||||
|
||||
932
bsp/lpc178x/project.uvopt
Normal file
932
bsp/lpc178x/project.uvopt
Normal file
@@ -0,0 +1,932 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_opt.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>RT-Thread LPC17xx</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>1</RunSim>
|
||||
<RunTarget>0</RunTarget>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>8</CpuCode>
|
||||
<DllOpt>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments>-MPU</SimDllArguments>
|
||||
<SimDlgDllName>DARMP1.DLL</SimDlgDllName>
|
||||
<SimDlgDllArguments>-pLPC1788</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments>-MPU</TargetDllArguments>
|
||||
<TargetDlgDllName>TARMP1.DLL</TargetDlgDllName>
|
||||
<TargetDlgDllArguments>-pLPC1788</TargetDlgDllArguments>
|
||||
</DllOpt>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>0</tRtrace>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<nTsel>7</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>Segger\JL2CM3.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-O463 -S0 -C0 -FO7 -FD10000000 -FC800 -FN1 -FF0LPC_IAP_512 -FS00 -FL080000)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>0</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>CMSIS\CM3\CoreSupport\core_cm3.c</PathWithFileName>
|
||||
<FilenameWithoutPath>core_cm3.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>CMSIS\CM3\DeviceSupport\NXP\LPC177x_8x\system_LPC177x_8x.c</PathWithFileName>
|
||||
<FilenameWithoutPath>system_LPC177x_8x.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>2</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>CMSIS\CM3\DeviceSupport\NXP\LPC177x_8x\startup\arm\startup_LPC177x_8x.s</PathWithFileName>
|
||||
<FilenameWithoutPath>startup_LPC177x_8x.s</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Applications</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>153</TopLine>
|
||||
<CurrentLine>33</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>applications\application.c</PathWithFileName>
|
||||
<FilenameWithoutPath>application.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>applications\startup.c</PathWithFileName>
|
||||
<FilenameWithoutPath>startup.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Drivers</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>6</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\board.c</PathWithFileName>
|
||||
<FilenameWithoutPath>board.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>7</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\drv_glcd.c</PathWithFileName>
|
||||
<FilenameWithoutPath>drv_glcd.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>8</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\lpc177x_8x_clkpwr.c</PathWithFileName>
|
||||
<FilenameWithoutPath>lpc177x_8x_clkpwr.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>9</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\lpc177x_8x_emc.c</PathWithFileName>
|
||||
<FilenameWithoutPath>lpc177x_8x_emc.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>10</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\lpc177x_8x_pinsel.c</PathWithFileName>
|
||||
<FilenameWithoutPath>lpc177x_8x_pinsel.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>11</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\lpc177x_8x_uart.c</PathWithFileName>
|
||||
<FilenameWithoutPath>lpc177x_8x_uart.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>12</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\lpc17xx_lcd.c</PathWithFileName>
|
||||
<FilenameWithoutPath>lpc17xx_lcd.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>13</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\sdram.c</PathWithFileName>
|
||||
<FilenameWithoutPath>sdram.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>14</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>drivers\uart.c</PathWithFileName>
|
||||
<FilenameWithoutPath>uart.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Kernel</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>15</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\clock.c</PathWithFileName>
|
||||
<FilenameWithoutPath>clock.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>16</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\device.c</PathWithFileName>
|
||||
<FilenameWithoutPath>device.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>17</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\idle.c</PathWithFileName>
|
||||
<FilenameWithoutPath>idle.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>18</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\ipc.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ipc.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>19</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\irq.c</PathWithFileName>
|
||||
<FilenameWithoutPath>irq.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>20</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\kservice.c</PathWithFileName>
|
||||
<FilenameWithoutPath>kservice.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>21</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\mem.c</PathWithFileName>
|
||||
<FilenameWithoutPath>mem.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>22</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\memheap.c</PathWithFileName>
|
||||
<FilenameWithoutPath>memheap.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>23</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\mempool.c</PathWithFileName>
|
||||
<FilenameWithoutPath>mempool.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>24</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\object.c</PathWithFileName>
|
||||
<FilenameWithoutPath>object.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>25</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\scheduler.c</PathWithFileName>
|
||||
<FilenameWithoutPath>scheduler.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>26</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\thread.c</PathWithFileName>
|
||||
<FilenameWithoutPath>thread.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>27</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\src\timer.c</PathWithFileName>
|
||||
<FilenameWithoutPath>timer.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>CORTEX-M3</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>28</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\libcpu\arm\cortex-m3\cpuport.c</PathWithFileName>
|
||||
<FilenameWithoutPath>cpuport.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>29</FileNumber>
|
||||
<FileType>2</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\libcpu\arm\cortex-m3\context_rvds.S</PathWithFileName>
|
||||
<FilenameWithoutPath>context_rvds.S</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>30</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\libcpu\arm\common\backtrace.c</PathWithFileName>
|
||||
<FilenameWithoutPath>backtrace.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>31</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\libcpu\arm\common\div0.c</PathWithFileName>
|
||||
<FilenameWithoutPath>div0.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>32</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\libcpu\arm\common\showmem.c</PathWithFileName>
|
||||
<FilenameWithoutPath>showmem.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>finsh</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>33</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\shell.c</PathWithFileName>
|
||||
<FilenameWithoutPath>shell.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>34</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\symbol.c</PathWithFileName>
|
||||
<FilenameWithoutPath>symbol.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>35</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\cmd.c</PathWithFileName>
|
||||
<FilenameWithoutPath>cmd.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>36</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_compiler.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_compiler.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>37</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_error.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_error.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>38</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_heap.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_heap.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>39</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_init.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_init.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>40</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_node.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_node.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>41</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_ops.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_ops.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>42</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_parser.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_parser.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>43</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_var.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_var.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>44</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_vm.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_vm.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>6</GroupNumber>
|
||||
<FileNumber>45</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<Focus>0</Focus>
|
||||
<ColumnNumber>0</ColumnNumber>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<TopLine>0</TopLine>
|
||||
<CurrentLine>0</CurrentLine>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\components\finsh\finsh_token.c</PathWithFileName>
|
||||
<FilenameWithoutPath>finsh_token.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
@@ -30,6 +30,7 @@
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile></SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
@@ -43,14 +44,14 @@
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\obj\</OutputDirectory>
|
||||
<OutputDirectory>.\build\</OutputDirectory>
|
||||
<OutputName>rtthread-lpc</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\obj\</ListingPath>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
@@ -97,6 +98,7 @@
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
@@ -130,7 +132,7 @@
|
||||
<Target>
|
||||
<UseTarget>1</UseTarget>
|
||||
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
|
||||
<RunToMain>0</RunToMain>
|
||||
<RunToMain>1</RunToMain>
|
||||
<RestoreBreakpoints>1</RestoreBreakpoints>
|
||||
<RestoreWatchpoints>1</RestoreWatchpoints>
|
||||
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
|
||||
@@ -165,9 +167,14 @@
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4099</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>Segger\JL2CM3.dll</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
@@ -388,21 +395,6 @@
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>Applications</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>application.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\application.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>startup.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\startup.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>CMSIS</GroupName>
|
||||
<Files>
|
||||
@@ -423,6 +415,21 @@
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Applications</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>application.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\application.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>startup.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\startup.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Drivers</GroupName>
|
||||
<Files>
|
||||
@@ -576,6 +583,16 @@
|
||||
<Group>
|
||||
<GroupName>finsh</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>shell.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\shell.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>symbol.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\symbol.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>cmd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -616,11 +633,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\finsh_parser.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>finsh_token.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\finsh_token.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>finsh_var.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -632,24 +644,9 @@
|
||||
<FilePath>..\..\components\finsh\finsh_vm.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>msh.c</FileName>
|
||||
<FileName>finsh_token.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\msh.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>msh_cmd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\msh_cmd.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>shell.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\shell.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>symbol.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\symbol.c</FilePath>
|
||||
<FilePath>..\..\components\finsh\finsh_token.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
||||
164
bsp/lpc178x/template.uvopt
Normal file
164
bsp/lpc178x/template.uvopt
Normal file
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_opt.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>RT-Thread LPC17xx</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>1</RunSim>
|
||||
<RunTarget>0</RunTarget>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>0</CpuCode>
|
||||
<DllOpt>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments>-MPU</SimDllArguments>
|
||||
<SimDlgDllName>DARMP1.DLL</SimDlgDllName>
|
||||
<SimDlgDllArguments>-pLPC1788</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments>-MPU</TargetDllArguments>
|
||||
<TargetDlgDllName>TARMP1.DLL</TargetDlgDllName>
|
||||
<TargetDlgDllArguments>-pLPC1788</TargetDlgDllArguments>
|
||||
</DllOpt>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>0</tRtrace>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<nTsel>7</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>Segger\JL2CM3.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-O463 -S0 -C0 -FO7 -FD10000000 -FC800 -FN1 -FF0LPC_IAP_512 -FS00 -FL080000)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>0</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
</ProjectOpt>
|
||||
@@ -30,6 +30,7 @@
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile></SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
@@ -43,14 +44,14 @@
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\obj\</OutputDirectory>
|
||||
<OutputDirectory>.\build\</OutputDirectory>
|
||||
<OutputName>rtthread-lpc</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\obj\</ListingPath>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
@@ -61,6 +62,8 @@
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
@@ -95,6 +98,7 @@
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
@@ -128,12 +132,13 @@
|
||||
<Target>
|
||||
<UseTarget>1</UseTarget>
|
||||
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
|
||||
<RunToMain>0</RunToMain>
|
||||
<RunToMain>1</RunToMain>
|
||||
<RestoreBreakpoints>1</RestoreBreakpoints>
|
||||
<RestoreWatchpoints>1</RestoreWatchpoints>
|
||||
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
|
||||
<RestoreFunctions>0</RestoreFunctions>
|
||||
<RestoreToolbox>1</RestoreToolbox>
|
||||
<RestoreTracepoints>0</RestoreTracepoints>
|
||||
</Target>
|
||||
<RunDebugAfterBuild>0</RunDebugAfterBuild>
|
||||
<TargetSelection>7</TargetSelection>
|
||||
@@ -162,9 +167,14 @@
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4099</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>Segger\JL2CM3.dll</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
@@ -342,6 +352,7 @@
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -357,6 +368,7 @@
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
|
||||
@@ -100,9 +100,6 @@ void rtthread_startup(void)
|
||||
|
||||
/* init hardware serial device */
|
||||
rt_hw_serial_init();
|
||||
|
||||
/*init all registed devices*/
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include <rtthread.h>
|
||||
#include "board.h"
|
||||
#include "drv_led.h"
|
||||
|
||||
#define RT_DEVICE_CTRL_RTC_GET_COUNT 0x81 /**< get count */
|
||||
#define LED_DEVICE_CTRL 0x01 /*LED control command*/
|
||||
|
||||
#define LED_NUM 4
|
||||
struct led_ctrl
|
||||
@@ -92,11 +93,11 @@ static rt_size_t rt_led_write(rt_device_t dev, rt_off_t pos,
|
||||
{
|
||||
if (*value++)
|
||||
{
|
||||
led.ctrl[pos + index].port->CLR |= (1 << led.ctrl[pos + index].num);
|
||||
led.ctrl[pos + index].port->CLR = (1 << led.ctrl[pos + index].num);
|
||||
}
|
||||
else
|
||||
{
|
||||
led.ctrl[pos + index].port->SET |= (1 << led.ctrl[pos + index].num);
|
||||
led.ctrl[pos + index].port->SET = (1 << led.ctrl[pos + index].num);
|
||||
}
|
||||
}
|
||||
return index;
|
||||
@@ -106,7 +107,7 @@ static rt_err_t rt_led_control(rt_device_t dev, rt_uint8_t cmd, void *args)
|
||||
{
|
||||
RT_ASSERT(dev == &led.parent);
|
||||
|
||||
if (cmd == RT_DEVICE_CTRL_RTC_GET_COUNT)
|
||||
if (cmd == LED_DEVICE_CTRL)
|
||||
{
|
||||
rt_uint32_t *led_num = args;
|
||||
*led_num = LED_NUM;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef __DRV_LED_H
|
||||
#define __DRV_LED_H
|
||||
|
||||
#define LED_DEVICE_CTRL 0x01 /*LED control command*/
|
||||
|
||||
void rt_led_hw_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,9 +34,6 @@ void rt_init_thread_entry(void *parameter)
|
||||
/* init Display Controller */
|
||||
rt_hw_dc_init();
|
||||
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* find Display Controller device */
|
||||
dc = rt_device_find("dc");
|
||||
|
||||
|
||||
@@ -64,11 +64,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -46,6 +46,12 @@ SECTIONS
|
||||
KEEP(*(VSymTab))
|
||||
__vsymtab_end = .;
|
||||
. = ALIGN(4);
|
||||
|
||||
. = ALIGN(4);
|
||||
__rt_init_start = .;
|
||||
KEEP(*(SORT(.rti_fn*)))
|
||||
__rt_init_end = .;
|
||||
. = ALIGN(4);
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
|
||||
@@ -69,11 +69,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -45,9 +45,6 @@ void rt_init_thread_entry(void *parameter)
|
||||
rt_hw_lcd_init();
|
||||
rt_hw_cpu_init();
|
||||
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
#ifdef RT_USING_RTGUI
|
||||
extern void rtgui_system_server_init(void);
|
||||
|
||||
|
||||
@@ -67,11 +67,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -59,13 +59,9 @@ void rtthread_startup(void)
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
#ifdef RT_USING_DFS
|
||||
#ifdef RT_USING_DFS_UFFS
|
||||
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_UFFS)
|
||||
rt_hw_nand_init();
|
||||
#endif
|
||||
#endif
|
||||
/* initialize all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* initialize application */
|
||||
|
||||
@@ -86,8 +86,6 @@ void rtthread_startup(void)
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init hardware serial device */
|
||||
rt_hw_serial_init();
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
|
||||
@@ -152,9 +152,6 @@ void rt_init_thread_entry(void *parameter)
|
||||
/* init keypad */
|
||||
rt_hw_key_init();
|
||||
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* find lcd device */
|
||||
lcd = rt_device_find("lcd");
|
||||
|
||||
@@ -175,9 +172,6 @@ void rt_init_thread_entry(void *parameter)
|
||||
/* register ethernetif device */
|
||||
rt_hw_dm9000_init();
|
||||
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init lwip system */
|
||||
lwip_sys_init();
|
||||
rt_kprintf("TCP/IP initialized!\n");
|
||||
@@ -197,9 +191,6 @@ void rt_init_thread_entry(void *parameter)
|
||||
/* init keypad */
|
||||
rt_hw_key_init();
|
||||
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* create ftk thread */
|
||||
ftk_thread = rt_thread_create("ftk",
|
||||
rt_ftk_thread_entry, RT_NULL,
|
||||
|
||||
@@ -126,9 +126,6 @@ void rtthread_startup(void)
|
||||
|
||||
/* rtc init */
|
||||
rt_hw_rtc_init();
|
||||
|
||||
/*init all registed devices */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
|
||||
@@ -65,12 +65,10 @@ void rtthread_startup()
|
||||
rt_system_heap_init(&__bss_end, (void*)0x34000000);
|
||||
#endif
|
||||
|
||||
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
rt_hw_sdcard_init();
|
||||
#endif
|
||||
@@ -79,9 +77,6 @@ void rtthread_startup()
|
||||
eth_system_device_init();
|
||||
rt_hw_dm9161_init();
|
||||
#endif
|
||||
|
||||
/*init all registed devices */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
@@ -103,21 +98,15 @@ void rtthread_startup()
|
||||
|
||||
/* never reach here */
|
||||
return ;
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
rt_uint32_t UNUSED level;
|
||||
|
||||
/* disable interrupt first */
|
||||
level = rt_hw_interrupt_disable();
|
||||
rt_hw_interrupt_disable();
|
||||
|
||||
/* startup RT-Thread RTOS */
|
||||
rtthread_startup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -71,11 +71,6 @@ void rtthread_startup(void)
|
||||
rt_thread_idle_sethook(rt_hw_led_flash);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -86,8 +86,6 @@ void rtthread_startup(void)
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init hardware serial device */
|
||||
rt_hw_serial_init();
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
|
||||
@@ -116,9 +116,6 @@ void rtthread_startup(void)
|
||||
#ifdef RT_USING_DFS
|
||||
rt_hw_sdcard_init();
|
||||
#endif
|
||||
|
||||
/*init all registed devices*/
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
|
||||
@@ -78,20 +78,6 @@ void rtthread_startup()
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
/* Not implemented */
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_LWIP
|
||||
/* Not implemented */
|
||||
#endif
|
||||
|
||||
/*init all registed devices */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -58,10 +58,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
/* init all device */
|
||||
#ifdef RT_USING_DEVICE
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -86,11 +86,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -22,11 +22,20 @@
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_init.h>
|
||||
#include <dfs_elm.h>
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
#include <components.h>
|
||||
#endif /* RT_USING_COMPONENTS_INIT */
|
||||
#ifdef RT_USING_LWIP
|
||||
#include <stm32_eth.h>
|
||||
#include <netif/ethernetif.h>
|
||||
extern int lwip_system_init(void);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
#include <shell.h>
|
||||
#include <finsh.h>
|
||||
#endif
|
||||
|
||||
void rt_init_thread_entry(void* parameter)
|
||||
{
|
||||
@@ -35,45 +44,50 @@ void rt_init_thread_entry(void* parameter)
|
||||
rt_platform_init();
|
||||
}
|
||||
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
/* initialization RT-Thread Components */
|
||||
rt_components_init();
|
||||
#endif
|
||||
|
||||
/* Filesystem Initialization */
|
||||
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT)
|
||||
/* initialize the device file system */
|
||||
dfs_init();
|
||||
|
||||
/* initialize the elm chan FatFS file system*/
|
||||
elm_init();
|
||||
|
||||
/* mount sd card fat partition 1 as root directory */
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
|
||||
{
|
||||
/* mount sd card fat partition 1 as root directory */
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
|
||||
{
|
||||
rt_kprintf("File System initialized!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("File System initialzation failed!\n");
|
||||
}
|
||||
rt_kprintf("File System initialized!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("File System initialzation failed!\n");
|
||||
}
|
||||
#endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */
|
||||
|
||||
#ifdef RT_USING_LWIP
|
||||
/* initialize lwip stack */
|
||||
/* register ethernetif device */
|
||||
eth_system_device_init();
|
||||
|
||||
/* initialize lwip system */
|
||||
lwip_system_init();
|
||||
rt_kprintf("TCP/IP initialized!\n");
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
/* initialize finsh */
|
||||
finsh_system_init();
|
||||
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
int rt_application_init(void)
|
||||
{
|
||||
rt_thread_t init_thread;
|
||||
rt_thread_t tid;
|
||||
|
||||
#if (RT_THREAD_PRIORITY_MAX == 32)
|
||||
init_thread = rt_thread_create("init",
|
||||
rt_init_thread_entry, RT_NULL,
|
||||
2048, 8, 20);
|
||||
#else
|
||||
init_thread = rt_thread_create("init",
|
||||
rt_init_thread_entry, RT_NULL,
|
||||
2048, 80, 20);
|
||||
#endif
|
||||
|
||||
if (init_thread != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(init_thread);
|
||||
}
|
||||
tid = rt_thread_create("init",
|
||||
rt_init_thread_entry, RT_NULL,
|
||||
2048, RT_THREAD_PRIORITY_MAX/3, 20);
|
||||
if (tid != RT_NULL) rt_thread_startup(tid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -81,9 +81,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>SFD\ST\STM32F107x\STM32F107.sfr</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
@@ -97,6 +98,7 @@
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
@@ -161,13 +163,18 @@
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4099</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>Segger\JL2CM3.dll</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
@@ -350,7 +357,7 @@
|
||||
<MiscControls></MiscControls>
|
||||
<Define>STM32F10X_CL, USE_STDPERIPH_DRIVER</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>.;..\..\components\CMSIS\Include;..\..\components\dfs;..\..\components\dfs\include;..\..\components\drivers\include;..\..\components\finsh;..\..\components\init;..\..\components\net\lwip\src;..\..\components\net\lwip\src\arch\include;..\..\components\net\lwip\src\include;..\..\components\net\lwip\src\include\ipv4;..\..\components\net\lwip\src\include\netif;..\..\include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m3;Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x;Libraries\STM32F10x_StdPeriph_Driver\inc;applications;drivers</IncludePath>
|
||||
<IncludePath>.;..\..\components\CMSIS\Include;..\..\components\dfs;..\..\components\dfs\include;..\..\components\drivers\include;..\..\components\finsh;..\..\components\net\lwip-1.4.1\src;..\..\components\net\lwip-1.4.1\src\arch\include;..\..\components\net\lwip-1.4.1\src\include;..\..\components\net\lwip-1.4.1\src\include\ipv4;..\..\components\net\lwip-1.4.1\src\include\netif;..\..\include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m3;Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x;Libraries\STM32F10x_StdPeriph_Driver\inc;applications;drivers</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
@@ -388,66 +395,6 @@
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>Applications</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>application.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\application.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>startup.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\startup.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Drivers</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>board.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\board.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>msd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\msd.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>platform.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\platform.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>rt_stm32f10x_spi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\rt_stm32f10x_spi.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>serial.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\serial.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32_eth.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\stm32_eth.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f10x_it.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\stm32f10x_it.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>usart.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\usart.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>STM32_StdPeriph</GroupName>
|
||||
<Files>
|
||||
@@ -578,6 +525,66 @@
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Applications</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>application.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\application.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>startup.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\startup.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Drivers</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>board.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\board.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>msd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\msd.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>platform.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\platform.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>rt_stm32f10x_spi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\rt_stm32f10x_spi.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>serial.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\serial.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32_eth.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\stm32_eth.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f10x_it.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\stm32f10x_it.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>usart.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>drivers\usart.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Kernel</GroupName>
|
||||
<Files>
|
||||
@@ -726,6 +733,16 @@
|
||||
<Group>
|
||||
<GroupName>finsh</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>shell.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\shell.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>symbol.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\symbol.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>cmd.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -766,11 +783,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\finsh_parser.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>finsh_token.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\finsh_token.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>finsh_var.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -782,24 +794,9 @@
|
||||
<FilePath>..\..\components\finsh\finsh_vm.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>shell.c</FileName>
|
||||
<FileName>finsh_token.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\shell.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>symbol.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\finsh\symbol.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Components</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>components.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\init\components.c</FilePath>
|
||||
<FilePath>..\..\components\finsh\finsh_token.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
@@ -809,177 +806,177 @@
|
||||
<File>
|
||||
<FileName>api_lib.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\api_lib.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\api_lib.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>api_msg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\api_msg.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\api_msg.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>err.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\err.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\err.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netbuf.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\netbuf.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\netbuf.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netdb.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\netdb.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\netdb.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netifapi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\netifapi.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\netifapi.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sockets.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\sockets.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\sockets.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcpip.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\api\tcpip.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\api\tcpip.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sys_arch.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\arch\sys_arch.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\arch\sys_arch.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>def.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\def.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\def.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>dhcp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\dhcp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\dhcp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>dns.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\dns.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\dns.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>init.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\init.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\init.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>memp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\memp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\memp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>netif.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\netif.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\netif.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>pbuf.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\pbuf.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\pbuf.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>raw.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\raw.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\raw.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stats.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\stats.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\stats.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>sys.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\sys.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\sys.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\tcp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\tcp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcp_in.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\tcp_in.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\tcp_in.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tcp_out.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\tcp_out.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\tcp_out.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>timers.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\timers.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\timers.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>udp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\udp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\udp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>autoip.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\autoip.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\autoip.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>icmp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\icmp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\icmp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>igmp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\igmp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\igmp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>inet.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\inet.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\inet.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>inet_chksum.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\inet_chksum.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\inet_chksum.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ip.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\ip.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\ip.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ip_addr.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\ip_addr.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\ip_addr.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ip_frag.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\core\ipv4\ip_frag.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\core\ipv4\ip_frag.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>etharp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\netif\etharp.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\netif\etharp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ethernetif.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\netif\ethernetif.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\netif\ethernetif.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>slipif.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\components\net\lwip\src\netif\slipif.c</FilePath>
|
||||
<FilePath>..\..\components\net\lwip-1.4.1\src\netif\slipif.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
||||
@@ -69,8 +69,8 @@
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
// </section>
|
||||
|
||||
// <section name="RT_USING_COMPONENTS_INIT" description="Using components init" default="true" >
|
||||
#define RT_USING_COMPONENTS_INIT
|
||||
// <section name="RT_USING_COMPONENTS_INIT" description="Using components init" default="false" >
|
||||
// #define RT_USING_COMPONENTS_INIT
|
||||
// </section>
|
||||
|
||||
/* SECTION: finsh, a C-Express shell */
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\</ListingPath>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
@@ -115,6 +115,7 @@
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>0</tRtrace>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<nTsel>7</nTsel>
|
||||
@@ -130,6 +131,22 @@
|
||||
<tIfile></tIfile>
|
||||
<pMon>Segger\JL2CM3.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U20090928 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F10x_CL -FS08000000 -FL040000</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_CL -FS08000000 -FL040000)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
@@ -153,7 +170,7 @@
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>3</newCpu>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>SFD\ST\STM32F107x\STM32F107.sfr</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
@@ -61,6 +62,8 @@
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
@@ -95,6 +98,7 @@
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
@@ -134,6 +138,7 @@
|
||||
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
|
||||
<RestoreFunctions>0</RestoreFunctions>
|
||||
<RestoreToolbox>1</RestoreToolbox>
|
||||
<RestoreTracepoints>0</RestoreTracepoints>
|
||||
</Target>
|
||||
<RunDebugAfterBuild>0</RunDebugAfterBuild>
|
||||
<TargetSelection>7</TargetSelection>
|
||||
@@ -158,13 +163,18 @@
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4099</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>Segger\JL2CM3.dll</Flash2>
|
||||
<Flash3></Flash3>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
@@ -342,6 +352,7 @@
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
@@ -357,6 +368,7 @@
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
|
||||
@@ -122,9 +122,6 @@ void rt_init_thread_entry(void* parameter)
|
||||
/* init touch panel */
|
||||
rtgui_touch_hw_init();
|
||||
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* find lcd device */
|
||||
lcd = rt_device_find("lcd");
|
||||
|
||||
|
||||
@@ -70,9 +70,6 @@ void rt_init_thread_entry(void* parameter)
|
||||
/* initialize eth interface */
|
||||
rt_hw_stm32_eth_init();
|
||||
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init lwip system */
|
||||
lwip_sys_init();
|
||||
rt_kprintf("TCP/IP initialized!\n");
|
||||
|
||||
@@ -107,9 +107,6 @@ void rtthread_startup(void)
|
||||
|
||||
rt_hw_rtc_init();
|
||||
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ void rt_init_thread_entry(void* parameter)
|
||||
eth_system_device_init();
|
||||
|
||||
rt_hw_stm32_eth_init();
|
||||
/* re-init device driver */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init lwip system */
|
||||
lwip_sys_init();
|
||||
|
||||
@@ -85,9 +85,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
/* Program Entry, set to mark it as "used" and avoid gc */
|
||||
MEMORY
|
||||
{
|
||||
CODE (rx) : ORIGIN = 0x08000000, LENGTH = 512k /* 512KB flash */
|
||||
DATA (rw) : ORIGIN = 0x20000000, LENGTH = 64k /* 64K sram */
|
||||
CODE (rx) : ORIGIN = 0x08000000, LENGTH = 1024k /* 1024KB flash */
|
||||
DATA (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
|
||||
}
|
||||
ENTRY(Reset_Handler)
|
||||
_system_stack_size = 0x100;
|
||||
|
||||
@@ -68,11 +68,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -84,10 +84,6 @@ void rtthread_startup(void)
|
||||
rt_thread_idle_sethook(rt_hw_led_flash);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -56,11 +56,6 @@ void rtthread_startup(void)
|
||||
/* init scheduler system */
|
||||
rt_system_scheduler_init();
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
/* init all device */
|
||||
rt_device_init_all();
|
||||
#endif
|
||||
|
||||
/* init application */
|
||||
rt_application_init();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ unsigned short pmap_getport(struct sockaddr_in *address, unsigned long program,
|
||||
{
|
||||
unsigned short port = 0;
|
||||
int socket = -1;
|
||||
register CLIENT *client;
|
||||
register CLIENT *client = RT_NULL;
|
||||
struct pmap parms;
|
||||
|
||||
address->sin_port = htons((unsigned short)PMAPPORT);
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2012-10-01 Yi Qiu first version
|
||||
* 2013-04-26 aozima add DEVICEQUALIFIER support.
|
||||
*/
|
||||
|
||||
#ifndef __USB_COMMON_H__
|
||||
@@ -149,22 +148,13 @@ extern "C" {
|
||||
#define USB_EPNO_MASK 0x7f
|
||||
#define USB_DIR_OUT 0x00
|
||||
#define USB_DIR_IN 0x80
|
||||
#define USB_DIR_INOUT 0x40
|
||||
#define USB_DIR_MASK 0x80
|
||||
|
||||
#define ID_UNASSIGNED 0
|
||||
#define ID_ASSIGNED 1
|
||||
|
||||
#define RH_GET_PORT_STATUS 0
|
||||
#define RH_SET_PORT_STATUS 1
|
||||
#define RH_CLEAR_PORT_FEATURE 2
|
||||
#define RH_SET_PORT_FEATURE 3
|
||||
|
||||
#define USB_BUS_POWERED 0
|
||||
#define USB_SELF_POWERED 1
|
||||
#define USB_REMOTE_WAKEUP 1
|
||||
#define USB_EP_HALT 0
|
||||
|
||||
/*
|
||||
* Port feature numbers
|
||||
*/
|
||||
@@ -215,7 +205,6 @@ extern "C" {
|
||||
|
||||
#define USB_EP_ATTR(attr) (attr & USB_EP_ATTR_TYPE_MASK)
|
||||
#define USB_EP_DESC_NUM(addr) (addr & USB_EP_DESC_NUM_MASK)
|
||||
#define USB_EP_DIR(addr) ((addr & USB_DIR_MASK)>>7)
|
||||
|
||||
#define uswap_32(x) \
|
||||
((((x) & 0xff000000) >> 24) | \
|
||||
@@ -343,21 +332,6 @@ struct uhub_descriptor
|
||||
};
|
||||
typedef struct uhub_descriptor* uhub_desc_t;
|
||||
|
||||
/* USB_DESC_TYPE_DEVICEQUALIFIER: Device Qualifier descriptor */
|
||||
struct usb_qualifier_descriptor
|
||||
{
|
||||
rt_uint8_t bLength;
|
||||
rt_uint8_t bDescriptorType;
|
||||
|
||||
rt_uint16_t bcdUSB; // TODO: big-endian.
|
||||
rt_uint8_t bDeviceClass;
|
||||
rt_uint8_t bDeviceSubClass;
|
||||
rt_uint8_t bDeviceProtocol;
|
||||
rt_uint8_t bMaxPacketSize0;
|
||||
rt_uint8_t bNumConfigurations;
|
||||
rt_uint8_t bRESERVED;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct uhid_descriptor
|
||||
{
|
||||
rt_uint8_t bLength;
|
||||
@@ -383,10 +357,8 @@ struct ureqest
|
||||
};
|
||||
typedef struct ureqest* ureq_t;
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (a < b ? a : b)
|
||||
#define MAX(a, b) (a > b ? a : b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* the define related to mass storage
|
||||
@@ -396,11 +368,6 @@ typedef struct ureqest* ureq_t;
|
||||
|
||||
#define SIZEOF_CSW 0x0d
|
||||
#define SIZEOF_CBW 0x1f
|
||||
#define SIZEOF_INQUIRY_CMD 0x24
|
||||
#define SIZEOF_MODE_SENSE_6 0x4
|
||||
#define SIZEOF_READ_CAPACITIES 0xc
|
||||
#define SIZEOF_READ_CAPACITY 0x8
|
||||
#define SIZEOF_REQUEST_SENSE 0x12
|
||||
|
||||
#define CBWFLAGS_DIR_M 0x80
|
||||
#define CBWFLAGS_DIR_IN 0x80
|
||||
@@ -409,7 +376,7 @@ typedef struct ureqest* ureq_t;
|
||||
#define SCSI_TEST_UNIT_READY 0x00
|
||||
#define SCSI_REQUEST_SENSE 0x03
|
||||
#define SCSI_INQUIRY_CMD 0x12
|
||||
#define SCSI_ALLOW_REMOVAL 0x1e
|
||||
#define SCSI_ALLOW_MEDIUM_REMOVAL 0x1e
|
||||
#define SCSI_MODE_SENSE_6 0x1a
|
||||
#define SCSI_START_STOP 0x1b
|
||||
#define SCSI_READ_CAPACITIES 0x23
|
||||
@@ -438,7 +405,7 @@ struct ustorage_csw
|
||||
{
|
||||
rt_uint32_t signature;
|
||||
rt_uint32_t tag;
|
||||
rt_int32_t data_reside;
|
||||
rt_uint32_t data_reside;
|
||||
rt_uint8_t status;
|
||||
};
|
||||
typedef struct ustorage_csw* ustorage_csw_t;
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2012-10-01 Yi Qiu first version
|
||||
* 2012-12-12 heyuanjie87 change endpoint and function handler
|
||||
* 2013-04-26 aozima add DEVICEQUALIFIER support.
|
||||
* 2012-12-12 heyuanjie87 change endpoint and class handler
|
||||
*/
|
||||
|
||||
#ifndef __USB_DEVICE_H__
|
||||
@@ -32,115 +31,59 @@
|
||||
|
||||
/* Vendor ID */
|
||||
#ifdef USB_VENDOR_ID
|
||||
#define _VENDOR_ID USB_VENDOR_ID
|
||||
#define _VENDOR_ID USB_VENDOR_ID
|
||||
#else
|
||||
#define _VENDOR_ID 0x0EFF
|
||||
#define _VENDOR_ID 0x0EFF
|
||||
#endif
|
||||
/* Product ID */
|
||||
#ifdef USB_PRODUCT_ID
|
||||
#define _PRODUCT_ID USB_PRODUCT_ID
|
||||
#define _PRODUCT_ID USB_PRODUCT_ID
|
||||
#else
|
||||
#define _PRODUCT_ID 0x0001
|
||||
#define _PRODUCT_ID 0x0001
|
||||
#endif
|
||||
|
||||
#define USB_BCD_DEVICE 0x0200 /* USB Specification Release Number in Binary-Coded Decimal */
|
||||
#define USB_BCD_VERSION 0x0200 /* USB 2.0 */
|
||||
#define EP0_IN_ADDR 0x80
|
||||
#define EP0_OUT_ADDR 0x00
|
||||
#define EP_HANDLER(ep, func, size) RT_ASSERT(ep != RT_NULL); ep->handler(func, size)
|
||||
#define EP_ADDRESS(ep) ep->ep_desc->bEndpointAddress
|
||||
#define EP_MAXPACKET(ep) ep->ep_desc->wMaxPacketSize
|
||||
#define FUNC_ENABLE(func) do{ \
|
||||
if(func->ops->enable != RT_NULL && \
|
||||
func->enabled == RT_FALSE) \
|
||||
{ \
|
||||
if(func->ops->enable(func) == RT_EOK) \
|
||||
func->enabled = RT_TRUE; \
|
||||
} \
|
||||
}while(0)
|
||||
#define FUNC_DISABLE(func) do{ \
|
||||
if(func->ops->disable != RT_NULL && \
|
||||
func->enabled == RT_TRUE) \
|
||||
{ \
|
||||
func->enabled = RT_FALSE; \
|
||||
func->ops->disable(func); \
|
||||
} \
|
||||
}while(0)
|
||||
#define USB_BCD_DEVICE 0x0200 /* USB Specification Release Number in Binary-Coded Decimal */
|
||||
#define USB_BCD_VERSION 0x0200 /* USB 2.0 */
|
||||
|
||||
struct ufunction;
|
||||
struct uclass;
|
||||
struct udevice;
|
||||
struct uendpoint;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* request to read full count */
|
||||
UIO_REQUEST_READ_FULL,
|
||||
/* request to read any count */
|
||||
UIO_REQUEST_READ_BEST,
|
||||
/* request to write full count */
|
||||
UIO_REQUEST_WRITE,
|
||||
}UIO_REQUEST_TYPE;
|
||||
|
||||
struct udcd_ops
|
||||
{
|
||||
rt_err_t (*set_address)(rt_uint8_t address);
|
||||
rt_err_t (*set_config)(rt_uint8_t address);
|
||||
rt_err_t (*ep_set_stall)(rt_uint8_t address);
|
||||
rt_err_t (*ep_clear_stall)(rt_uint8_t address);
|
||||
rt_err_t (*ep_enable)(struct uendpoint* ep);
|
||||
rt_err_t (*ep_disable)(struct uendpoint* ep);
|
||||
rt_size_t (*ep_read_prepare)(rt_uint8_t address, void *buffer, rt_size_t size);
|
||||
rt_size_t (*ep_read)(rt_uint8_t address, void *buffer);
|
||||
rt_size_t (*ep_write)(rt_uint8_t address, void *buffer, rt_size_t size);
|
||||
rt_err_t (*ep0_send_status)(void);
|
||||
rt_err_t (*suspend)(void);
|
||||
rt_err_t (*wakeup)(void);
|
||||
rt_err_t (*set_address)(rt_uint8_t value);
|
||||
rt_err_t (*clear_feature)(rt_uint16_t value, rt_uint16_t index);
|
||||
rt_err_t (*set_feature)(rt_uint16_t value, rt_uint16_t index);
|
||||
rt_err_t (*ep_alloc)(struct uendpoint* ep);
|
||||
rt_err_t (*ep_free)(struct uendpoint* ep);
|
||||
rt_err_t (*ep_stall)(struct uendpoint* ep);
|
||||
rt_err_t (*ep_run)(struct uendpoint* ep);
|
||||
rt_err_t (*ep_stop)(struct uendpoint* ep);
|
||||
rt_err_t (*ep_read)(struct uendpoint* ep, void *buffer, rt_size_t size);
|
||||
rt_size_t (*ep_write)(struct uendpoint* ep, void *buffer, rt_size_t size);
|
||||
rt_err_t (*send_status)(void);
|
||||
};
|
||||
|
||||
struct ep_id
|
||||
{
|
||||
rt_uint8_t addr;
|
||||
rt_uint8_t type;
|
||||
rt_uint8_t dir;
|
||||
rt_uint8_t maxpacket;
|
||||
rt_uint8_t status;
|
||||
};
|
||||
|
||||
typedef rt_err_t (*udep_handler_t)(struct ufunction* func, rt_size_t size);
|
||||
|
||||
struct uio_request
|
||||
{
|
||||
rt_list_t list;
|
||||
UIO_REQUEST_TYPE req_type;
|
||||
rt_uint8_t* buffer;
|
||||
rt_size_t size;
|
||||
rt_size_t remain_size;
|
||||
};
|
||||
typedef struct uio_request* uio_request_t;
|
||||
|
||||
struct uendpoint
|
||||
{
|
||||
rt_list_t list;
|
||||
uep_desc_t ep_desc;
|
||||
rt_list_t request_list;
|
||||
struct uio_request request;
|
||||
rt_uint8_t* buffer;
|
||||
rt_bool_t stalled;
|
||||
struct ep_id* id;
|
||||
udep_handler_t handler;
|
||||
rt_err_t (*rx_indicate)(struct udevice* dev, rt_size_t size);
|
||||
};
|
||||
typedef struct uendpoint* uep_t;
|
||||
|
||||
struct udcd
|
||||
{
|
||||
struct rt_device parent;
|
||||
const struct udcd_ops* ops;
|
||||
struct uendpoint ep0;
|
||||
struct ep_id* ep_pool;
|
||||
struct udcd_ops* ops;
|
||||
struct rt_completion completion;
|
||||
};
|
||||
typedef struct udcd* udcd_t;
|
||||
|
||||
typedef rt_err_t (*udep_handler_t)(struct udevice* device, struct uclass* cls, rt_size_t size);
|
||||
|
||||
struct uendpoint
|
||||
{
|
||||
rt_list_t list;
|
||||
rt_uint8_t* buffer;
|
||||
uep_desc_t ep_desc;
|
||||
udep_handler_t handler;
|
||||
rt_bool_t is_stall;
|
||||
};
|
||||
typedef struct uendpoint* uep_t;
|
||||
|
||||
struct ualtsetting
|
||||
{
|
||||
rt_list_t list;
|
||||
@@ -151,7 +94,7 @@ struct ualtsetting
|
||||
};
|
||||
typedef struct ualtsetting* ualtsetting_t;
|
||||
|
||||
typedef rt_err_t (*uintf_handler_t)(struct ufunction* func, ureq_t setup);
|
||||
typedef rt_err_t (*uintf_handler_t)(struct udevice* device, struct uclass* cls, ureq_t setup);
|
||||
|
||||
struct uinterface
|
||||
{
|
||||
@@ -163,32 +106,32 @@ struct uinterface
|
||||
};
|
||||
typedef struct uinterface* uintf_t;
|
||||
|
||||
struct ufunction_ops
|
||||
struct uclass_ops
|
||||
{
|
||||
rt_err_t (*enable)(struct ufunction* func);
|
||||
rt_err_t (*disable)(struct ufunction* func);
|
||||
rt_err_t (*sof_handler)(struct ufunction* func);
|
||||
rt_err_t (*run)(struct udevice* device, struct uclass* cls);
|
||||
rt_err_t (*stop)(struct udevice* device, struct uclass* cls);
|
||||
rt_err_t (*sof_handler)(struct udevice* device, struct uclass* cls);
|
||||
};
|
||||
typedef struct ufunction_ops* ufunction_ops_t;
|
||||
typedef struct uclass_ops* uclass_ops_t;
|
||||
|
||||
struct ufunction
|
||||
struct uclass
|
||||
{
|
||||
rt_list_t list;
|
||||
ufunction_ops_t ops;
|
||||
uclass_ops_t ops;
|
||||
void* eps;
|
||||
struct udevice* device;
|
||||
udev_desc_t dev_desc;
|
||||
void* user_data;
|
||||
rt_bool_t enabled;
|
||||
|
||||
rt_list_t intf_list;
|
||||
};
|
||||
typedef struct ufunction* ufunction_t;
|
||||
typedef struct uclass* uclass_t;
|
||||
|
||||
struct uconfig
|
||||
{
|
||||
rt_list_t list;
|
||||
struct uconfig_descriptor cfg_desc;
|
||||
rt_list_t func_list;
|
||||
rt_list_t cls_list;
|
||||
};
|
||||
typedef struct uconfig* uconfig_t;
|
||||
|
||||
@@ -196,8 +139,6 @@ struct udevice
|
||||
{
|
||||
rt_list_t list;
|
||||
struct udevice_descriptor dev_desc;
|
||||
|
||||
struct usb_qualifier_descriptor * dev_qualifier;
|
||||
const char** str;
|
||||
|
||||
udevice_state_t state;
|
||||
@@ -213,11 +154,8 @@ enum udev_msg_type
|
||||
{
|
||||
USB_MSG_SETUP_NOTIFY,
|
||||
USB_MSG_DATA_NOTIFY,
|
||||
USB_MSG_EP0_OUT,
|
||||
USB_MSG_EP_CLEAR_FEATURE,
|
||||
USB_MSG_SOF,
|
||||
USB_MSG_RESET,
|
||||
USB_MSG_PLUG_IN,
|
||||
/* we don't need to add a "PLUG_IN" event because after the cable is
|
||||
* plugged in(before any SETUP) the classed have nothing to do. If the host
|
||||
* is ready, it will send RESET and we will have USB_MSG_RESET. So, a RESET
|
||||
@@ -226,184 +164,153 @@ enum udev_msg_type
|
||||
};
|
||||
typedef enum udev_msg_type udev_msg_type;
|
||||
|
||||
struct ep_msg
|
||||
{
|
||||
rt_size_t size;
|
||||
rt_uint8_t ep_addr;
|
||||
};
|
||||
|
||||
struct udev_msg
|
||||
{
|
||||
udev_msg_type type;
|
||||
udcd_t dcd;
|
||||
union
|
||||
{
|
||||
struct ep_msg ep_msg;
|
||||
struct ureqest setup;
|
||||
struct
|
||||
{
|
||||
rt_size_t size;
|
||||
rt_uint8_t ep_addr;
|
||||
} ep_msg;
|
||||
struct
|
||||
{
|
||||
rt_uint32_t* packet;
|
||||
} setup_msg;
|
||||
} content;
|
||||
};
|
||||
typedef struct udev_msg* udev_msg_t;
|
||||
|
||||
udevice_t rt_usbd_device_new(void);
|
||||
uconfig_t rt_usbd_config_new(void);
|
||||
ufunction_t rt_usbd_function_new(udevice_t device, udev_desc_t dev_desc,
|
||||
ufunction_ops_t ops);
|
||||
uintf_t rt_usbd_interface_new(udevice_t device, uintf_handler_t handler);
|
||||
uep_t rt_usbd_endpoint_new(uep_desc_t ep_desc, udep_handler_t handler);
|
||||
ualtsetting_t rt_usbd_altsetting_new(rt_size_t desc_size);
|
||||
udevice_t rt_usbd_device_create(void);
|
||||
uconfig_t rt_usbd_config_create(void);
|
||||
uclass_t rt_usbd_class_create(udevice_t device,
|
||||
udev_desc_t dev_desc,
|
||||
uclass_ops_t ops);
|
||||
uintf_t rt_usbd_interface_create(udevice_t device, uintf_handler_t handler);
|
||||
uep_t rt_usbd_endpoint_create(uep_desc_t ep_desc, udep_handler_t handler);
|
||||
ualtsetting_t rt_usbd_altsetting_create(rt_size_t desc_size);
|
||||
|
||||
rt_err_t rt_usbd_core_init(void);
|
||||
rt_err_t rt_usb_device_init(void);
|
||||
rt_err_t rt_usbd_event_signal(struct udev_msg* msg);
|
||||
rt_err_t rt_usb_device_init(const char *udc_name);
|
||||
rt_err_t rt_usbd_post_event(struct udev_msg *msg, rt_size_t size);
|
||||
rt_err_t rt_usbd_free_device(udevice_t device);
|
||||
rt_err_t rt_usbd_device_set_controller(udevice_t device, udcd_t dcd);
|
||||
rt_err_t rt_usbd_device_set_descriptor(udevice_t device, udev_desc_t dev_desc);
|
||||
rt_err_t rt_usbd_device_set_string(udevice_t device, const char** ustring);
|
||||
rt_err_t rt_usbd_device_set_qualifier(udevice_t device, struct usb_qualifier_descriptor* qualifier);
|
||||
rt_err_t rt_usbd_device_add_config(udevice_t device, uconfig_t cfg);
|
||||
rt_err_t rt_usbd_config_add_function(uconfig_t cfg, ufunction_t func);
|
||||
rt_err_t rt_usbd_function_add_interface(ufunction_t func, uintf_t intf);
|
||||
rt_err_t rt_usbd_config_add_class(uconfig_t cfg, uclass_t cls);
|
||||
rt_err_t rt_usbd_class_add_interface(uclass_t cls, uintf_t intf);
|
||||
rt_err_t rt_usbd_interface_add_altsetting(uintf_t intf, ualtsetting_t setting);
|
||||
rt_err_t rt_usbd_altsetting_add_endpoint(ualtsetting_t setting, uep_t ep);
|
||||
rt_err_t rt_usbd_altsetting_config_descriptor(ualtsetting_t setting, const void* desc, rt_off_t intf_pos);
|
||||
rt_err_t rt_usbd_altsetting_config_descriptor(ualtsetting_t setting,
|
||||
const void *desc,
|
||||
rt_off_t intf_pos);
|
||||
rt_err_t rt_usbd_set_config(udevice_t device, rt_uint8_t value);
|
||||
rt_err_t rt_usbd_set_altsetting(uintf_t intf, rt_uint8_t value);
|
||||
|
||||
udevice_t rt_usbd_find_device(udcd_t dcd);
|
||||
uconfig_t rt_usbd_find_config(udevice_t device, rt_uint8_t value);
|
||||
uintf_t rt_usbd_find_interface(udevice_t device, rt_uint8_t value, ufunction_t *pfunc);
|
||||
uep_t rt_usbd_find_endpoint(udevice_t device, ufunction_t* pfunc, rt_uint8_t ep_addr);
|
||||
rt_size_t rt_usbd_io_request(udevice_t device, uep_t ep, uio_request_t req);
|
||||
rt_size_t rt_usbd_ep0_write(udevice_t device, void *buffer, rt_size_t size);
|
||||
rt_size_t rt_usbd_ep0_read(udevice_t device, void *buffer, rt_size_t size,
|
||||
rt_err_t (*rx_ind)(udevice_t device, rt_size_t size));
|
||||
uintf_t rt_usbd_find_interface(udevice_t device,
|
||||
rt_uint8_t value,
|
||||
uclass_t *pcls);
|
||||
uep_t rt_usbd_find_endpoint(udevice_t device,
|
||||
uclass_t *pcls,
|
||||
rt_uint8_t ep_addr);
|
||||
|
||||
ufunction_t rt_usbd_function_mstorage_create(udevice_t device);
|
||||
ufunction_t rt_usbd_function_cdc_create(udevice_t device);
|
||||
ufunction_t rt_usbd_function_rndis_create(udevice_t device);
|
||||
ufunction_t rt_usbd_function_dap_create(udevice_t device);
|
||||
uclass_t rt_usbd_class_mstorage_create(udevice_t device);
|
||||
uclass_t rt_usbd_class_cdc_create(udevice_t device);
|
||||
uclass_t rt_usbd_class_rndis_create(udevice_t device);
|
||||
uclass_t rt_usbd_class_dap_create(udevice_t device);
|
||||
|
||||
#ifdef RT_USB_DEVICE_COMPOSITE
|
||||
rt_err_t rt_usbd_function_set_iad(ufunction_t func, uiad_desc_t iad_desc);
|
||||
rt_err_t rt_usbd_class_set_iad(uclass_t cls, uiad_desc_t iad_desc);
|
||||
#endif
|
||||
|
||||
rt_err_t rt_usbd_set_feature(udevice_t device, rt_uint16_t value, rt_uint16_t index);
|
||||
rt_err_t rt_usbd_clear_feature(udevice_t device, rt_uint16_t value, rt_uint16_t index);
|
||||
rt_err_t rt_usbd_ep_set_stall(udevice_t device, uep_t ep);
|
||||
rt_err_t rt_usbd_ep_clear_stall(udevice_t device, uep_t ep);
|
||||
rt_err_t rt_usbd_ep0_set_stall(udevice_t device);
|
||||
rt_err_t rt_usbd_ep0_clear_stall(udevice_t device);
|
||||
rt_err_t rt_usbd_ep0_setup_handler(udcd_t dcd, struct ureqest* setup);
|
||||
rt_err_t rt_usbd_ep0_in_handler(udcd_t dcd);
|
||||
rt_err_t rt_usbd_ep0_out_handler(udcd_t dcd, rt_size_t size);
|
||||
rt_err_t rt_usbd_ep_in_handler(udcd_t dcd, rt_uint8_t address);
|
||||
rt_err_t rt_usbd_ep_out_handler(udcd_t dcd, rt_uint8_t address, rt_size_t size);
|
||||
rt_err_t rt_usbd_reset_handler(udcd_t dcd);
|
||||
rt_err_t rt_usbd_connect_handler(udcd_t dcd);
|
||||
rt_err_t rt_usbd_disconnect_handler(udcd_t dcd);
|
||||
rt_err_t rt_usbd_sof_handler(udcd_t dcd);
|
||||
|
||||
rt_inline rt_err_t dcd_set_address(udcd_t dcd, rt_uint8_t address)
|
||||
rt_inline rt_err_t dcd_set_address(udcd_t dcd, rt_uint8_t value)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->set_address != RT_NULL);
|
||||
|
||||
return dcd->ops->set_address(address);
|
||||
return dcd->ops->set_address(value);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_set_config(udcd_t dcd, rt_uint8_t address)
|
||||
rt_inline rt_err_t dcd_clear_feature(udcd_t dcd,
|
||||
rt_uint16_t value,
|
||||
rt_uint16_t index)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->set_config != RT_NULL);
|
||||
|
||||
return dcd->ops->set_config(address);
|
||||
return dcd->ops->clear_feature(value, index);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_enable(udcd_t dcd, uep_t ep)
|
||||
rt_inline rt_err_t dcd_set_feature(udcd_t dcd,
|
||||
rt_uint8_t value,
|
||||
rt_uint16_t index)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->ep_enable != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_enable(ep);
|
||||
return dcd->ops->set_feature(value, index);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_disable(udcd_t dcd, uep_t ep)
|
||||
rt_inline rt_err_t dcd_ep_stall(udcd_t dcd, uep_t ep)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->ep_disable != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_disable(ep);
|
||||
return dcd->ops->ep_stall(ep);
|
||||
}
|
||||
|
||||
rt_inline rt_size_t dcd_ep_read_prepare(udcd_t dcd, rt_uint8_t address, void *buffer,
|
||||
rt_inline rt_uint8_t dcd_ep_alloc(udcd_t dcd, uep_t ep)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_alloc(ep);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_free(udcd_t dcd, uep_t ep)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_free(ep);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_run(udcd_t dcd, uep_t ep)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_run(ep);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_stop(udcd_t dcd, uep_t ep)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_stop(ep);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_read(udcd_t dcd, uep_t ep, void *buffer,
|
||||
rt_size_t size)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
|
||||
if(dcd->ops->ep_read_prepare != RT_NULL)
|
||||
{
|
||||
return dcd->ops->ep_read_prepare(address, buffer, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return dcd->ops->ep_read(ep, buffer, size);
|
||||
}
|
||||
|
||||
rt_inline rt_size_t dcd_ep_read(udcd_t dcd, rt_uint8_t address, void *buffer)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
|
||||
if(dcd->ops->ep_read != RT_NULL)
|
||||
{
|
||||
return dcd->ops->ep_read(address, buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
rt_inline rt_size_t dcd_ep_write(udcd_t dcd, rt_uint8_t address, void *buffer,
|
||||
rt_inline rt_size_t dcd_ep_write(udcd_t dcd,
|
||||
uep_t ep,
|
||||
void *buffer,
|
||||
rt_size_t size)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->ep_write != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_write(address, buffer, size);
|
||||
return dcd->ops->ep_write(ep, buffer, size);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep0_send_status(udcd_t dcd)
|
||||
rt_inline rt_err_t dcd_send_status(udcd_t dcd)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->ep0_send_status != RT_NULL);
|
||||
|
||||
return dcd->ops->ep0_send_status();
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_set_stall(udcd_t dcd, rt_uint8_t address)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->ep_set_stall != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_set_stall(address);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t dcd_ep_clear_stall(udcd_t dcd, rt_uint8_t address)
|
||||
{
|
||||
RT_ASSERT(dcd != RT_NULL);
|
||||
RT_ASSERT(dcd->ops != RT_NULL);
|
||||
RT_ASSERT(dcd->ops->ep_clear_stall != RT_NULL);
|
||||
|
||||
return dcd->ops->ep_clear_stall(address);
|
||||
return dcd->ops->send_status();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,17 +37,17 @@ extern "C" {
|
||||
#define USB_HUB_PORT_NUM 0x04
|
||||
#define SIZEOF_USB_REQUEST 0x08
|
||||
|
||||
#define DEV_STATUS_IDLE 0x00
|
||||
#define DEV_STATUS_BUSY 0x01
|
||||
#define DEV_STATUS_ERROR 0x02
|
||||
#define UINST_STATUS_IDLE 0x00
|
||||
#define UINST_STATUS_BUSY 0x01
|
||||
#define UINST_STATUS_ERROR 0x02
|
||||
|
||||
#define UPIPE_STATUS_OK 0x00
|
||||
#define UPIPE_STATUS_STALL 0x01
|
||||
#define UPIPE_STATUS_ERROR 0x02
|
||||
|
||||
struct uhcd;
|
||||
struct uintf;
|
||||
struct uhub;
|
||||
struct uifinst;
|
||||
struct uhubinst;
|
||||
|
||||
struct uclass_driver
|
||||
{
|
||||
@@ -55,8 +55,8 @@ struct uclass_driver
|
||||
int class_code;
|
||||
int subclass_code;
|
||||
|
||||
rt_err_t (*enable)(void* arg);
|
||||
rt_err_t (*disable)(void* arg);
|
||||
rt_err_t (*run)(void* arg);
|
||||
rt_err_t (*stop)(void* arg);
|
||||
|
||||
void* user_data;
|
||||
};
|
||||
@@ -86,31 +86,32 @@ struct uinstance
|
||||
rt_uint8_t max_packet_size;
|
||||
rt_uint8_t port;
|
||||
|
||||
struct uhub* parent;
|
||||
struct uintf* intf[USB_MAX_INTERFACE];
|
||||
struct uhubinst* parent;
|
||||
struct uifinst* ifinst[USB_MAX_INTERFACE];
|
||||
};
|
||||
typedef struct uinstance* uinst_t;
|
||||
|
||||
struct uintf
|
||||
struct uifinst
|
||||
{
|
||||
struct uinstance* device;
|
||||
uinst_t uinst;
|
||||
uintf_desc_t intf_desc;
|
||||
|
||||
ucd_t drv;
|
||||
void *user_data;
|
||||
};
|
||||
typedef struct uifinst* uifinst_t;
|
||||
|
||||
struct upipe
|
||||
{
|
||||
rt_uint32_t status;
|
||||
struct uendpoint_descriptor ep;
|
||||
struct uintf* intf;
|
||||
uifinst_t ifinst;
|
||||
func_callback callback;
|
||||
void* user_data;
|
||||
};
|
||||
typedef struct upipe* upipe_t;
|
||||
|
||||
struct uhub
|
||||
struct uhubinst
|
||||
{
|
||||
struct uhub_descriptor hub_desc;
|
||||
rt_uint8_t num_ports;
|
||||
@@ -123,17 +124,17 @@ struct uhub
|
||||
struct uinstance* self;
|
||||
struct uhcd *hcd;
|
||||
};
|
||||
typedef struct uhub* uhub_t;
|
||||
typedef struct uhubinst* uhubinst_t;
|
||||
|
||||
struct uhcd_ops
|
||||
{
|
||||
int (*ctl_xfer)(struct uinstance* inst, ureq_t setup, void* buffer, int nbytes,
|
||||
int (*ctl_xfer)(uinst_t inst, ureq_t setup, void* buffer, int nbytes,
|
||||
int timeout);
|
||||
int (*bulk_xfer)(upipe_t pipe, void* buffer, int nbytes, int timeout);
|
||||
int (*int_xfer)(upipe_t pipe, void* buffer, int nbytes, int timeout);
|
||||
int (*iso_xfer)(upipe_t pipe, void* buffer, int nbytes, int timeout);
|
||||
|
||||
rt_err_t (*alloc_pipe)(struct upipe** pipe, struct uintf* intf, uep_desc_t ep,
|
||||
rt_err_t (*alloc_pipe)(struct upipe** pipe, uifinst_t ifinst, uep_desc_t ep,
|
||||
func_callback callback);
|
||||
rt_err_t (*free_pipe)(upipe_t pipe);
|
||||
rt_err_t (*hub_ctrl)(rt_uint16_t port, rt_uint8_t cmd, void *args);
|
||||
@@ -143,7 +144,6 @@ struct uhcd
|
||||
{
|
||||
struct rt_device parent;
|
||||
struct uhcd_ops* ops;
|
||||
struct uhub* roothub;
|
||||
};
|
||||
typedef struct uhcd* uhcd_t;
|
||||
|
||||
@@ -159,7 +159,7 @@ struct uhost_msg
|
||||
uhost_msg_type type;
|
||||
union
|
||||
{
|
||||
struct uhub* hub;
|
||||
struct uhubinst* uhub;
|
||||
struct
|
||||
{
|
||||
func_callback function;
|
||||
@@ -170,67 +170,82 @@ struct uhost_msg
|
||||
typedef struct uhost_msg* uhost_msg_t;
|
||||
|
||||
/* usb host system interface */
|
||||
rt_err_t rt_usb_host_init(void);
|
||||
void rt_usbh_hub_init(void);
|
||||
void rt_usb_host_init(void);
|
||||
void rt_usb_hub_thread(void);
|
||||
|
||||
/* usb host core interface */
|
||||
struct uinstance* rt_usbh_alloc_instance(void);
|
||||
rt_err_t rt_usbh_attatch_instance(struct uinstance* device);
|
||||
rt_err_t rt_usbh_detach_instance(struct uinstance* device);
|
||||
rt_err_t rt_usbh_get_descriptor(struct uinstance* device, rt_uint8_t type, void* buffer,
|
||||
int nbytes);
|
||||
rt_err_t rt_usbh_set_configure(struct uinstance* device, int config);
|
||||
rt_err_t rt_usbh_set_address(struct uinstance* device);
|
||||
rt_err_t rt_usbh_set_interface(struct uinstance* device, int intf);
|
||||
rt_err_t rt_usbh_clear_feature(struct uinstance* device, int endpoint, int feature);
|
||||
rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num,
|
||||
uintf_desc_t* intf_desc);
|
||||
rt_err_t rt_usbh_get_endpoint_descriptor(uintf_desc_t intf_desc, int num,
|
||||
uep_desc_t* ep_desc);
|
||||
uinst_t rt_usb_alloc_instance(void);
|
||||
rt_err_t rt_usb_attatch_instance(uinst_t uinst);
|
||||
rt_err_t rt_usb_detach_instance(uinst_t uinst);
|
||||
rt_err_t rt_usb_get_descriptor(uinst_t uinst,
|
||||
rt_uint8_t type,
|
||||
void *buffer,
|
||||
int nbytes);
|
||||
rt_err_t rt_usb_set_configure(uinst_t uinst, int config);
|
||||
rt_err_t rt_usb_set_address(uinst_t uinst);
|
||||
rt_err_t rt_usb_set_interface(uinst_t uinst, int intf);
|
||||
rt_err_t rt_usb_clear_feature(uinst_t uinst, int endpoint, int feature);
|
||||
rt_err_t rt_usb_get_interface_descriptor(ucfg_desc_t cfg_desc,
|
||||
int num,
|
||||
uintf_desc_t *intf_desc);
|
||||
rt_err_t rt_usb_get_endpoint_descriptor(uintf_desc_t intf_desc,
|
||||
int num,
|
||||
uep_desc_t *ep_desc);
|
||||
|
||||
/* usb class driver interface */
|
||||
rt_err_t rt_usbh_class_driver_init(void);
|
||||
rt_err_t rt_usbh_class_driver_register(ucd_t drv);
|
||||
rt_err_t rt_usbh_class_driver_unregister(ucd_t drv);
|
||||
rt_err_t rt_usbh_class_driver_enable(ucd_t drv, void* args);
|
||||
rt_err_t rt_usbh_class_driver_disable(ucd_t drv, void* args);
|
||||
ucd_t rt_usbh_class_driver_find(int class_code, int subclass_code);
|
||||
rt_err_t rt_usb_class_driver_init(void);
|
||||
rt_err_t rt_usb_class_driver_register(ucd_t drv);
|
||||
rt_err_t rt_usb_class_driver_unregister(ucd_t drv);
|
||||
rt_err_t rt_usb_class_driver_run(ucd_t drv, void *args);
|
||||
rt_err_t rt_usb_class_driver_stop(ucd_t drv, void *args);
|
||||
ucd_t rt_usb_class_driver_find(int class_code, int subclass_code);
|
||||
|
||||
/* usb class driver implement */
|
||||
ucd_t rt_usbh_class_driver_hid(void);
|
||||
ucd_t rt_usbh_class_driver_hub(void);
|
||||
ucd_t rt_usbh_class_driver_storage(void);
|
||||
ucd_t rt_usbh_class_driver_adk(void);
|
||||
ucd_t rt_usb_class_driver_hid(void);
|
||||
ucd_t rt_usb_class_driver_hub(void);
|
||||
ucd_t rt_usb_class_driver_storage(void);
|
||||
ucd_t rt_usb_class_driver_adk(void);
|
||||
|
||||
/* usb hid protocal implement */
|
||||
uprotocal_t rt_usbh_hid_protocal_kbd(void);
|
||||
uprotocal_t rt_usbh_hid_protocal_mouse(void);
|
||||
uprotocal_t rt_usb_hid_protocal_kbd(void);
|
||||
uprotocal_t rt_usb_hid_protocal_mouse(void);
|
||||
|
||||
/* usb adk class driver interface */
|
||||
rt_err_t rt_usbh_adk_set_string(const char* manufacturer, const char* model,
|
||||
const char* description, const char* version, const char* uri,
|
||||
const char* serial);
|
||||
rt_err_t rt_usb_adk_set_string(const char *manufacturer,
|
||||
const char *model,
|
||||
const char *description,
|
||||
const char *version,
|
||||
const char *uri,
|
||||
const char *serial);
|
||||
|
||||
/* usb hub interface */
|
||||
rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer,
|
||||
rt_size_t size);
|
||||
rt_err_t rt_usbh_hub_get_status(struct uinstance* device, rt_uint8_t* buffer);
|
||||
rt_err_t rt_usbh_hub_get_port_status(uhub_t uhub, rt_uint16_t port,
|
||||
rt_uint8_t* buffer);
|
||||
rt_err_t rt_usbh_hub_clear_port_feature(uhub_t uhub, rt_uint16_t port,
|
||||
rt_uint16_t feature);
|
||||
rt_err_t rt_usbh_hub_set_port_feature(uhub_t uhub, rt_uint16_t port,
|
||||
rt_uint16_t feature);
|
||||
rt_err_t rt_usbh_hub_reset_port(uhub_t uhub, rt_uint16_t port);
|
||||
rt_err_t rt_usbh_event_signal(struct uhost_msg* msg);
|
||||
rt_err_t rt_usb_hub_get_descriptor(uinst_t uinst,
|
||||
rt_uint8_t *buffer,
|
||||
rt_size_t size);
|
||||
rt_err_t rt_usb_hub_get_status(uinst_t uinst, rt_uint8_t *buffer);
|
||||
rt_err_t rt_usb_hub_get_port_status(uhubinst_t uhub,
|
||||
rt_uint16_t port,
|
||||
rt_uint8_t *buffer);
|
||||
rt_err_t rt_usb_hub_clear_port_feature(uhubinst_t uhub,
|
||||
rt_uint16_t port,
|
||||
rt_uint16_t feature);
|
||||
rt_err_t rt_usb_hub_set_port_feature(uhubinst_t uhub,
|
||||
rt_uint16_t port,
|
||||
rt_uint16_t feature);
|
||||
rt_err_t rt_usb_hub_reset_port(uhubinst_t uhub, rt_uint16_t port);
|
||||
rt_err_t rt_usb_post_event(struct uhost_msg* msg, rt_size_t size);
|
||||
|
||||
/* usb host controller driver interface */
|
||||
rt_inline rt_err_t rt_usb_hcd_alloc_pipe(uhcd_t hcd, upipe_t* pipe,
|
||||
struct uintf* intf, uep_desc_t ep, func_callback callback)
|
||||
rt_inline rt_err_t rt_usb_hcd_alloc_pipe(uhcd_t hcd,
|
||||
upipe_t *pipe,
|
||||
uifinst_t ifinst,
|
||||
uep_desc_t ep,
|
||||
func_callback callback)
|
||||
{
|
||||
if(intf == RT_NULL) return -RT_EIO;
|
||||
if (ifinst == RT_NULL)
|
||||
return -RT_EIO;
|
||||
|
||||
return hcd->ops->alloc_pipe(pipe, intf, ep, callback);
|
||||
return hcd->ops->alloc_pipe(pipe, ifinst, ep, callback);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t rt_usb_hcd_free_pipe(uhcd_t hcd, upipe_t pipe)
|
||||
@@ -240,40 +255,59 @@ rt_inline rt_err_t rt_usb_hcd_free_pipe(uhcd_t hcd, upipe_t pipe)
|
||||
return hcd->ops->free_pipe(pipe);
|
||||
}
|
||||
|
||||
rt_inline int rt_usb_hcd_bulk_xfer(uhcd_t hcd, upipe_t pipe, void* buffer,
|
||||
int nbytes, int timeout)
|
||||
rt_inline int rt_usb_hcd_bulk_xfer(uhcd_t hcd,
|
||||
upipe_t pipe,
|
||||
void *buffer,
|
||||
int nbytes,
|
||||
int timeout)
|
||||
{
|
||||
if(pipe == RT_NULL) return -1;
|
||||
if(pipe->intf == RT_NULL) return -1;
|
||||
if(pipe->intf->device == RT_NULL) return -1;
|
||||
if(pipe->intf->device->status == DEV_STATUS_IDLE)
|
||||
if (pipe == RT_NULL)
|
||||
return -1;
|
||||
if (pipe->ifinst == RT_NULL)
|
||||
return -1;
|
||||
if (pipe->ifinst->uinst == RT_NULL)
|
||||
return -1;
|
||||
if (pipe->ifinst->uinst->status == UINST_STATUS_IDLE)
|
||||
return -1;
|
||||
|
||||
return hcd->ops->bulk_xfer(pipe, buffer, nbytes, timeout);
|
||||
}
|
||||
|
||||
rt_inline int rt_usb_hcd_control_xfer(uhcd_t hcd, struct uinstance* device, ureq_t setup,
|
||||
void* buffer, int nbytes, int timeout)
|
||||
rt_inline int rt_usb_hcd_control_xfer(uhcd_t hcd,
|
||||
uinst_t uinst,
|
||||
ureq_t setup,
|
||||
void *buffer,
|
||||
int nbytes,
|
||||
int timeout)
|
||||
{
|
||||
if(device->status == DEV_STATUS_IDLE) return -1;
|
||||
if (uinst->status == UINST_STATUS_IDLE)
|
||||
return -1;
|
||||
|
||||
return hcd->ops->ctl_xfer(device, setup, buffer, nbytes, timeout);
|
||||
return hcd->ops->ctl_xfer(uinst, setup, buffer, nbytes, timeout);
|
||||
}
|
||||
|
||||
rt_inline int rt_usb_hcd_int_xfer(uhcd_t hcd, upipe_t pipe, void* buffer,
|
||||
int nbytes, int timeout)
|
||||
rt_inline int rt_usb_hcd_int_xfer(uhcd_t hcd,
|
||||
upipe_t pipe,
|
||||
void *buffer,
|
||||
int nbytes,
|
||||
int timeout)
|
||||
{
|
||||
if(pipe == RT_NULL) return -1;
|
||||
if(pipe->intf == RT_NULL) return -1;
|
||||
if(pipe->intf->device == RT_NULL) return -1;
|
||||
if(pipe->intf->device->status == DEV_STATUS_IDLE)
|
||||
if (pipe == RT_NULL)
|
||||
return -1;
|
||||
if (pipe->ifinst == RT_NULL)
|
||||
return -1;
|
||||
if (pipe->ifinst->uinst == RT_NULL)
|
||||
return -1;
|
||||
if (pipe->ifinst->uinst->status == UINST_STATUS_IDLE)
|
||||
return -1;
|
||||
|
||||
return hcd->ops->int_xfer(pipe, buffer, nbytes, timeout);
|
||||
}
|
||||
|
||||
rt_inline rt_err_t rt_usb_hcd_hub_control(uhcd_t hcd, rt_uint16_t port,
|
||||
rt_uint8_t cmd, void *args)
|
||||
rt_inline rt_err_t rt_usb_hcd_hub_control(uhcd_t hcd,
|
||||
rt_uint16_t port,
|
||||
rt_uint8_t cmd,
|
||||
void *args)
|
||||
{
|
||||
return hcd->ops->hub_ctrl(port, cmd, args);
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* File : watchdog.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2012-2014, Shanghai Real-Thread Electronic Technology Co.,Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2012-09-12 heyuanjie87 first version.
|
||||
*/
|
||||
|
||||
#ifndef __WATCHDOG_H__
|
||||
#define __WATCHDOG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#define RT_DEVICE_CTRL_WDT_GET_TIMEOUT (1) /* get timeout(in seconds) */
|
||||
#define RT_DEVICE_CTRL_WDT_SET_TIMEOUT (2) /* set timeout(in seconds) */
|
||||
#define RT_DEVICE_CTRL_WDT_GET_TIMELEFT (3) /* get the left time before reboot(in seconds) */
|
||||
#define RT_DEVICE_CTRL_WDT_KEEPALIVE (4) /* refresh watchdog */
|
||||
#define RT_DEVICE_CTRL_WDT_START (5) /* start watchdog */
|
||||
#define RT_DEVICE_CTRL_WDT_STOP (6) /* stop watchdog */
|
||||
|
||||
struct rt_watchdog_ops;
|
||||
struct rt_watchdog_device
|
||||
{
|
||||
struct rt_device parent;
|
||||
struct rt_watchdog_ops *ops;
|
||||
};
|
||||
typedef struct rt_watchdog_device rt_watchdog_t;
|
||||
|
||||
struct rt_watchdog_ops
|
||||
{
|
||||
rt_err_t (*init)(rt_watchdog_t *wdt);
|
||||
rt_err_t (*control)(rt_watchdog_t *wdt, int cmd, void *arg);
|
||||
};
|
||||
|
||||
rt_err_t rt_hw_watchdog_register(rt_watchdog_t *wdt,
|
||||
const char *name,
|
||||
rt_uint32_t flag,
|
||||
void *data);
|
||||
|
||||
#endif /* __WATCHDOG_H__ */
|
||||
@@ -320,9 +320,5 @@ void rt_data_queue_reset(struct rt_data_queue *queue);
|
||||
#include "drivers/sdio.h"
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_WDT
|
||||
#include "drivers/watchdog.h"
|
||||
#endif
|
||||
|
||||
#endif /* __RT_DEVICE_H__ */
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ if GetDepend('RT_USB_DEVICE_CDC'):
|
||||
if GetDepend('RT_USB_DEVICE_MSTORAGE'):
|
||||
src += Glob('class/mstorage.c')
|
||||
|
||||
if GetDepend('RT_USB_DEVICE_RNDIS'):
|
||||
src += Glob('class/rndis.c')
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_USB_DEVICE'], CPPPATH = CPPPATH)
|
||||
|
||||
@@ -20,56 +20,34 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2012-10-02 Yi Qiu first version
|
||||
* 2012-12-12 heyuanjie87 change endpoints and function handler
|
||||
* 2013-06-25 heyuanjie87 remove SOF mechinism
|
||||
* 2013-07-20 Yi Qiu do more test
|
||||
* 2012-12-12 heyuanjie87 change endpoints and class handler
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtservice.h>
|
||||
#include <rtdevice.h>
|
||||
#include <rthw.h>
|
||||
#include "cdc.h"
|
||||
|
||||
#ifdef RT_USB_DEVICE_CDC
|
||||
|
||||
#define TX_TIMEOUT 100
|
||||
#define CDC_RX_BUFSIZE 2048
|
||||
#define CDC_MAX_PACKET_SIZE 64
|
||||
#define VCOM_DEVICE "vcom"
|
||||
#define CDC_TX_BUFSIZE 2048
|
||||
static rt_uint8_t rx_rbp[CDC_RX_BUFSIZE];
|
||||
static rt_uint8_t tx_rbp[CDC_TX_BUFSIZE];
|
||||
static struct rt_ringbuffer rx_ringbuffer;
|
||||
static struct rt_ringbuffer tx_ringbuffer;
|
||||
static struct serial_ringbuffer vcom_int_rx;
|
||||
|
||||
static struct rt_serial_device vcom_serial;
|
||||
|
||||
#define CDC_MaxPacketSize 64
|
||||
ALIGN(RT_ALIGN_SIZE)
|
||||
static rt_uint8_t vcom_thread_stack[512];
|
||||
static struct rt_thread vcom_thread;
|
||||
#define VCOM_MQ_MSG_SZ 16
|
||||
#define VCOM_MQ_MAX_MSG 4
|
||||
/* internal of the message queue: every message is associated with a pointer,
|
||||
* so in order to recveive VCOM_MQ_MAX_MSG messages, we have to allocate more
|
||||
* than VCOM_MQ_MSG_SZ*VCOM_MQ_MAX_MSG memery. */
|
||||
static rt_uint8_t vcom_tx_thread_mq_pool[(VCOM_MQ_MSG_SZ+sizeof(void*))*VCOM_MQ_MAX_MSG];
|
||||
static struct rt_messagequeue vcom_tx_thread_mq;
|
||||
static struct ucdc_line_coding line_coding;
|
||||
static rt_uint8_t rx_buf[CDC_RX_BUFSIZE];
|
||||
ALIGN(RT_ALIGN_SIZE)
|
||||
static rt_uint8_t tx_buf[CDC_TX_BUFSIZE];
|
||||
|
||||
struct vcom
|
||||
{
|
||||
struct rt_serial_device serial;
|
||||
uep_t ep_out;
|
||||
uep_t ep_in;
|
||||
uep_t ep_cmd;
|
||||
rt_bool_t connected;
|
||||
rt_bool_t in_sending;
|
||||
struct rt_completion wait;
|
||||
rt_uint8_t rx_rbp[CDC_RX_BUFSIZE];
|
||||
struct rt_ringbuffer rx_ringbuffer;
|
||||
struct serial_ringbuffer vcom_int_rx;
|
||||
};
|
||||
|
||||
struct vcom_tx_msg
|
||||
{
|
||||
struct rt_serial_device * serial;
|
||||
const char *buf;
|
||||
rt_size_t size;
|
||||
};
|
||||
volatile static rt_bool_t vcom_connected = RT_FALSE;
|
||||
volatile static rt_bool_t vcom_in_sending = RT_FALSE;
|
||||
|
||||
static struct udevice_descriptor dev_desc =
|
||||
{
|
||||
@@ -79,7 +57,7 @@ static struct udevice_descriptor dev_desc =
|
||||
USB_CLASS_CDC, //bDeviceClass;
|
||||
0x00, //bDeviceSubClass;
|
||||
0x00, //bDeviceProtocol;
|
||||
CDC_MAX_PACKET_SIZE, //bMaxPacketSize0;
|
||||
CDC_MaxPacketSize, //bMaxPacketSize0;
|
||||
_VENDOR_ID, //idVendor;
|
||||
_PRODUCT_ID, //idProduct;
|
||||
USB_BCD_DEVICE, //bcdDevice;
|
||||
@@ -89,18 +67,6 @@ static struct udevice_descriptor dev_desc =
|
||||
USB_DYNAMIC, //bNumConfigurations;
|
||||
};
|
||||
|
||||
static struct usb_qualifier_descriptor dev_qualifier =
|
||||
{
|
||||
sizeof(dev_qualifier),
|
||||
USB_DESC_TYPE_DEVICEQUALIFIER,
|
||||
0x0200,
|
||||
USB_CLASS_CDC,
|
||||
0x00,
|
||||
64,
|
||||
0x01,
|
||||
0,
|
||||
};
|
||||
|
||||
/* communcation interface descriptor */
|
||||
const static struct ucdc_comm_descriptor _comm_desc =
|
||||
{
|
||||
@@ -190,24 +156,18 @@ const static char* _ustring[] =
|
||||
"Language",
|
||||
"RT-Thread Team.",
|
||||
"RTT Virtual Serial",
|
||||
"32021919830108",
|
||||
"1.1.0",
|
||||
"Configuration",
|
||||
"Interface",
|
||||
};
|
||||
static void rt_usb_vcom_init(struct ufunction *func);
|
||||
|
||||
static void _vcom_reset_state(ufunction_t func)
|
||||
static void _vcom_reset_state(void)
|
||||
{
|
||||
struct vcom* data;
|
||||
int lvl;
|
||||
|
||||
RT_ASSERT(func != RT_NULL)
|
||||
|
||||
data = (struct vcom*)func->user_data;
|
||||
|
||||
lvl = rt_hw_interrupt_disable();
|
||||
data->connected = RT_FALSE;
|
||||
data->in_sending = RT_FALSE;
|
||||
int lvl = rt_hw_interrupt_disable();
|
||||
tx_ringbuffer.read_mirror = tx_ringbuffer.read_index = 0;
|
||||
tx_ringbuffer.write_mirror = tx_ringbuffer.write_index = 0;
|
||||
vcom_connected = RT_FALSE;
|
||||
vcom_in_sending = RT_FALSE;
|
||||
/*rt_kprintf("reset USB serial\n", cnt);*/
|
||||
rt_hw_interrupt_enable(lvl);
|
||||
}
|
||||
@@ -215,73 +175,95 @@ static void _vcom_reset_state(ufunction_t func)
|
||||
/**
|
||||
* This function will handle cdc bulk in endpoint request.
|
||||
*
|
||||
* @param func the usb function object.
|
||||
* @param device the usb device object.
|
||||
* @param size request size.
|
||||
*
|
||||
* @return RT_EOK.
|
||||
*/
|
||||
static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size)
|
||||
static rt_err_t _ep_in_handler(udevice_t device, uclass_t cls, rt_size_t size)
|
||||
{
|
||||
struct vcom *data;
|
||||
rt_uint32_t level;
|
||||
rt_uint32_t remain;
|
||||
cdc_eps_t eps;
|
||||
|
||||
RT_ASSERT(func != RT_NULL);
|
||||
eps = (cdc_eps_t)cls->eps;
|
||||
level = rt_hw_interrupt_disable();
|
||||
remain = rt_ringbuffer_data_len(&tx_ringbuffer);
|
||||
if (remain != 0)
|
||||
{
|
||||
/* although vcom_in_sending is set in SOF handler in the very
|
||||
* beginning, we have to guarantee the state is right when start
|
||||
* sending. There is at least one extreme case where we have finished the
|
||||
* last IN transaction but the vcom_in_sending is RT_FALSE.
|
||||
*
|
||||
* Ok, what the extreme case is: pour data into vcom in loop. Open
|
||||
* terminal on the PC, you will see the data. Then close it. So the
|
||||
* data will be sent to the PC in the back. When the buffer of the PC
|
||||
* driver is full. It will not send IN packet to the board and you will
|
||||
* have no chance to clear vcom_in_sending in this function. The data
|
||||
* will fill into the ringbuffer until it is full, and we will reset
|
||||
* the state machine and clear vcom_in_sending. When you open the
|
||||
* terminal on the PC again. The IN packet will appear on the line and
|
||||
* we will, eventually, reach here with vcom_in_sending is clear.
|
||||
*/
|
||||
vcom_in_sending = RT_TRUE;
|
||||
rt_ringbuffer_get(&tx_ringbuffer, eps->ep_in->buffer, remain);
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("_ep_in_handler %d\n", size));
|
||||
/* send data to host */
|
||||
dcd_ep_write(device->dcd, eps->ep_in, eps->ep_in->buffer, remain);
|
||||
|
||||
data = (struct vcom*)func->user_data;
|
||||
if ((size != 0) && (size % CDC_MAX_PACKET_SIZE == 0))
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
if (size != 0 &&
|
||||
(size % CDC_MaxPacketSize) == 0)
|
||||
{
|
||||
/* don't have data right now. Send a zero-length-packet to
|
||||
* terminate the transaction.
|
||||
*
|
||||
* FIXME: actually, this might not be the right place to send zlp.
|
||||
* Only the rt_device_write could know how much data is sending. */
|
||||
data->in_sending = RT_TRUE;
|
||||
|
||||
data->ep_in->request.buffer = RT_NULL;
|
||||
data->ep_in->request.size = 0;
|
||||
data->ep_in->request.req_type = UIO_REQUEST_WRITE;
|
||||
rt_usbd_io_request(func->device, data->ep_in, &data->ep_in->request);
|
||||
|
||||
vcom_in_sending = RT_TRUE;
|
||||
rt_hw_interrupt_enable(level);
|
||||
dcd_ep_write(device->dcd, eps->ep_in, RT_NULL, 0);
|
||||
return RT_EOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
vcom_in_sending = RT_FALSE;
|
||||
rt_hw_interrupt_enable(level);
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
rt_completion_done(&data->wait);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will handle cdc bulk out endpoint request.
|
||||
*
|
||||
* @param func the usb function object.
|
||||
* @param device the usb device object.
|
||||
* @param size request size.
|
||||
*
|
||||
* @return RT_EOK.
|
||||
*/
|
||||
static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size)
|
||||
static rt_err_t _ep_out_handler(udevice_t device, uclass_t cls, rt_size_t size)
|
||||
{
|
||||
rt_uint32_t level;
|
||||
struct vcom *data;
|
||||
cdc_eps_t eps;
|
||||
|
||||
RT_ASSERT(func != RT_NULL);
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("_ep_out_handler %d\n", size));
|
||||
|
||||
data = (struct vcom*)func->user_data;
|
||||
eps = (cdc_eps_t)cls->eps;
|
||||
/* receive data from USB VCOM */
|
||||
level = rt_hw_interrupt_disable();
|
||||
|
||||
rt_ringbuffer_put(&data->rx_ringbuffer, data->ep_out->buffer, size);
|
||||
rt_ringbuffer_put(&rx_ringbuffer, eps->ep_out->buffer, size);
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
||||
/* notify receive data */
|
||||
rt_hw_serial_isr(&data->serial);
|
||||
rt_hw_serial_isr(&vcom_serial);
|
||||
|
||||
data->ep_out->request.buffer = data->ep_out->buffer;
|
||||
data->ep_out->request.size = EP_MAXPACKET(data->ep_out);
|
||||
data->ep_out->request.req_type = UIO_REQUEST_READ_BEST;
|
||||
rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request);
|
||||
dcd_ep_read(device->dcd, eps->ep_out, eps->ep_out->buffer,
|
||||
eps->ep_out->ep_desc->wMaxPacketSize);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -294,9 +276,9 @@ static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size)
|
||||
*
|
||||
* @return RT_EOK.
|
||||
*/
|
||||
static rt_err_t _ep_cmd_handler(ufunction_t func, rt_size_t size)
|
||||
static rt_err_t _ep_cmd_handler(udevice_t device, uclass_t cls, rt_size_t size)
|
||||
{
|
||||
RT_ASSERT(func != RT_NULL);
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("_ep_cmd_handler\n"));
|
||||
|
||||
@@ -319,24 +301,13 @@ static rt_err_t _cdc_get_line_coding(udevice_t device, ureq_t setup)
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(setup != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("_cdc_get_line_coding\n"));
|
||||
|
||||
data.dwDTERate = 115200;
|
||||
data.bCharFormat = 0;
|
||||
data.bDataBits = 8;
|
||||
data.bParityType = 0;
|
||||
size = setup->length > 7 ? 7 : setup->length;
|
||||
|
||||
rt_usbd_ep0_write(device, (void*)&data, size);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t _cdc_set_line_coding_callback(udevice_t device, rt_size_t size)
|
||||
{
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("_cdc_set_line_coding_callback\n"));
|
||||
|
||||
dcd_ep0_send_status(device->dcd);
|
||||
dcd_ep_write(device->dcd, 0, (void*)&data, size);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -351,13 +322,21 @@ static rt_err_t _cdc_set_line_coding_callback(udevice_t device, rt_size_t size)
|
||||
*/
|
||||
static rt_err_t _cdc_set_line_coding(udevice_t device, ureq_t setup)
|
||||
{
|
||||
struct ucdc_line_coding data;
|
||||
rt_err_t ret;
|
||||
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(setup != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("_cdc_set_line_coding\n"));
|
||||
rt_completion_init(&device->dcd->completion);
|
||||
|
||||
rt_usbd_ep0_read(device, (void*)&line_coding, sizeof(struct ucdc_line_coding),
|
||||
_cdc_set_line_coding_callback);
|
||||
dcd_ep_read(device->dcd, 0, (void*)&data, setup->length);
|
||||
|
||||
ret = rt_completion_wait(&device->dcd->completion, 100);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("_cdc_set_line_coding timeout\n");
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -370,16 +349,11 @@ static rt_err_t _cdc_set_line_coding(udevice_t device, ureq_t setup)
|
||||
*
|
||||
* @return RT_EOK on successful.
|
||||
*/
|
||||
static rt_err_t _interface_handler(ufunction_t func, ureq_t setup)
|
||||
static rt_err_t _interface_handler(udevice_t device, uclass_t cls, ureq_t setup)
|
||||
{
|
||||
struct vcom *data;
|
||||
|
||||
RT_ASSERT(func != RT_NULL);
|
||||
RT_ASSERT(func->device != RT_NULL);
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(setup != RT_NULL);
|
||||
|
||||
data = (struct vcom*)func->user_data;
|
||||
|
||||
switch(setup->request)
|
||||
{
|
||||
case CDC_SEND_ENCAPSULATED_COMMAND:
|
||||
@@ -393,14 +367,14 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup)
|
||||
case CDC_CLEAR_COMM_FEATURE:
|
||||
break;
|
||||
case CDC_SET_LINE_CODING:
|
||||
_cdc_set_line_coding(func->device, setup);
|
||||
data->connected = RT_TRUE;
|
||||
_cdc_set_line_coding(device, setup);
|
||||
vcom_connected = RT_TRUE;
|
||||
break;
|
||||
case CDC_GET_LINE_CODING:
|
||||
_cdc_get_line_coding(func->device, setup);
|
||||
_cdc_get_line_coding(device, setup);
|
||||
break;
|
||||
case CDC_SET_CONTROL_LINE_STATE:
|
||||
dcd_ep0_send_status(func->device->dcd);
|
||||
dcd_send_status(device->dcd);
|
||||
break;
|
||||
case CDC_SEND_BREAK:
|
||||
break;
|
||||
@@ -413,66 +387,92 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup)
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will run cdc function, it will be called on handle set configuration request.
|
||||
* This function will run cdc class, it will be called on handle set configuration request.
|
||||
*
|
||||
* @param func the usb function object.
|
||||
* @param device the usb device object.
|
||||
*
|
||||
* @return RT_EOK on successful.
|
||||
*/
|
||||
static rt_err_t _function_enable(ufunction_t func)
|
||||
static rt_err_t _class_run(udevice_t device, uclass_t cls)
|
||||
{
|
||||
struct vcom *data;
|
||||
cdc_eps_t eps;
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
|
||||
RT_ASSERT(func != RT_NULL);
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("cdc class run\n"));
|
||||
eps = (cdc_eps_t)cls->eps;
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("cdc function enable\n"));
|
||||
eps->ep_in->buffer = tx_buf;
|
||||
eps->ep_out->buffer = rx_buf;
|
||||
|
||||
_vcom_reset_state(func);
|
||||
_vcom_reset_state();
|
||||
|
||||
data = (struct vcom*)func->user_data;
|
||||
data->ep_out->buffer = rt_malloc(CDC_RX_BUFSIZE);
|
||||
|
||||
data->ep_out->request.buffer = data->ep_out->buffer;
|
||||
data->ep_out->request.size = EP_MAXPACKET(data->ep_out);
|
||||
|
||||
data->ep_out->request.req_type = UIO_REQUEST_READ_BEST;
|
||||
rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request);
|
||||
dcd_ep_read(device->dcd, eps->ep_out, eps->ep_out->buffer,
|
||||
eps->ep_out->ep_desc->wMaxPacketSize);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will stop cdc function, it will be called on handle set configuration request.
|
||||
* This function will stop cdc class, it will be called on handle set configuration request.
|
||||
*
|
||||
* @param func the usb function object.
|
||||
* @param device the usb device object.
|
||||
*
|
||||
* @return RT_EOK on successful.
|
||||
*/
|
||||
static rt_err_t _function_disable(ufunction_t func)
|
||||
static rt_err_t _class_stop(udevice_t device, uclass_t cls)
|
||||
{
|
||||
struct vcom *data;
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
|
||||
RT_ASSERT(func != RT_NULL);
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("cdc class stop\n"));
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("cdc function disable\n"));
|
||||
|
||||
_vcom_reset_state(func);
|
||||
|
||||
data = (struct vcom*)func->user_data;
|
||||
if(data->ep_out->buffer != RT_NULL)
|
||||
{
|
||||
rt_free(data->ep_out->buffer);
|
||||
data->ep_out->buffer = RT_NULL;
|
||||
}
|
||||
_vcom_reset_state();
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static struct ufunction_ops ops =
|
||||
/**
|
||||
* This function will handle system sof event.
|
||||
*
|
||||
* @param device the usb device object.
|
||||
*
|
||||
* @return RT_EOK on successful.
|
||||
*/
|
||||
static rt_err_t _class_sof_handler(udevice_t device, uclass_t cls)
|
||||
{
|
||||
_function_enable,
|
||||
_function_disable,
|
||||
RT_NULL,
|
||||
rt_uint32_t level;
|
||||
rt_size_t size;
|
||||
cdc_eps_t eps;
|
||||
|
||||
if (vcom_connected != RT_TRUE)
|
||||
return -RT_ERROR;
|
||||
|
||||
if (vcom_in_sending)
|
||||
{
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
eps = (cdc_eps_t)cls->eps;
|
||||
|
||||
size = rt_ringbuffer_data_len(&tx_ringbuffer);
|
||||
if (size == 0)
|
||||
return -RT_EFULL;
|
||||
|
||||
level = rt_hw_interrupt_disable();
|
||||
rt_ringbuffer_get(&tx_ringbuffer, eps->ep_in->buffer, size);
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
||||
/* send data to host */
|
||||
vcom_in_sending = RT_TRUE;
|
||||
dcd_ep_write(device->dcd, eps->ep_in, eps->ep_in->buffer, size);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static struct uclass_ops ops =
|
||||
{
|
||||
_class_run,
|
||||
_class_stop,
|
||||
_class_sof_handler,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -483,8 +483,7 @@ static struct ufunction_ops ops =
|
||||
*
|
||||
* @return RT_EOK on successful.
|
||||
*/
|
||||
static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm,
|
||||
rt_uint8_t cintf_nr, ucdc_data_desc_t data, rt_uint8_t dintf_nr)
|
||||
static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, rt_uint8_t cintf_nr, ucdc_data_desc_t data, rt_uint8_t dintf_nr)
|
||||
{
|
||||
comm->call_mgmt_desc.data_interface = dintf_nr;
|
||||
comm->union_desc.master_interface = cintf_nr;
|
||||
@@ -497,16 +496,16 @@ static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm,
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will create a cdc function instance.
|
||||
* This function will create a cdc class instance.
|
||||
*
|
||||
* @param device the usb device object.
|
||||
*
|
||||
* @return RT_EOK on successful.
|
||||
*/
|
||||
ufunction_t rt_usbd_function_cdc_create(udevice_t device)
|
||||
uclass_t rt_usbd_class_cdc_create(udevice_t device)
|
||||
{
|
||||
ufunction_t func;
|
||||
struct vcom* data;
|
||||
uclass_t cdc;
|
||||
cdc_eps_t eps;
|
||||
uintf_t intf_comm, intf_data;
|
||||
ualtsetting_t comm_setting, data_setting;
|
||||
ucdc_data_desc_t data_desc;
|
||||
@@ -517,26 +516,19 @@ ufunction_t rt_usbd_function_cdc_create(udevice_t device)
|
||||
|
||||
/* set usb device string description */
|
||||
rt_usbd_device_set_string(device, _ustring);
|
||||
|
||||
/* create a cdc function */
|
||||
func = rt_usbd_function_new(device, &dev_desc, &ops);
|
||||
rt_usbd_device_set_qualifier(device, &dev_qualifier);
|
||||
|
||||
/* allocate memory for cdc vcom data */
|
||||
data = (struct vcom*)rt_malloc(sizeof(struct vcom));
|
||||
rt_memset(data, 0, sizeof(struct vcom));
|
||||
func->user_data = (void*)data;
|
||||
|
||||
/* initilize vcom */
|
||||
rt_usb_vcom_init(func);
|
||||
/* create a cdc class */
|
||||
cdc = rt_usbd_class_create(device, &dev_desc, &ops);
|
||||
/* create a cdc class endpoints collection */
|
||||
eps = rt_malloc(sizeof(struct cdc_eps));
|
||||
cdc->eps = (void*)eps;
|
||||
|
||||
/* create a cdc communication interface and a cdc data interface */
|
||||
intf_comm = rt_usbd_interface_new(device, _interface_handler);
|
||||
intf_data = rt_usbd_interface_new(device, _interface_handler);
|
||||
intf_comm = rt_usbd_interface_create(device, _interface_handler);
|
||||
intf_data = rt_usbd_interface_create(device, _interface_handler);
|
||||
|
||||
/* create a communication alternate setting and a data alternate setting */
|
||||
comm_setting = rt_usbd_altsetting_new(sizeof(struct ucdc_comm_descriptor));
|
||||
data_setting = rt_usbd_altsetting_new(sizeof(struct ucdc_data_descriptor));
|
||||
comm_setting = rt_usbd_altsetting_create(sizeof(struct ucdc_comm_descriptor));
|
||||
data_setting = rt_usbd_altsetting_create(sizeof(struct ucdc_data_descriptor));
|
||||
|
||||
/* config desc in alternate setting */
|
||||
rt_usbd_altsetting_config_descriptor(comm_setting, &_comm_desc,
|
||||
@@ -545,39 +537,39 @@ ufunction_t rt_usbd_function_cdc_create(udevice_t device)
|
||||
/* configure the cdc interface descriptor */
|
||||
_cdc_descriptor_config(comm_setting->desc, intf_comm->intf_num, data_setting->desc, intf_data->intf_num);
|
||||
|
||||
/* create a command endpoint */
|
||||
comm_desc = (ucdc_comm_desc_t)comm_setting->desc;
|
||||
data->ep_cmd = rt_usbd_endpoint_new(&comm_desc->ep_desc, _ep_cmd_handler);
|
||||
|
||||
/* add the command endpoint to the cdc communication interface */
|
||||
rt_usbd_altsetting_add_endpoint(comm_setting, data->ep_cmd);
|
||||
|
||||
/* add the communication alternate setting to the communication interface,
|
||||
then set default setting of the interface */
|
||||
rt_usbd_interface_add_altsetting(intf_comm, comm_setting);
|
||||
rt_usbd_set_altsetting(intf_comm, 0);
|
||||
|
||||
/* add the communication interface to the cdc function */
|
||||
rt_usbd_function_add_interface(func, intf_comm);
|
||||
|
||||
/* create a bulk in and a bulk endpoint */
|
||||
data_desc = (ucdc_data_desc_t)data_setting->desc;
|
||||
data->ep_out = rt_usbd_endpoint_new(&data_desc->ep_out_desc, _ep_out_handler);
|
||||
data->ep_in = rt_usbd_endpoint_new(&data_desc->ep_in_desc, _ep_in_handler);
|
||||
eps->ep_out = rt_usbd_endpoint_create(&data_desc->ep_out_desc, _ep_out_handler);
|
||||
eps->ep_in = rt_usbd_endpoint_create(&data_desc->ep_in_desc, _ep_in_handler);
|
||||
|
||||
/* add the bulk out and bulk in endpoints to the data alternate setting */
|
||||
rt_usbd_altsetting_add_endpoint(data_setting, data->ep_in);
|
||||
rt_usbd_altsetting_add_endpoint(data_setting, data->ep_out);
|
||||
rt_usbd_altsetting_add_endpoint(data_setting, eps->ep_in);
|
||||
rt_usbd_altsetting_add_endpoint(data_setting, eps->ep_out);
|
||||
|
||||
/* add the data alternate setting to the data interface
|
||||
then set default setting of the interface */
|
||||
rt_usbd_interface_add_altsetting(intf_data, data_setting);
|
||||
rt_usbd_set_altsetting(intf_data, 0);
|
||||
|
||||
/* add the cdc data interface to cdc function */
|
||||
rt_usbd_function_add_interface(func, intf_data);
|
||||
/* add the cdc data interface to cdc class */
|
||||
rt_usbd_class_add_interface(cdc, intf_data);
|
||||
|
||||
return func;
|
||||
/* create a command endpoint */
|
||||
comm_desc = (ucdc_comm_desc_t)comm_setting->desc;
|
||||
eps->ep_cmd = rt_usbd_endpoint_create(&comm_desc->ep_desc, _ep_cmd_handler);
|
||||
|
||||
/* add the command endpoint to the cdc communication interface */
|
||||
rt_usbd_altsetting_add_endpoint(comm_setting, eps->ep_cmd);
|
||||
|
||||
/* add the communication alternate setting to the communication interface,
|
||||
then set default setting of the interface */
|
||||
rt_usbd_interface_add_altsetting(intf_comm, comm_setting);
|
||||
rt_usbd_set_altsetting(intf_comm, 0);
|
||||
|
||||
/* add the communication interface to the cdc class */
|
||||
rt_usbd_class_add_interface(cdc, intf_comm);
|
||||
|
||||
return cdc;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -605,106 +597,80 @@ static rt_err_t _vcom_control(struct rt_serial_device *serial,
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static int _vcom_putc(struct rt_serial_device *serial, char c)
|
||||
{
|
||||
rt_uint32_t level;
|
||||
int cnt;
|
||||
|
||||
if (vcom_connected != RT_TRUE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* if the buffer is full, there is a chance that the host would pull some
|
||||
* data out soon. But we cannot rely on that and if we wait to long, just
|
||||
* return. */
|
||||
for (cnt = 500;
|
||||
rt_ringbuffer_space_len(&tx_ringbuffer) == 0 && cnt;
|
||||
cnt--)
|
||||
{
|
||||
/*rt_kprintf("wait for %d\n", cnt);*/
|
||||
if (vcom_connected != RT_TRUE)
|
||||
return 0;
|
||||
}
|
||||
if (cnt == 0)
|
||||
{
|
||||
/* OK, we believe that the connection is lost. So don't send any more
|
||||
* data and act as the USB cable is not plugged in. Reset the VCOM
|
||||
* state machine */
|
||||
_vcom_reset_state();
|
||||
return 0;
|
||||
}
|
||||
|
||||
level = rt_hw_interrupt_disable();
|
||||
if (rt_ringbuffer_space_len(&tx_ringbuffer))
|
||||
{
|
||||
rt_ringbuffer_putchar(&tx_ringbuffer, c);
|
||||
}
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _vcom_getc(struct rt_serial_device *serial)
|
||||
{
|
||||
int result;
|
||||
rt_uint8_t ch;
|
||||
rt_uint32_t level;
|
||||
struct ufunction *func;
|
||||
struct vcom *data;
|
||||
|
||||
func = (struct ufunction*)serial->parent.user_data;
|
||||
data = (struct vcom*)func->user_data;
|
||||
|
||||
result = -1;
|
||||
|
||||
level = rt_hw_interrupt_disable();
|
||||
|
||||
if(rt_ringbuffer_getchar(&data->rx_ringbuffer, &ch) != 0)
|
||||
if (rt_ringbuffer_data_len(&rx_ringbuffer))
|
||||
{
|
||||
rt_ringbuffer_getchar(&rx_ringbuffer, &ch);
|
||||
result = ch;
|
||||
}
|
||||
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static rt_size_t _vcom_tx(struct rt_serial_device *serial,
|
||||
const char *buf, rt_size_t size)
|
||||
{
|
||||
struct vcom_tx_msg msg;
|
||||
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
RT_ASSERT(buf != RT_NULL);
|
||||
|
||||
msg.buf = buf;
|
||||
msg.serial = serial;
|
||||
msg.size = size;
|
||||
|
||||
if (rt_mq_send(&vcom_tx_thread_mq, (void*)&msg,
|
||||
sizeof(struct vcom_tx_msg)) != RT_EOK)
|
||||
{
|
||||
rt_kprintf("vcom send msg fail\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static const struct rt_uart_ops usb_vcom_ops =
|
||||
{
|
||||
_vcom_configure,
|
||||
_vcom_control,
|
||||
RT_NULL,
|
||||
_vcom_putc,
|
||||
_vcom_getc,
|
||||
RT_NULL,
|
||||
//_vcom_tx,
|
||||
};
|
||||
|
||||
/* Vcom Tx Thread */
|
||||
static void vcom_tx_thread_entry(void* parameter)
|
||||
void rt_usb_vcom_init(void)
|
||||
{
|
||||
struct vcom_tx_msg msg;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (rt_mq_recv(&vcom_tx_thread_mq, (void*)&msg,
|
||||
sizeof(struct vcom_tx_msg), RT_WAITING_FOREVER) == RT_EOK)
|
||||
{
|
||||
struct ufunction *func;
|
||||
struct vcom *data;
|
||||
|
||||
func = (struct ufunction*)msg.serial->parent.user_data;
|
||||
data = (struct vcom*)func->user_data;
|
||||
if (!data->connected)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
rt_completion_init(&data->wait);
|
||||
|
||||
data->ep_in->request.buffer = (void*)msg.buf;
|
||||
data->ep_in->request.size = msg.size;
|
||||
data->ep_in->request.req_type = UIO_REQUEST_WRITE;
|
||||
rt_usbd_io_request(func->device, data->ep_in, &data->ep_in->request);
|
||||
|
||||
if (rt_completion_wait(&data->wait, TX_TIMEOUT) != RT_EOK)
|
||||
{
|
||||
rt_kprintf("vcom tx timeout\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void rt_usb_vcom_init(struct ufunction *func)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
struct serial_configure config;
|
||||
struct vcom *data = (struct vcom*)func->user_data;
|
||||
|
||||
/* initialize ring buffer */
|
||||
rt_ringbuffer_init(&data->rx_ringbuffer, data->rx_rbp, CDC_RX_BUFSIZE);
|
||||
rt_ringbuffer_init(&rx_ringbuffer, rx_rbp, CDC_RX_BUFSIZE);
|
||||
rt_ringbuffer_init(&tx_ringbuffer, tx_rbp, CDC_TX_BUFSIZE);
|
||||
|
||||
config.baud_rate = BAUD_RATE_115200;
|
||||
config.bit_order = BIT_ORDER_LSB;
|
||||
@@ -713,25 +679,14 @@ static void rt_usb_vcom_init(struct ufunction *func)
|
||||
config.stop_bits = STOP_BITS_1;
|
||||
config.invert = NRZ_NORMAL;
|
||||
|
||||
data->serial.ops = &usb_vcom_ops;
|
||||
data->serial.int_rx = &data->vcom_int_rx;
|
||||
data->serial.config = config;
|
||||
vcom_serial.ops = &usb_vcom_ops;
|
||||
vcom_serial.int_rx = &vcom_int_rx;
|
||||
vcom_serial.config = config;
|
||||
|
||||
/* register vcom device */
|
||||
rt_hw_serial_register(&data->serial, VCOM_DEVICE,
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_INT_TX,
|
||||
func);
|
||||
|
||||
/* create an vcom message queue */
|
||||
rt_mq_init(&vcom_tx_thread_mq, "vcomq", vcom_tx_thread_mq_pool, VCOM_MQ_MSG_SZ,
|
||||
sizeof(vcom_tx_thread_mq_pool), RT_IPC_FLAG_FIFO);
|
||||
|
||||
/* init usb device thread */
|
||||
rt_thread_init(&vcom_thread, "vcom", vcom_tx_thread_entry, RT_NULL,
|
||||
vcom_thread_stack, 512, 8, 20);
|
||||
result = rt_thread_startup(&vcom_thread);
|
||||
RT_ASSERT(result == RT_EOK);
|
||||
rt_hw_serial_register(&vcom_serial, "vcom",
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
|
||||
RT_NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,13 @@ struct request_sense_data
|
||||
rt_uint8_t Reserved4[4];
|
||||
}request_sense_data_t;
|
||||
|
||||
struct mass_eps
|
||||
{
|
||||
uep_t ep_in;
|
||||
uep_t ep_out;
|
||||
};
|
||||
typedef struct mass_eps* mass_eps_t;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,15 +28,13 @@
|
||||
|
||||
#ifdef RT_USING_USB_DEVICE
|
||||
|
||||
#define USB_DEVICE_CONTROLLER_NAME "usbd"
|
||||
|
||||
#ifdef RT_USB_DEVICE_COMPOSITE
|
||||
const static char* ustring[] =
|
||||
{
|
||||
"Language",
|
||||
"RT-Thread Team.",
|
||||
"RTT Composite Device",
|
||||
"320219198301",
|
||||
"1.1.0",
|
||||
"Configuration",
|
||||
"Interface",
|
||||
};
|
||||
@@ -62,54 +60,54 @@ static struct udevice_descriptor compsit_desc =
|
||||
};
|
||||
#endif
|
||||
|
||||
rt_err_t rt_usb_device_init(void)
|
||||
rt_err_t rt_usb_device_init(const char* udc_name)
|
||||
{
|
||||
rt_device_t udc;
|
||||
udevice_t udevice;
|
||||
uconfig_t cfg;
|
||||
ufunction_t func;
|
||||
uclass_t cls;
|
||||
|
||||
RT_ASSERT(udc_name != RT_NULL);
|
||||
|
||||
udc = rt_device_find(udc_name);
|
||||
if(udc == RT_NULL)
|
||||
{
|
||||
rt_kprintf("can't find usb device controller %s\n", udc_name);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* create and startup usb device thread */
|
||||
rt_usbd_core_init();
|
||||
|
||||
/* create a device object */
|
||||
udevice = rt_usbd_device_new();
|
||||
|
||||
udc = rt_device_find(USB_DEVICE_CONTROLLER_NAME);
|
||||
if(udc == RT_NULL)
|
||||
{
|
||||
rt_kprintf("can't find usb device controller %s\n", USB_DEVICE_CONTROLLER_NAME);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
udevice = rt_usbd_device_create();
|
||||
|
||||
/* set usb controller driver to the device */
|
||||
rt_usbd_device_set_controller(udevice, (udcd_t)udc);
|
||||
|
||||
/* create a configuration object */
|
||||
cfg = rt_usbd_config_new();
|
||||
cfg = rt_usbd_config_create();
|
||||
|
||||
#ifdef RT_USB_DEVICE_MSTORAGE
|
||||
/* create a mass storage function object */
|
||||
func = rt_usbd_function_mstorage_create(udevice);
|
||||
/* create a mass storage class object */
|
||||
cls = rt_usbd_class_mstorage_create(udevice);
|
||||
|
||||
/* add the function to the configuration */
|
||||
rt_usbd_config_add_function(cfg, func);
|
||||
/* add the class to the configuration */
|
||||
rt_usbd_config_add_class(cfg, cls);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USB_DEVICE_CDC
|
||||
/* create a cdc function object */
|
||||
func = rt_usbd_function_cdc_create(udevice);
|
||||
/* create a cdc class object */
|
||||
cls = rt_usbd_class_cdc_create(udevice);
|
||||
|
||||
/* add the function to the configuration */
|
||||
rt_usbd_config_add_function(cfg, func);
|
||||
/* add the class to the configuration */
|
||||
rt_usbd_config_add_class(cfg, cls);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USB_DEVICE_RNDIS
|
||||
/* create a rndis function object */
|
||||
func = rt_usbd_function_rndis_create(udevice);
|
||||
/* create a rndis class object */
|
||||
cls = rt_usbd_class_rndis_create(udevice);
|
||||
|
||||
/* add the function to the configuration */
|
||||
rt_usbd_config_add_function(cfg, func);
|
||||
/* add the class to the configuration */
|
||||
rt_usbd_config_add_class(cfg, cls);
|
||||
#endif
|
||||
|
||||
/* set device descriptor to the device */
|
||||
@@ -117,18 +115,18 @@ rt_err_t rt_usb_device_init(void)
|
||||
rt_usbd_device_set_descriptor(udevice, &compsit_desc);
|
||||
rt_usbd_device_set_string(udevice, ustring);
|
||||
#else
|
||||
rt_usbd_device_set_descriptor(udevice, func->dev_desc);
|
||||
rt_usbd_device_set_descriptor(udevice, cls->dev_desc);
|
||||
#endif
|
||||
|
||||
/* add the configuration to the device */
|
||||
rt_usbd_device_add_config(udevice, cfg);
|
||||
|
||||
/* initialize usb device controller */
|
||||
rt_device_init(udc);
|
||||
|
||||
/* set default configuration to 1 */
|
||||
rt_usbd_set_config(udevice, 1);
|
||||
|
||||
/* initialize usb device controller */
|
||||
rt_device_init(udc);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,22 +9,22 @@ core/usbhost.c
|
||||
core/hub.c
|
||||
""")
|
||||
|
||||
if GetDepend('RT_USBH_ADK'):
|
||||
if GetDepend('RT_USB_CLASS_ADK'):
|
||||
src += Glob('class/adk.c')
|
||||
src += Glob('class/adkapp.c')
|
||||
src += Glob('udev/adkapp.c')
|
||||
|
||||
if GetDepend('RT_USBH_MSTORAGE'):
|
||||
if GetDepend('RT_USB_CLASS_MASS_STORAGE'):
|
||||
src += Glob('class/mass.c')
|
||||
src += Glob('class/udisk.c')
|
||||
src += Glob('udev/udisk.c')
|
||||
|
||||
if GetDepend('RT_USBH_HID'):
|
||||
if GetDepend('RT_USB_CLASS_HID'):
|
||||
src += Glob('class/hid.c')
|
||||
|
||||
if GetDepend('RT_USBH_HID_MOUSE'):
|
||||
src += Glob('class/umouse.c')
|
||||
if GetDepend('RT_USB_HID_MOUSE'):
|
||||
src += Glob('udev/umouse.c')
|
||||
|
||||
if GetDepend('RT_USBH_HID_KEYBOARD'):
|
||||
src += Glob('class/ukbd.c')
|
||||
if GetDepend('RT_USB_HID_KEYBOARD'):
|
||||
src += Glob('udev/ukbd.c')
|
||||
|
||||
CPPPATH = [cwd, cwd + '/class', cwd + '/core', \
|
||||
cwd + '/include', cwd + '../../../include']
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <drivers/usb_host.h>
|
||||
#include "adk.h"
|
||||
|
||||
#ifdef RT_USBH_ADK
|
||||
#ifdef RT_USB_CLASS_ADK
|
||||
|
||||
static struct uclass_driver adk_driver;
|
||||
static const char* _adk_manufacturer = RT_NULL;
|
||||
@@ -36,7 +36,7 @@ static const char* _adk_version = RT_NULL;
|
||||
static const char* _adk_uri = RT_NULL;
|
||||
static const char* _adk_serial = RT_NULL;
|
||||
|
||||
rt_err_t rt_usbh_adk_set_string(const char* manufacturer, const char* model,
|
||||
rt_err_t rt_usb_adk_set_string(const char* manufacturer, const char* model,
|
||||
const char* description, const char* _version, const char* uri,
|
||||
const char* serial)
|
||||
{
|
||||
@@ -53,29 +53,29 @@ rt_err_t rt_usbh_adk_set_string(const char* manufacturer, const char* model,
|
||||
#ifdef RT_USING_MODULE
|
||||
#include <rtm.h>
|
||||
|
||||
RTM_EXPORT(rt_usbh_adk_set_string);
|
||||
RTM_EXPORT(rt_usb_adk_set_string);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This function will do USB_REQ_GET_PROTOCOL request to set idle period to the usb adk device
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @duration the idle period of requesting data.
|
||||
* @report_id the report id
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_adk_get_protocol(struct uintf* intf, rt_uint16_t *protocol)
|
||||
static rt_err_t rt_usb_adk_get_protocol(uifinst_t ifinst, rt_uint16_t *protocol)
|
||||
{
|
||||
struct ureqest setup;
|
||||
uinst_t device;
|
||||
uinst_t uinst;
|
||||
int timeout = 100;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(intf != RT_NULL);
|
||||
RT_ASSERT(intf->device != RT_NULL);
|
||||
RT_ASSERT(ifinst != RT_NULL);
|
||||
RT_ASSERT(ifinst->uinst != RT_NULL);
|
||||
|
||||
device = intf->device;
|
||||
uinst = ifinst->uinst;
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_VENDOR |
|
||||
USB_REQ_TYPE_DEVICE;
|
||||
@@ -84,7 +84,7 @@ static rt_err_t rt_usbh_adk_get_protocol(struct uintf* intf, rt_uint16_t *protoc
|
||||
setup.length = 2;
|
||||
setup.value = 0;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, (void*)protocol, 2,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, (void*)protocol, 2,
|
||||
timeout) == 0) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -92,24 +92,24 @@ static rt_err_t rt_usbh_adk_get_protocol(struct uintf* intf, rt_uint16_t *protoc
|
||||
/**
|
||||
* This function will do USB_REQ_SEND_STRING request to set idle period to the usb adk device
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @duration the idle period of requesting data.
|
||||
* @report_id the report id
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_adk_send_string(struct uintf* intf, rt_uint16_t index,
|
||||
static rt_err_t rt_usb_adk_send_string(uifinst_t ifinst, rt_uint16_t index,
|
||||
const char* str)
|
||||
{
|
||||
struct ureqest setup;
|
||||
uinst_t device;
|
||||
uinst_t uinst;
|
||||
int timeout = 100;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(intf != RT_NULL);
|
||||
RT_ASSERT(intf->device != RT_NULL);
|
||||
RT_ASSERT(ifinst != RT_NULL);
|
||||
RT_ASSERT(ifinst->uinst != RT_NULL);
|
||||
|
||||
device = intf->device;
|
||||
uinst = ifinst->uinst;
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_VENDOR |
|
||||
USB_REQ_TYPE_DEVICE;
|
||||
@@ -118,7 +118,7 @@ static rt_err_t rt_usbh_adk_send_string(struct uintf* intf, rt_uint16_t index,
|
||||
setup.length = rt_strlen(str) + 1;
|
||||
setup.value = 0;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, (void*)str,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, (void*)str,
|
||||
rt_strlen(str) + 1, timeout) == 0) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -126,23 +126,23 @@ static rt_err_t rt_usbh_adk_send_string(struct uintf* intf, rt_uint16_t index,
|
||||
/**
|
||||
* This function will do USB_REQ_START request to set idle period to the usb adk device
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @duration the idle period of requesting data.
|
||||
* @report_id the report id
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_adk_start(struct uintf* intf)
|
||||
static rt_err_t rt_usb_adk_start(uifinst_t ifinst)
|
||||
{
|
||||
struct ureqest setup;
|
||||
uinst_t device;
|
||||
uinst_t uinst;
|
||||
int timeout = 100;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(intf != RT_NULL);
|
||||
RT_ASSERT(intf->device != RT_NULL);
|
||||
RT_ASSERT(ifinst != RT_NULL);
|
||||
RT_ASSERT(ifinst->uinst != RT_NULL);
|
||||
|
||||
device = intf->device;
|
||||
uinst = ifinst->uinst;
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_VENDOR |
|
||||
USB_REQ_TYPE_DEVICE;
|
||||
@@ -151,7 +151,7 @@ static rt_err_t rt_usbh_adk_start(struct uintf* intf)
|
||||
setup.length = 0;
|
||||
setup.value = 0;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, RT_NULL, 0,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, RT_NULL, 0,
|
||||
timeout) == 0) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -159,25 +159,25 @@ static rt_err_t rt_usbh_adk_start(struct uintf* intf)
|
||||
/**
|
||||
* This function will read data from usb adk device
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_size_t rt_usbh_adk_read(rt_device_t device, rt_off_t pos, void* buffer,
|
||||
static rt_size_t rt_usb_adk_read(rt_device_t device, rt_off_t pos, void* buffer,
|
||||
rt_size_t size)
|
||||
{
|
||||
uadk_t adk;
|
||||
uadkinst_t adkinst;
|
||||
rt_size_t length;
|
||||
struct uintf* intf;
|
||||
uifinst_t ifinst;
|
||||
|
||||
/* check parameter */
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(buffer != RT_NULL);
|
||||
|
||||
intf = (struct uintf*)device->user_data;
|
||||
adk = (uadk_t)intf->user_data;
|
||||
ifinst = (uifinst_t)device->user_data;
|
||||
adkinst = (uadkinst_t)ifinst->user_data;
|
||||
|
||||
length = rt_usb_hcd_bulk_xfer(intf->device->hcd, adk->pipe_in,
|
||||
length = rt_usb_hcd_bulk_xfer(ifinst->uinst->hcd, adkinst->pipe_in,
|
||||
buffer, size, 300);
|
||||
|
||||
return length;
|
||||
@@ -187,23 +187,23 @@ static rt_size_t rt_usbh_adk_read(rt_device_t device, rt_off_t pos, void* buffer
|
||||
/**
|
||||
* This function will write data to usb adk device
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_size_t rt_usbh_adk_write (rt_device_t device, rt_off_t pos, const void* buffer,
|
||||
static rt_size_t rt_usb_adk_write (rt_device_t device, rt_off_t pos, const void* buffer,
|
||||
rt_size_t size)
|
||||
{
|
||||
uadk_t adk;
|
||||
uadkinst_t adkinst;
|
||||
rt_size_t length;
|
||||
struct uintf* intf;
|
||||
uifinst_t ifinst;
|
||||
|
||||
RT_ASSERT(buffer != RT_NULL);
|
||||
|
||||
intf = (struct uintf*)device->user_data;
|
||||
adk = (uadk_t)intf->user_data;
|
||||
ifinst = (uifinst_t)device->user_data;
|
||||
adkinst = (uadkinst_t)ifinst->user_data;
|
||||
|
||||
length = rt_usb_hcd_bulk_xfer(intf->device->hcd, adk->pipe_out,
|
||||
length = rt_usb_hcd_bulk_xfer(ifinst->uinst->hcd, adkinst->pipe_out,
|
||||
(void*)buffer, size, 300);
|
||||
|
||||
return length;
|
||||
@@ -217,30 +217,30 @@ static rt_size_t rt_usbh_adk_write (rt_device_t device, rt_off_t pos, const void
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_adk_enable(void* arg)
|
||||
static rt_err_t rt_usb_adk_run(void* arg)
|
||||
{
|
||||
int i = 0;
|
||||
uadk_t adk;
|
||||
struct uintf* intf = (struct uintf*)arg;
|
||||
uadkinst_t adkinst;
|
||||
uifinst_t ifinst = (uifinst_t)arg;
|
||||
udev_desc_t dev_desc;
|
||||
rt_uint16_t protocol;
|
||||
rt_err_t ret;
|
||||
|
||||
/* parameter check */
|
||||
if(intf == RT_NULL)
|
||||
if(ifinst == RT_NULL)
|
||||
{
|
||||
rt_kprintf("the interface is not available\n");
|
||||
return -RT_EIO;
|
||||
}
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_adk_run\n"));
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usb_adk_run\n"));
|
||||
|
||||
dev_desc = &intf->device->dev_desc;
|
||||
dev_desc = &ifinst->uinst->dev_desc;
|
||||
if(dev_desc->idVendor == USB_ACCESSORY_VENDOR_ID &&
|
||||
(dev_desc->idProduct == USB_ACCESSORY_PRODUCT_ID ||
|
||||
dev_desc->idProduct == USB_ACCESSORY_ADB_PRODUCT_ID))
|
||||
{
|
||||
if(intf->intf_desc->bInterfaceSubClass != 0xFF) return -RT_ERROR;
|
||||
if(ifinst->intf_desc->bInterfaceSubClass != 0xFF) return -RT_ERROR;
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("found android accessory device\n"));
|
||||
}
|
||||
@@ -248,9 +248,9 @@ static rt_err_t rt_usbh_adk_enable(void* arg)
|
||||
{
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("switch device\n"));
|
||||
|
||||
if((ret = rt_usbh_adk_get_protocol(intf, &protocol)) != RT_EOK)
|
||||
if((ret = rt_usb_adk_get_protocol(ifinst, &protocol)) != RT_EOK)
|
||||
{
|
||||
rt_kprintf("rt_usbh_adk_get_protocol failed\n");
|
||||
rt_kprintf("rt_usb_adk_get_protocol failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -260,17 +260,17 @@ static rt_err_t rt_usbh_adk_enable(void* arg)
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
rt_usbh_adk_send_string(intf,
|
||||
rt_usb_adk_send_string(ifinst,
|
||||
ACCESSORY_STRING_MANUFACTURER, _adk_manufacturer);
|
||||
rt_usbh_adk_send_string(intf,
|
||||
rt_usb_adk_send_string(ifinst,
|
||||
ACCESSORY_STRING_MODEL, _adk_model);
|
||||
rt_usbh_adk_send_string(intf,
|
||||
rt_usb_adk_send_string(ifinst,
|
||||
ACCESSORY_STRING_DESCRIPTION, _adk_description);
|
||||
rt_usbh_adk_send_string(intf,
|
||||
rt_usb_adk_send_string(ifinst,
|
||||
ACCESSORY_STRING_VERSION, _adk_version);
|
||||
rt_usbh_adk_send_string(intf,
|
||||
rt_usb_adk_send_string(ifinst,
|
||||
ACCESSORY_STRING_URI, _adk_uri);
|
||||
rt_usbh_adk_send_string(intf,
|
||||
rt_usb_adk_send_string(ifinst,
|
||||
ACCESSORY_STRING_SERIAL, _adk_serial);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("manufacturer %s\n", _adk_manufacturer));
|
||||
@@ -280,28 +280,28 @@ static rt_err_t rt_usbh_adk_enable(void* arg)
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("uri %s\n", _adk_uri));
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("serial %s\n", _adk_serial));
|
||||
|
||||
if((ret = rt_usbh_adk_start(intf)) != RT_EOK)
|
||||
if((ret = rt_usb_adk_start(ifinst)) != RT_EOK)
|
||||
{
|
||||
rt_kprintf("rt_usbh_adk_start failed\n");
|
||||
rt_kprintf("rt_usb_adk_start failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
adk = rt_malloc(sizeof(struct uadkinst));
|
||||
RT_ASSERT(adk != RT_NULL);
|
||||
adkinst = rt_malloc(sizeof(struct uadkinst));
|
||||
RT_ASSERT(adkinst != RT_NULL);
|
||||
|
||||
/* initilize the data structure */
|
||||
rt_memset(adk, 0, sizeof(struct uadkinst));
|
||||
intf->user_data = (void*)adk;
|
||||
rt_memset(adkinst, 0, sizeof(struct uadkinst));
|
||||
ifinst->user_data = (void*)adkinst;
|
||||
|
||||
for(i=0; i<intf->intf_desc->bNumEndpoints; i++)
|
||||
for(i=0; i<ifinst->intf_desc->bNumEndpoints; i++)
|
||||
{
|
||||
uep_desc_t ep_desc;
|
||||
|
||||
/* get endpoint descriptor from interface descriptor */
|
||||
rt_usbh_get_endpoint_descriptor(intf->intf_desc, i, &ep_desc);
|
||||
rt_usb_get_endpoint_descriptor(ifinst->intf_desc, i, &ep_desc);
|
||||
if(ep_desc == RT_NULL)
|
||||
{
|
||||
rt_kprintf("rt_usb_get_endpoint_descriptor error\n");
|
||||
@@ -316,41 +316,41 @@ static rt_err_t rt_usbh_adk_enable(void* arg)
|
||||
if(ep_desc->bEndpointAddress & USB_DIR_IN)
|
||||
{
|
||||
/* allocate an in pipe for the adk instance */
|
||||
ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &adk->pipe_in,
|
||||
intf, ep_desc, RT_NULL);
|
||||
ret = rt_usb_hcd_alloc_pipe(ifinst->uinst->hcd, &adkinst->pipe_in,
|
||||
ifinst, ep_desc, RT_NULL);
|
||||
if(ret != RT_EOK) return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* allocate an output pipe for the adk instance */
|
||||
ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &adk->pipe_out,
|
||||
intf, ep_desc, RT_NULL);
|
||||
ret = rt_usb_hcd_alloc_pipe(ifinst->uinst->hcd, &adkinst->pipe_out,
|
||||
ifinst, ep_desc, RT_NULL);
|
||||
if(ret != RT_EOK) return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* check pipes infomation */
|
||||
if(adk->pipe_in == RT_NULL || adk->pipe_out == RT_NULL)
|
||||
if(adkinst->pipe_in == RT_NULL || adkinst->pipe_out == RT_NULL)
|
||||
{
|
||||
rt_kprintf("pipe error, unsupported device\n");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* set configuration */
|
||||
ret = rt_usbh_set_configure(intf->device, 1);
|
||||
ret = rt_usb_set_configure(ifinst->uinst, 1);
|
||||
if(ret != RT_EOK) return ret;
|
||||
|
||||
/* register adk device */
|
||||
adk->device.type = RT_Device_Class_Char;
|
||||
adk->device.init = RT_NULL;
|
||||
adk->device.open = RT_NULL;
|
||||
adk->device.close = RT_NULL;
|
||||
adk->device.read = rt_usbh_adk_read;
|
||||
adk->device.write = rt_usbh_adk_write;
|
||||
adk->device.control = RT_NULL;
|
||||
adk->device.user_data = (void*)intf;
|
||||
adkinst->device.type = RT_Device_Class_Char;
|
||||
adkinst->device.init = RT_NULL;
|
||||
adkinst->device.open = RT_NULL;
|
||||
adkinst->device.close = RT_NULL;
|
||||
adkinst->device.read = rt_usb_adk_read;
|
||||
adkinst->device.write = rt_usb_adk_write;
|
||||
adkinst->device.control = RT_NULL;
|
||||
adkinst->device.user_data = (void*)ifinst;
|
||||
|
||||
rt_device_register(&adk->device, "adkdev", RT_DEVICE_FLAG_RDWR);
|
||||
rt_device_register(&adkinst->device, "adkdev", RT_DEVICE_FLAG_RDWR);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -363,39 +363,36 @@ static rt_err_t rt_usbh_adk_enable(void* arg)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_adk_disable(void* arg)
|
||||
static rt_err_t rt_usb_adk_stop(void* arg)
|
||||
{
|
||||
uadk_t adk;
|
||||
struct uintf* intf = (struct uintf*)arg;
|
||||
uadkinst_t adkinst;
|
||||
uifinst_t ifinst = (uifinst_t)arg;
|
||||
|
||||
RT_ASSERT(intf != RT_NULL);
|
||||
RT_ASSERT(ifinst != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_adk_stop\n"));
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usb_adk_stop\n"));
|
||||
|
||||
adk = (uadk_t)intf->user_data;
|
||||
if(adk == RT_NULL)
|
||||
adkinst = (uadkinst_t)ifinst->user_data;
|
||||
if(adkinst == RT_NULL)
|
||||
{
|
||||
rt_free(intf);
|
||||
rt_free(ifinst);
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
if(adk->pipe_in != RT_NULL)
|
||||
rt_usb_hcd_free_pipe(intf->device->hcd, adk->pipe_in);
|
||||
if(adkinst->pipe_in != RT_NULL)
|
||||
rt_usb_hcd_free_pipe(ifinst->uinst->hcd, adkinst->pipe_in);
|
||||
|
||||
if(adk->pipe_out != RT_NULL)
|
||||
rt_usb_hcd_free_pipe(intf->device->hcd, adk->pipe_out);
|
||||
if(adkinst->pipe_out != RT_NULL)
|
||||
rt_usb_hcd_free_pipe(ifinst->uinst->hcd, adkinst->pipe_out);
|
||||
|
||||
/* unregister adk device */
|
||||
rt_device_unregister(&adk->device);
|
||||
rt_device_unregister(&adkinst->device);
|
||||
|
||||
/* free adk instance */
|
||||
if(adk != RT_NULL)
|
||||
{
|
||||
rt_free(adk);
|
||||
}
|
||||
if(adkinst != RT_NULL) rt_free(adkinst);
|
||||
|
||||
/* free interface instance */
|
||||
rt_free(intf);
|
||||
rt_free(ifinst);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -406,12 +403,12 @@ static rt_err_t rt_usbh_adk_disable(void* arg)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
ucd_t rt_usbh_class_driver_adk(void)
|
||||
ucd_t rt_usb_class_driver_adk(void)
|
||||
{
|
||||
adk_driver.class_code = USB_CLASS_ADK;
|
||||
|
||||
adk_driver.enable = rt_usbh_adk_enable;
|
||||
adk_driver.disable = rt_usbh_adk_disable;
|
||||
adk_driver.run = rt_usb_adk_run;
|
||||
adk_driver.stop = rt_usb_adk_stop;
|
||||
|
||||
return &adk_driver;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ struct uadkinst
|
||||
|
||||
struct rt_device device;
|
||||
};
|
||||
typedef struct uadkinst* uadk_t;
|
||||
typedef struct uadkinst* uadkinst_t;
|
||||
|
||||
#define USB_ACCESSORY_VENDOR_ID 0x18D1
|
||||
#define USB_ACCESSORY_PRODUCT_ID 0x2D00
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <rtthread.h>
|
||||
#include <drivers/usb_host.h>
|
||||
|
||||
static struct uinstance dev[USB_MAX_DEVICE];
|
||||
static struct uinstance uinst[USB_MAX_DEVICE];
|
||||
|
||||
/**
|
||||
* This function will allocate an usb device instance from system.
|
||||
@@ -35,7 +35,7 @@ static struct uinstance dev[USB_MAX_DEVICE];
|
||||
*
|
||||
* @return the allocate instance on successful, or RT_NULL on failure.
|
||||
*/
|
||||
uinst_t rt_usbh_alloc_instance(void)
|
||||
uinst_t rt_usb_alloc_instance(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -45,19 +45,19 @@ uinst_t rt_usbh_alloc_instance(void)
|
||||
for(i=0; i<USB_MAX_DEVICE; i++)
|
||||
{
|
||||
/* to find an idle instance handle */
|
||||
if(dev[i].status != DEV_STATUS_IDLE) continue;
|
||||
if(uinst[i].status != UINST_STATUS_IDLE) continue;
|
||||
|
||||
/* initialize the usb device instance */
|
||||
rt_memset(&dev[i], 0, sizeof(struct uinstance));
|
||||
rt_memset(&uinst[i], 0, sizeof(struct uinstance));
|
||||
|
||||
dev[i].status = DEV_STATUS_BUSY;
|
||||
dev[i].index = i + 1;
|
||||
dev[i].address = 0;
|
||||
dev[i].max_packet_size = 0x8;
|
||||
uinst[i].status = UINST_STATUS_BUSY;
|
||||
uinst[i].index = i + 1;
|
||||
uinst[i].address = 0;
|
||||
uinst[i].max_packet_size = 0x8;
|
||||
|
||||
/* unlock scheduler */
|
||||
rt_exit_critical();
|
||||
return &dev[i];
|
||||
return &uinst[i];
|
||||
}
|
||||
|
||||
/* unlock scheduler */
|
||||
@@ -71,11 +71,11 @@ uinst_t rt_usbh_alloc_instance(void)
|
||||
* and do device enumunation process.
|
||||
*
|
||||
* @param hcd the host controller driver.
|
||||
* @param device the usb device instance.
|
||||
* @param uinst the usb device instance.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
rt_err_t rt_usb_attatch_instance(uinst_t uinst)
|
||||
{
|
||||
int i = 0;
|
||||
rt_err_t ret = RT_EOK;
|
||||
@@ -84,15 +84,15 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
uintf_desc_t intf_desc;
|
||||
ucd_t drv;
|
||||
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
rt_memset(&cfg_desc, 0, sizeof(struct uconfig_descriptor));
|
||||
dev_desc = &device->dev_desc;
|
||||
dev_desc = &uinst->dev_desc;
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("start enumnation\n"));
|
||||
|
||||
/* get device descriptor head */
|
||||
ret = rt_usbh_get_descriptor(device, USB_DESC_TYPE_DEVICE, (void*)dev_desc, 8);
|
||||
ret = rt_usb_get_descriptor(uinst, USB_DESC_TYPE_DEVICE, (void*)dev_desc, 8);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("get device descriptor head failed\n");
|
||||
@@ -100,7 +100,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
}
|
||||
|
||||
/* set device address */
|
||||
ret = rt_usbh_set_address(device);
|
||||
ret = rt_usb_set_address(uinst);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("set device address failed\n");
|
||||
@@ -108,14 +108,14 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
}
|
||||
|
||||
/* set device max packet size */
|
||||
device->max_packet_size = device->dev_desc.bMaxPacketSize0;
|
||||
uinst->max_packet_size = uinst->dev_desc.bMaxPacketSize0;
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("get device descriptor length %d\n",
|
||||
dev_desc->bLength));
|
||||
|
||||
/* get full device descriptor again */
|
||||
ret = rt_usbh_get_descriptor
|
||||
(device, USB_DESC_TYPE_DEVICE, (void*)dev_desc, dev_desc->bLength);
|
||||
ret = rt_usb_get_descriptor
|
||||
(uinst, USB_DESC_TYPE_DEVICE, (void*)dev_desc, dev_desc->bLength);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("get full device descriptor failed\n");
|
||||
@@ -126,7 +126,8 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("Product ID 0x%x\n", dev_desc->idProduct));
|
||||
|
||||
/* get configuration descriptor head */
|
||||
ret = rt_usbh_get_descriptor(device, USB_DESC_TYPE_CONFIGURATION, &cfg_desc, 18);
|
||||
ret = rt_usb_get_descriptor(uinst, USB_DESC_TYPE_CONFIGURATION, &cfg_desc,
|
||||
sizeof(struct uconfig_descriptor));
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("get configuration descriptor head failed\n");
|
||||
@@ -134,12 +135,12 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
}
|
||||
|
||||
/* alloc memory for configuration descriptor */
|
||||
device->cfg_desc = (ucfg_desc_t)rt_malloc(cfg_desc.wTotalLength);
|
||||
rt_memset(device->cfg_desc, 0, cfg_desc.wTotalLength);
|
||||
uinst->cfg_desc = (ucfg_desc_t)rt_malloc(cfg_desc.wTotalLength);
|
||||
rt_memset(uinst->cfg_desc, 0, cfg_desc.wTotalLength);
|
||||
|
||||
/* get full configuration descriptor */
|
||||
ret = rt_usbh_get_descriptor(device, USB_DESC_TYPE_CONFIGURATION,
|
||||
device->cfg_desc, cfg_desc.wTotalLength);
|
||||
ret = rt_usb_get_descriptor(uinst, USB_DESC_TYPE_CONFIGURATION,
|
||||
uinst->cfg_desc, cfg_desc.wTotalLength);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("get full configuration descriptor failed\n");
|
||||
@@ -147,13 +148,13 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
}
|
||||
|
||||
/* set configuration */
|
||||
ret = rt_usbh_set_configure(device, 1);
|
||||
ret = rt_usb_set_configure(uinst, 1);
|
||||
if(ret != RT_EOK) return ret;
|
||||
|
||||
for(i=0; i<device->cfg_desc->bNumInterfaces; i++)
|
||||
for(i=0; i<uinst->cfg_desc->bNumInterfaces; i++)
|
||||
{
|
||||
/* get interface descriptor through configuration descriptor */
|
||||
ret = rt_usbh_get_interface_descriptor(device->cfg_desc, i, &intf_desc);
|
||||
ret = rt_usb_get_interface_descriptor(uinst->cfg_desc, i, &intf_desc);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("rt_usb_get_interface_descriptor error\n");
|
||||
@@ -165,22 +166,22 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
intf_desc->bInterfaceSubClass));
|
||||
|
||||
/* find driver by class code found in interface descriptor */
|
||||
drv = rt_usbh_class_driver_find(intf_desc->bInterfaceClass,
|
||||
drv = rt_usb_class_driver_find(intf_desc->bInterfaceClass,
|
||||
intf_desc->bInterfaceSubClass);
|
||||
|
||||
if(drv != RT_NULL)
|
||||
{
|
||||
/* allocate memory for interface device */
|
||||
device->intf[i] =
|
||||
(struct uintf*)rt_malloc(sizeof(struct uintf));
|
||||
/* allocate memory for interface uinst */
|
||||
uinst->ifinst[i] =
|
||||
(uifinst_t)rt_malloc(sizeof(struct uifinst));
|
||||
|
||||
device->intf[i]->drv = drv;
|
||||
device->intf[i]->device = device;
|
||||
device->intf[i]->intf_desc = intf_desc;
|
||||
device->intf[i]->user_data = RT_NULL;
|
||||
uinst->ifinst[i]->drv = drv;
|
||||
uinst->ifinst[i]->uinst = uinst;
|
||||
uinst->ifinst[i]->intf_desc = intf_desc;
|
||||
uinst->ifinst[i]->user_data = RT_NULL;
|
||||
|
||||
/* open usb class driver */
|
||||
ret = rt_usbh_class_driver_enable(drv, (void*)device->intf[i]);
|
||||
ret = rt_usb_class_driver_run(drv, (void*)uinst->ifinst[i]);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("interface %d run class driver error\n", i);
|
||||
@@ -200,35 +201,35 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
|
||||
* This function will detach an usb device instance from its host controller,
|
||||
* and release all resource.
|
||||
*
|
||||
* @param device the usb device instance.
|
||||
* @param uinst the usb device instance.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_detach_instance(uinst_t device)
|
||||
rt_err_t rt_usb_detach_instance(uinst_t uinst)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if(device == RT_NULL)
|
||||
if(uinst == RT_NULL)
|
||||
{
|
||||
rt_kprintf("no usb instance to detach\n");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* free configration descriptor */
|
||||
if(device->cfg_desc) rt_free(device->cfg_desc);
|
||||
if(uinst->cfg_desc) rt_free(uinst->cfg_desc);
|
||||
|
||||
for(i=0; i<device->cfg_desc->bNumInterfaces; i++)
|
||||
for(i=0; i<uinst->cfg_desc->bNumInterfaces; i++)
|
||||
{
|
||||
if(device->intf[i] == RT_NULL) continue;
|
||||
if(device->intf[i]->drv == RT_NULL) continue;
|
||||
if(uinst->ifinst[i] == RT_NULL) continue;
|
||||
if(uinst->ifinst[i]->drv == RT_NULL) continue;
|
||||
|
||||
RT_ASSERT(device->intf[i]->device == device);
|
||||
RT_ASSERT(uinst->ifinst[i]->uinst == uinst);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("free interface instance %d\n", i));
|
||||
rt_usbh_class_driver_disable(device->intf[i]->drv, (void*)device->intf[i]);
|
||||
rt_usb_class_driver_stop(uinst->ifinst[i]->drv, (void*)uinst->ifinst[i]);
|
||||
}
|
||||
|
||||
rt_memset(device, 0, sizeof(struct uinstance));
|
||||
rt_memset(uinst, 0, sizeof(struct uinstance));
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -236,20 +237,20 @@ rt_err_t rt_usbh_detach_instance(uinst_t device)
|
||||
/**
|
||||
* This function will do USB_REQ_GET_DESCRIPTO' request for the usb device instance,
|
||||
*
|
||||
* @param device the usb device instance.
|
||||
* @param uinst the usb device instance.
|
||||
* @param type the type of descriptor request.
|
||||
* @param buffer the data buffer to save requested data
|
||||
* @param nbytes the size of buffer
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_get_descriptor(uinst_t device, rt_uint8_t type, void* buffer,
|
||||
rt_err_t rt_usb_get_descriptor(uinst_t uinst, rt_uint8_t type, void* buffer,
|
||||
int nbytes)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_STANDARD |
|
||||
USB_REQ_TYPE_DEVICE;
|
||||
@@ -258,7 +259,7 @@ rt_err_t rt_usbh_get_descriptor(uinst_t device, rt_uint8_t type, void* buffer,
|
||||
setup.length = nbytes;
|
||||
setup.value = type << 8;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, buffer, nbytes,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, buffer, nbytes,
|
||||
timeout) != nbytes) return -RT_EIO;
|
||||
else return RT_EOK;
|
||||
}
|
||||
@@ -266,16 +267,16 @@ rt_err_t rt_usbh_get_descriptor(uinst_t device, rt_uint8_t type, void* buffer,
|
||||
/**
|
||||
* This function will set an address to the usb device.
|
||||
*
|
||||
* @param device the usb device instance.
|
||||
* @param uinst the usb device instance.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_set_address(uinst_t device)
|
||||
rt_err_t rt_usb_set_address(uinst_t uinst)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usb_set_address\n"));
|
||||
|
||||
@@ -284,14 +285,14 @@ rt_err_t rt_usbh_set_address(uinst_t device)
|
||||
setup.request = USB_REQ_SET_ADDRESS;
|
||||
setup.index = 0;
|
||||
setup.length = 0;
|
||||
setup.value = device->index;
|
||||
setup.value = uinst->index;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, RT_NULL, 0,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, RT_NULL, 0,
|
||||
timeout) != 0) return -RT_EIO;
|
||||
|
||||
rt_thread_delay(50);
|
||||
|
||||
device->address = device->index;
|
||||
uinst->address = uinst->index;
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -299,18 +300,18 @@ rt_err_t rt_usbh_set_address(uinst_t device)
|
||||
/**
|
||||
* This function will set a configuration to the usb device.
|
||||
*
|
||||
* @param device the usb device instance.
|
||||
* @param uinst the usb device instance.
|
||||
* @param config the configuration number.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_set_configure(uinst_t device, int config)
|
||||
rt_err_t rt_usb_set_configure(uinst_t uinst, int config)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
/* check parameter */
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD |
|
||||
USB_REQ_TYPE_DEVICE;
|
||||
@@ -319,7 +320,7 @@ rt_err_t rt_usbh_set_configure(uinst_t device, int config)
|
||||
setup.length = 0;
|
||||
setup.value = config;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, RT_NULL, 0,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, RT_NULL, 0,
|
||||
timeout) != 0) return -RT_EIO;
|
||||
|
||||
return RT_EOK;
|
||||
@@ -328,18 +329,18 @@ rt_err_t rt_usbh_set_configure(uinst_t device, int config)
|
||||
/**
|
||||
* This function will set an interface to the usb device.
|
||||
*
|
||||
* @param device the usb device instance.
|
||||
* @param uinst the usb device instance.
|
||||
* @param intf the interface number.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_set_interface(uinst_t device, int intf)
|
||||
rt_err_t rt_usb_set_interface(uinst_t uinst, int intf)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
/* check parameter */
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD |
|
||||
USB_REQ_TYPE_INTERFACE;
|
||||
@@ -348,7 +349,7 @@ rt_err_t rt_usbh_set_interface(uinst_t device, int intf)
|
||||
setup.length = 0;
|
||||
setup.value = intf;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, RT_NULL, 0,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, RT_NULL, 0,
|
||||
timeout) != 0) return -RT_EIO;
|
||||
|
||||
return RT_EOK;
|
||||
@@ -357,18 +358,18 @@ rt_err_t rt_usbh_set_interface(uinst_t device, int intf)
|
||||
/**
|
||||
* This function will clear feature for the endpoint of the usb device.
|
||||
*
|
||||
* @param device the usb device instance.
|
||||
* @param uinst the usb device instance.
|
||||
* @param endpoint the endpoint number of the usb device.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature)
|
||||
rt_err_t rt_usb_clear_feature(uinst_t uinst, int endpoint, int feature)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
/* check parameter */
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD |
|
||||
USB_REQ_TYPE_ENDPOINT;
|
||||
@@ -377,7 +378,7 @@ rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature)
|
||||
setup.length = 0;
|
||||
setup.value = feature;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, RT_NULL, 0,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, RT_NULL, 0,
|
||||
timeout) != 0) return -RT_EIO;
|
||||
|
||||
return RT_EOK;
|
||||
@@ -392,7 +393,7 @@ rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num,
|
||||
rt_err_t rt_usb_get_interface_descriptor(ucfg_desc_t cfg_desc, int num,
|
||||
uintf_desc_t* intf_desc)
|
||||
{
|
||||
rt_uint32_t ptr, depth = 0;
|
||||
@@ -437,7 +438,7 @@ rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num,
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_get_endpoint_descriptor(uintf_desc_t intf_desc, int num,
|
||||
rt_err_t rt_usb_get_endpoint_descriptor(uintf_desc_t intf_desc, int num,
|
||||
uep_desc_t* ep_desc)
|
||||
{
|
||||
int count = 0, depth = 0;
|
||||
|
||||
@@ -34,7 +34,7 @@ static rt_list_t _driver_list;
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_class_driver_init(void)
|
||||
rt_err_t rt_usb_class_driver_init(void)
|
||||
{
|
||||
rt_list_init(&_driver_list);
|
||||
|
||||
@@ -49,7 +49,7 @@ rt_err_t rt_usbh_class_driver_init(void)
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
|
||||
rt_err_t rt_usbh_class_driver_register(ucd_t drv)
|
||||
rt_err_t rt_usb_class_driver_register(ucd_t drv)
|
||||
{
|
||||
if (drv == RT_NULL) return -RT_ERROR;
|
||||
|
||||
@@ -66,7 +66,7 @@ rt_err_t rt_usbh_class_driver_register(ucd_t drv)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_class_driver_unregister(ucd_t drv)
|
||||
rt_err_t rt_usb_class_driver_unregister(ucd_t drv)
|
||||
{
|
||||
RT_ASSERT(drv != RT_NULL);
|
||||
|
||||
@@ -84,12 +84,12 @@ rt_err_t rt_usbh_class_driver_unregister(ucd_t drv)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_class_driver_enable(ucd_t drv, void* args)
|
||||
rt_err_t rt_usb_class_driver_run(ucd_t drv, void* args)
|
||||
{
|
||||
RT_ASSERT(drv != RT_NULL);
|
||||
|
||||
if(drv->enable != RT_NULL)
|
||||
drv->enable(args);
|
||||
if(drv->run != RT_NULL)
|
||||
drv->run(args);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -102,12 +102,12 @@ rt_err_t rt_usbh_class_driver_enable(ucd_t drv, void* args)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_class_driver_disable(ucd_t drv, void* args)
|
||||
rt_err_t rt_usb_class_driver_stop(ucd_t drv, void* args)
|
||||
{
|
||||
RT_ASSERT(drv != RT_NULL);
|
||||
|
||||
if(drv->disable != RT_NULL)
|
||||
drv->disable(args);
|
||||
if(drv->stop != RT_NULL)
|
||||
drv->stop(args);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ rt_err_t rt_usbh_class_driver_disable(ucd_t drv, void* args)
|
||||
*
|
||||
* @return the registered usb class driver on successful, or RT_NULL on failure.
|
||||
*/
|
||||
ucd_t rt_usbh_class_driver_find(int class_code, int subclass_code)
|
||||
ucd_t rt_usb_class_driver_find(int class_code, int subclass_code)
|
||||
{
|
||||
struct rt_list_node *node;
|
||||
|
||||
|
||||
@@ -34,20 +34,20 @@ static struct uclass_driver hub_driver;
|
||||
* This function will do USB_REQ_GET_DESCRIPTOR request for the device instance
|
||||
* to get usb hub descriptor.
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @buffer the data buffer to save usb hub descriptor.
|
||||
* @param nbytes the size of buffer
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer,
|
||||
rt_err_t rt_usb_hub_get_descriptor(uinst_t uinst, rt_uint8_t *buffer,
|
||||
rt_size_t nbytes)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS |
|
||||
USB_REQ_TYPE_DEVICE;
|
||||
@@ -56,7 +56,7 @@ rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer
|
||||
setup.length = nbytes;
|
||||
setup.value = USB_DESC_TYPE_HUB << 8;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, buffer, nbytes,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, buffer, nbytes,
|
||||
timeout) == nbytes) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -65,19 +65,19 @@ rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer
|
||||
* This function will do USB_REQ_GET_STATUS request for the device instance
|
||||
* to get usb hub status.
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @buffer the data buffer to save usb hub status.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_hub_get_status(struct uinstance* device, rt_uint8_t* buffer)
|
||||
rt_err_t rt_usb_hub_get_status(uinst_t uinst, rt_uint8_t* buffer)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
int length = 4;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(device != RT_NULL);
|
||||
RT_ASSERT(uinst != RT_NULL);
|
||||
|
||||
setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS |
|
||||
USB_REQ_TYPE_DEVICE;
|
||||
@@ -86,7 +86,7 @@ rt_err_t rt_usbh_hub_get_status(struct uinstance* device, rt_uint8_t* buffer)
|
||||
setup.length = length;
|
||||
setup.value = 0;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, buffer, length,
|
||||
if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, buffer, length,
|
||||
timeout) == length) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -95,13 +95,13 @@ rt_err_t rt_usbh_hub_get_status(struct uinstance* device, rt_uint8_t* buffer)
|
||||
* This function will do USB_REQ_GET_STATUS request for the device instance
|
||||
* to get hub port status.
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @port the hub port to get status.
|
||||
* @buffer the data buffer to save usb hub status.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_hub_get_port_status(uhub_t hub, rt_uint16_t port,
|
||||
rt_err_t rt_usb_hub_get_port_status(uhubinst_t uhub, rt_uint16_t port,
|
||||
rt_uint8_t* buffer)
|
||||
{
|
||||
struct ureqest setup;
|
||||
@@ -109,12 +109,12 @@ rt_err_t rt_usbh_hub_get_port_status(uhub_t hub, rt_uint16_t port,
|
||||
int length = 4;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(hub != RT_NULL);
|
||||
RT_ASSERT(uhub != RT_NULL);
|
||||
|
||||
/* get roothub port status */
|
||||
if(hub->is_roothub)
|
||||
if(uhub->is_roothub)
|
||||
{
|
||||
rt_usb_hcd_hub_control(hub->hcd, port, RH_GET_PORT_STATUS,
|
||||
rt_usb_hcd_hub_control(uhub->hcd, port, RH_GET_PORT_STATUS,
|
||||
(void*)buffer);
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ rt_err_t rt_usbh_hub_get_port_status(uhub_t hub, rt_uint16_t port,
|
||||
setup.length = 4;
|
||||
setup.value = 0;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(hub->hcd, hub->self, &setup, buffer,
|
||||
if(rt_usb_hcd_control_xfer(uhub->hcd, uhub->self, &setup, buffer,
|
||||
length, timeout) == timeout) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -135,25 +135,25 @@ rt_err_t rt_usbh_hub_get_port_status(uhub_t hub, rt_uint16_t port,
|
||||
* This function will do USB_REQ_CLEAR_FEATURE request for the device instance
|
||||
* to clear feature of the hub port.
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @port the hub port.
|
||||
* @feature feature to be cleared.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_hub_clear_port_feature(uhub_t hub, rt_uint16_t port,
|
||||
rt_err_t rt_usb_hub_clear_port_feature(uhubinst_t uhub, rt_uint16_t port,
|
||||
rt_uint16_t feature)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(hub != RT_NULL);
|
||||
RT_ASSERT(uhub != RT_NULL);
|
||||
|
||||
/* clear roothub feature */
|
||||
if(hub->is_roothub)
|
||||
if(uhub->is_roothub)
|
||||
{
|
||||
rt_usb_hcd_hub_control(hub->hcd, port, RH_CLEAR_PORT_FEATURE,
|
||||
rt_usb_hcd_hub_control(uhub->hcd, port, RH_CLEAR_PORT_FEATURE,
|
||||
(void*)feature);
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ rt_err_t rt_usbh_hub_clear_port_feature(uhub_t hub, rt_uint16_t port,
|
||||
setup.length = 0;
|
||||
setup.value = feature;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(hub->hcd, hub->self, &setup, RT_NULL, 0,
|
||||
if(rt_usb_hcd_control_xfer(uhub->hcd, uhub->self, &setup, RT_NULL, 0,
|
||||
timeout) == 0) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -174,25 +174,25 @@ rt_err_t rt_usbh_hub_clear_port_feature(uhub_t hub, rt_uint16_t port,
|
||||
* This function will do USB_REQ_SET_FEATURE request for the device instance
|
||||
* to set feature of the hub port.
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @port the hub port.
|
||||
* @feature feature to be set.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_hub_set_port_feature(uhub_t hub, rt_uint16_t port,
|
||||
rt_err_t rt_usb_hub_set_port_feature(uhubinst_t uhub, rt_uint16_t port,
|
||||
rt_uint16_t feature)
|
||||
{
|
||||
struct ureqest setup;
|
||||
int timeout = 100;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(hub != RT_NULL);
|
||||
RT_ASSERT(uhub != RT_NULL);
|
||||
|
||||
/* clear roothub feature */
|
||||
if(hub->is_roothub)
|
||||
if(uhub->is_roothub)
|
||||
{
|
||||
rt_usb_hcd_hub_control(hub->hcd, port, RH_SET_PORT_FEATURE,
|
||||
rt_usb_hcd_hub_control(uhub->hcd, port, RH_SET_PORT_FEATURE,
|
||||
(void*)feature);
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ rt_err_t rt_usbh_hub_set_port_feature(uhub_t hub, rt_uint16_t port,
|
||||
setup.length = 0;
|
||||
setup.value = feature;
|
||||
|
||||
if(rt_usb_hcd_control_xfer(hub->hcd, hub->self, &setup, RT_NULL, 0,
|
||||
if(rt_usb_hcd_control_xfer(uhub->hcd, uhub->self, &setup, RT_NULL, 0,
|
||||
timeout) == 0) return RT_EOK;
|
||||
else return -RT_FALSE;
|
||||
}
|
||||
@@ -212,33 +212,33 @@ rt_err_t rt_usbh_hub_set_port_feature(uhub_t hub, rt_uint16_t port,
|
||||
/**
|
||||
* This function will rest hub port, it is invoked when sub device attached to the hub port.
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
* @param port the hub port.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_hub_reset_port(uhub_t hub, rt_uint16_t port)
|
||||
rt_err_t rt_usb_hub_reset_port(uhubinst_t uhub, rt_uint16_t port)
|
||||
{
|
||||
rt_err_t ret;
|
||||
rt_uint32_t pstatus;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(hub != RT_NULL);
|
||||
RT_ASSERT(uhub != RT_NULL);
|
||||
|
||||
rt_thread_delay(50);
|
||||
|
||||
/* reset hub port */
|
||||
ret = rt_usbh_hub_set_port_feature(hub, port, PORT_FEAT_RESET);
|
||||
ret = rt_usb_hub_set_port_feature(uhub, port, PORT_FEAT_RESET);
|
||||
if(ret != RT_EOK) return ret;
|
||||
|
||||
while(1)
|
||||
{
|
||||
ret = rt_usbh_hub_get_port_status(hub, port, (rt_uint8_t*)&pstatus);
|
||||
ret = rt_usb_hub_get_port_status(uhub, port, (rt_uint8_t*)&pstatus);
|
||||
if(!(pstatus & PORT_PRS)) break;
|
||||
}
|
||||
|
||||
/* clear port reset feature */
|
||||
ret = rt_usbh_hub_clear_port_feature(hub, port, PORT_FEAT_C_RESET);
|
||||
ret = rt_usb_hub_clear_port_feature(uhub, port, PORT_FEAT_C_RESET);
|
||||
if(ret != RT_EOK) return ret;
|
||||
|
||||
rt_thread_delay(50);
|
||||
@@ -249,12 +249,12 @@ rt_err_t rt_usbh_hub_reset_port(uhub_t hub, rt_uint16_t port)
|
||||
/**
|
||||
* This function will do debouce, it is invoked when sub device attached to the hub port.
|
||||
*
|
||||
* @param device the usb instance.
|
||||
* @param uinst the usb instance.
|
||||
* @param port the hub port.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_hub_port_debounce(uhub_t hub, rt_uint16_t port)
|
||||
rt_err_t rt_usb_hub_port_debounce(uhubinst_t uhub, rt_uint16_t port)
|
||||
{
|
||||
rt_err_t ret;
|
||||
int i = 0, times = 20;
|
||||
@@ -262,11 +262,11 @@ rt_err_t rt_usbh_hub_port_debounce(uhub_t hub, rt_uint16_t port)
|
||||
rt_bool_t connect = RT_TRUE;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(hub != RT_NULL);
|
||||
RT_ASSERT(uhub != RT_NULL);
|
||||
|
||||
for(i=0; i<times; i++)
|
||||
{
|
||||
ret = rt_usbh_hub_get_port_status(hub, port, (rt_uint8_t*)&pstatus);
|
||||
ret = rt_usb_hub_get_port_status(uhub, port, (rt_uint8_t*)&pstatus);
|
||||
if(ret != RT_EOK) return ret;
|
||||
|
||||
if(!(pstatus & PORT_CCS))
|
||||
@@ -286,70 +286,70 @@ rt_err_t rt_usbh_hub_port_debounce(uhub_t hub, rt_uint16_t port)
|
||||
* This function will poll all the hub ports to detect port status, especially connect and
|
||||
* disconnect events.
|
||||
*
|
||||
* @param intf the interface instance.
|
||||
* @param ifinst the interface instance.
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_hub_port_change(uhub_t hub)
|
||||
static rt_err_t rt_usb_hub_port_change(uhubinst_t uhub)
|
||||
{
|
||||
int i;
|
||||
rt_bool_t reconnect;
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(hub != RT_NULL);
|
||||
RT_ASSERT(uhub != RT_NULL);
|
||||
|
||||
/* get usb device instance */
|
||||
for (i = 0; i < hub->num_ports; i++)
|
||||
for (i = 0; i < uhub->num_ports; i++)
|
||||
{
|
||||
rt_err_t ret;
|
||||
struct uinstance* device;
|
||||
uinst_t uinst;
|
||||
rt_uint32_t pstatus = 0;
|
||||
|
||||
reconnect = RT_FALSE;
|
||||
|
||||
/* get hub port status */
|
||||
ret = rt_usbh_hub_get_port_status(hub, i + 1, (rt_uint8_t*)&pstatus);
|
||||
ret = rt_usb_hub_get_port_status(uhub, i + 1, (rt_uint8_t*)&pstatus);
|
||||
if(ret != RT_EOK) continue;
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("port %d status 0x%x\n", i, pstatus));
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("port_status 0x%x\n", pstatus));
|
||||
|
||||
/* check port status change */
|
||||
if ((pstatus & PORT_CCSC))
|
||||
{
|
||||
/* clear port status change feature */
|
||||
rt_usbh_hub_clear_port_feature(hub, i + 1, PORT_FEAT_C_CONNECTION);
|
||||
rt_usb_hub_clear_port_feature(uhub, i + 1, PORT_FEAT_C_CONNECTION);
|
||||
reconnect = RT_TRUE;
|
||||
}
|
||||
|
||||
if(pstatus & PORT_PESC)
|
||||
{
|
||||
rt_usbh_hub_clear_port_feature(hub, i + 1, PORT_FEAT_C_ENABLE);
|
||||
rt_usb_hub_clear_port_feature(uhub, i + 1, PORT_FEAT_C_ENABLE);
|
||||
reconnect = RT_TRUE;
|
||||
}
|
||||
|
||||
if(reconnect)
|
||||
{
|
||||
if(hub->child[i]->status != DEV_STATUS_IDLE)
|
||||
rt_usbh_detach_instance(hub->child[i]);
|
||||
if(uhub->child[i]->status != UINST_STATUS_IDLE)
|
||||
rt_usb_detach_instance(uhub->child[i]);
|
||||
|
||||
ret = rt_usbh_hub_port_debounce(hub, i + 1);
|
||||
ret = rt_usb_hub_port_debounce(uhub, i + 1);
|
||||
if(ret != RT_EOK) continue;
|
||||
|
||||
/* allocate an usb instance for new connected device */
|
||||
device = rt_usbh_alloc_instance();
|
||||
if(device == RT_NULL) break;
|
||||
uinst = rt_usb_alloc_instance();
|
||||
if(uinst == RT_NULL) break;
|
||||
|
||||
/* set usb device speed */
|
||||
device->speed = (pstatus & PORT_LSDA) ? 1 : 0;
|
||||
device->parent = hub;
|
||||
device->hcd = hub->hcd;
|
||||
hub->child[i] = device;
|
||||
uinst->speed = (pstatus & PORT_LSDA) ? 1 : 0;
|
||||
uinst->parent = uhub;
|
||||
uinst->hcd = uhub->hcd;
|
||||
uhub->child[i] = uinst;
|
||||
|
||||
/* reset usb roothub port */
|
||||
rt_usbh_hub_reset_port(hub, i + 1);
|
||||
rt_usb_hub_reset_port(uhub, i + 1);
|
||||
|
||||
/* attatch the usb instance to the hcd */
|
||||
rt_usbh_attatch_instance(device);
|
||||
rt_usb_attatch_instance(uinst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,18 +363,18 @@ static rt_err_t rt_usbh_hub_port_change(uhub_t hub)
|
||||
*
|
||||
* @return none.
|
||||
*/
|
||||
static void rt_usbh_hub_irq(void* context)
|
||||
static void rt_usb_hub_irq(void* context)
|
||||
{
|
||||
upipe_t pipe;
|
||||
struct uintf* intf;
|
||||
uhub_t hub;
|
||||
uifinst_t ifinst;
|
||||
uhubinst_t uhub;
|
||||
int timeout = 100;
|
||||
|
||||
RT_ASSERT(context != RT_NULL);
|
||||
|
||||
pipe = (upipe_t)context;
|
||||
intf = pipe->intf;
|
||||
hub = (uhub_t)intf->user_data;
|
||||
ifinst = pipe->ifinst;
|
||||
uhub = (uhubinst_t)ifinst->user_data;
|
||||
|
||||
if(pipe->status != UPIPE_STATUS_OK)
|
||||
{
|
||||
@@ -382,14 +382,14 @@ static void rt_usbh_hub_irq(void* context)
|
||||
return;
|
||||
}
|
||||
|
||||
rt_usbh_hub_port_change(hub);
|
||||
rt_usb_hub_port_change(uhub);
|
||||
|
||||
rt_kprintf("hub int xfer...\n");
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(pipe->intf->device->hcd != RT_NULL);
|
||||
RT_ASSERT(pipe->ifinst->uinst->hcd != RT_NULL);
|
||||
|
||||
rt_usb_hcd_int_xfer(intf->device->hcd, pipe, hub->buffer,
|
||||
rt_usb_hcd_int_xfer(ifinst->uinst->hcd, pipe, uhub->buffer,
|
||||
pipe->ep.wMaxPacketSize, timeout);
|
||||
}
|
||||
|
||||
@@ -401,33 +401,33 @@ static void rt_usbh_hub_irq(void* context)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_hub_enable(void *arg)
|
||||
static rt_err_t rt_usb_hub_run(void *arg)
|
||||
{
|
||||
int i = 0;
|
||||
rt_err_t ret = RT_EOK;
|
||||
uep_desc_t ep_desc;
|
||||
uhub_t hub;
|
||||
struct uinstance* device;
|
||||
struct uintf* intf = (struct uintf*)arg;
|
||||
uhubinst_t uhub;
|
||||
uinst_t uinst;
|
||||
uifinst_t ifinst = (uifinst_t)arg;
|
||||
int timeout = 300;
|
||||
|
||||
/* paremeter check */
|
||||
RT_ASSERT(intf != RT_NULL);
|
||||
RT_ASSERT(ifinst != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_hub_run\n"));
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usb_hub_run\n"));
|
||||
|
||||
/* get usb device instance */
|
||||
device = intf->device;
|
||||
uinst = ifinst->uinst;
|
||||
|
||||
/* create a hub instance */
|
||||
hub = rt_malloc(sizeof(struct uhub));
|
||||
rt_memset(hub, 0, sizeof(struct uhub));
|
||||
uhub = rt_malloc(sizeof(struct uhubinst));
|
||||
rt_memset(uhub, 0, sizeof(struct uhubinst));
|
||||
|
||||
/* make interface instance's user data point to hub instance */
|
||||
intf->user_data = (void*)hub;
|
||||
ifinst->user_data = (void*)uhub;
|
||||
|
||||
/* get hub descriptor head */
|
||||
ret = rt_usbh_hub_get_descriptor(device, (rt_uint8_t*)&hub->hub_desc, 8);
|
||||
ret = rt_usb_hub_get_descriptor(uinst, (rt_uint8_t*)&uhub->hub_desc, 8);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("get hub descriptor failed\n");
|
||||
@@ -435,8 +435,8 @@ static rt_err_t rt_usbh_hub_enable(void *arg)
|
||||
}
|
||||
|
||||
/* get full hub descriptor */
|
||||
ret = rt_usbh_hub_get_descriptor(device, (rt_uint8_t*)&hub->hub_desc,
|
||||
hub->hub_desc.length);
|
||||
ret = rt_usb_hub_get_descriptor(uinst, (rt_uint8_t*)&uhub->hub_desc,
|
||||
uhub->hub_desc.length);
|
||||
if(ret != RT_EOK)
|
||||
{
|
||||
rt_kprintf("get hub descriptor again failed\n");
|
||||
@@ -444,23 +444,23 @@ static rt_err_t rt_usbh_hub_enable(void *arg)
|
||||
}
|
||||
|
||||
/* get hub ports number */
|
||||
hub->num_ports = hub->hub_desc.num_ports;
|
||||
hub->hcd = device->hcd;
|
||||
hub->self = device;
|
||||
uhub->num_ports = uhub->hub_desc.num_ports;
|
||||
uhub->hcd = uinst->hcd;
|
||||
uhub->self = uinst;
|
||||
|
||||
/* reset all hub ports */
|
||||
for (i = 0; i < hub->num_ports; i++)
|
||||
for (i = 0; i < uhub->num_ports; i++)
|
||||
{
|
||||
rt_usbh_hub_set_port_feature(hub, i + 1, PORT_FEAT_POWER);
|
||||
rt_thread_delay(hub->hub_desc.pwron_to_good
|
||||
rt_usb_hub_set_port_feature(uhub, i + 1, PORT_FEAT_POWER);
|
||||
rt_thread_delay(uhub->hub_desc.pwron_to_good
|
||||
* 2 * RT_TICK_PER_SECOND / 1000 );
|
||||
}
|
||||
|
||||
if(intf->intf_desc->bNumEndpoints != 1)
|
||||
if(ifinst->intf_desc->bNumEndpoints != 1)
|
||||
return -RT_ERROR;
|
||||
|
||||
/* get endpoint descriptor from interface descriptor */
|
||||
rt_usbh_get_endpoint_descriptor(intf->intf_desc, 0, &ep_desc);
|
||||
rt_usb_get_endpoint_descriptor(ifinst->intf_desc, 0, &ep_desc);
|
||||
if(ep_desc == RT_NULL)
|
||||
{
|
||||
rt_kprintf("rt_usb_get_endpoint_descriptor error\n");
|
||||
@@ -474,17 +474,17 @@ static rt_err_t rt_usbh_hub_enable(void *arg)
|
||||
if(ep_desc->bEndpointAddress & USB_DIR_IN)
|
||||
{
|
||||
/* allocate a pipe according to the endpoint type */
|
||||
rt_usb_hcd_alloc_pipe(device->hcd, &hub->pipe_in, intf,
|
||||
ep_desc, rt_usbh_hub_irq);
|
||||
rt_usb_hcd_alloc_pipe(uinst->hcd, &uhub->pipe_in, ifinst,
|
||||
ep_desc, rt_usb_hub_irq);
|
||||
}
|
||||
else return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* parameter check */
|
||||
RT_ASSERT(device->hcd != RT_NULL);
|
||||
RT_ASSERT(uinst->hcd != RT_NULL);
|
||||
|
||||
rt_usb_hcd_int_xfer(device->hcd, hub->pipe_in, hub->buffer,
|
||||
hub->pipe_in->ep.wMaxPacketSize, timeout);
|
||||
rt_usb_hcd_int_xfer(uinst->hcd, uhub->pipe_in, uhub->buffer,
|
||||
uhub->pipe_in->ep.wMaxPacketSize, timeout);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -497,32 +497,32 @@ static rt_err_t rt_usbh_hub_enable(void *arg)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
static rt_err_t rt_usbh_hub_disable(void* arg)
|
||||
static rt_err_t rt_usb_hub_stop(void* arg)
|
||||
{
|
||||
int i;
|
||||
uhub_t hub;
|
||||
struct uinstance* device;
|
||||
struct uintf* intf = (struct uintf*)arg;
|
||||
uhubinst_t uhub;
|
||||
uinst_t uinst;
|
||||
uifinst_t ifinst = (uifinst_t)arg;
|
||||
|
||||
/* paremeter check */
|
||||
RT_ASSERT(intf != RT_NULL);
|
||||
RT_ASSERT(ifinst != RT_NULL);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_hub_stop\n"));
|
||||
RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usb_hub_stop\n"));
|
||||
|
||||
device = intf->device;
|
||||
hub = (uhub_t)intf->user_data;
|
||||
uinst = ifinst->uinst;
|
||||
uhub = (uhubinst_t)ifinst->user_data;
|
||||
|
||||
if(hub->pipe_in != RT_NULL)
|
||||
rt_usb_hcd_free_pipe(device->hcd, hub->pipe_in);
|
||||
if(uhub->pipe_in != RT_NULL)
|
||||
rt_usb_hcd_free_pipe(uinst->hcd, uhub->pipe_in);
|
||||
|
||||
for(i=0; i<hub->num_ports; i++)
|
||||
for(i=0; i<uhub->num_ports; i++)
|
||||
{
|
||||
if(hub->child[i] != RT_NULL)
|
||||
rt_usbh_detach_instance(hub->child[i]);
|
||||
if(uhub->child[i] != RT_NULL)
|
||||
rt_usb_detach_instance(uhub->child[i]);
|
||||
}
|
||||
|
||||
if(hub != RT_NULL) rt_free(hub);
|
||||
if(intf != RT_NULL) rt_free(intf);
|
||||
if(uhub != RT_NULL) rt_free(uhub);
|
||||
if(ifinst != RT_NULL) rt_free(ifinst);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -533,12 +533,12 @@ static rt_err_t rt_usbh_hub_disable(void* arg)
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
ucd_t rt_usbh_class_driver_hub(void)
|
||||
ucd_t rt_usb_class_driver_hub(void)
|
||||
{
|
||||
hub_driver.class_code = USB_CLASS_HUB;
|
||||
|
||||
hub_driver.enable = rt_usbh_hub_enable;
|
||||
hub_driver.disable = rt_usbh_hub_disable;
|
||||
hub_driver.run = rt_usb_hub_run;
|
||||
hub_driver.stop = rt_usb_hub_stop;
|
||||
|
||||
return &hub_driver;
|
||||
}
|
||||
@@ -551,7 +551,7 @@ ucd_t rt_usbh_class_driver_hub(void)
|
||||
*
|
||||
* @return none.
|
||||
*/
|
||||
static void rt_usbh_hub_thread_entry(void* parameter)
|
||||
static void rt_usb_hub_thread_entry(void* parameter)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
@@ -566,7 +566,7 @@ static void rt_usbh_hub_thread_entry(void* parameter)
|
||||
switch (msg.type)
|
||||
{
|
||||
case USB_MSG_CONNECT_CHANGE:
|
||||
rt_usbh_hub_port_change(msg.content.hub);
|
||||
rt_usb_hub_port_change(msg.content.uhub);
|
||||
break;
|
||||
case USB_MSG_CALLBACK:
|
||||
/* invoke callback */
|
||||
@@ -582,15 +582,16 @@ static void rt_usbh_hub_thread_entry(void* parameter)
|
||||
* This function will post an message to the usb message queue,
|
||||
*
|
||||
* @param msg the message to be posted
|
||||
* @param size the size of the message .
|
||||
*
|
||||
* @return the error code, RT_EOK on successfully.
|
||||
*/
|
||||
rt_err_t rt_usbh_event_signal(struct uhost_msg* msg)
|
||||
rt_err_t rt_usb_post_event(struct uhost_msg* msg, rt_size_t size)
|
||||
{
|
||||
RT_ASSERT(msg != RT_NULL);
|
||||
|
||||
/* send message to usb message queue */
|
||||
rt_mq_send(usb_mq, (void*)msg, sizeof(struct uhost_msg));
|
||||
rt_mq_send(usb_mq, (void*)msg, size);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
@@ -601,7 +602,7 @@ rt_err_t rt_usbh_event_signal(struct uhost_msg* msg)
|
||||
* @return none.
|
||||
*
|
||||
*/
|
||||
void rt_usbh_hub_init(void)
|
||||
void rt_usb_hub_thread(void)
|
||||
{
|
||||
rt_thread_t thread;
|
||||
|
||||
@@ -609,7 +610,7 @@ void rt_usbh_hub_init(void)
|
||||
usb_mq = rt_mq_create("usbh", 32, 16, RT_IPC_FLAG_FIFO);
|
||||
|
||||
/* create usb hub thread */
|
||||
thread = rt_thread_create("usbh", rt_usbh_hub_thread_entry, RT_NULL,
|
||||
thread = rt_thread_create("usbh", rt_usb_hub_thread_entry, RT_NULL,
|
||||
USB_THREAD_STACK_SIZE, 8, 20);
|
||||
if(thread != RT_NULL)
|
||||
{
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
#include <rtthread.h>
|
||||
#include <drivers/usb_host.h>
|
||||
|
||||
#define USB_HOST_CONTROLLER_NAME "usbh"
|
||||
|
||||
#if defined(RT_USBH_HID_KEYBOARD) || defined(RT_USBH_HID_MOUSE)
|
||||
#if defined(RT_USB_HID_KEYBOARD) || defined(RT_USB_HID_MOUSE)
|
||||
#include <hid.h>
|
||||
#endif
|
||||
|
||||
@@ -36,64 +34,54 @@
|
||||
*
|
||||
* @return none.
|
||||
*/
|
||||
rt_err_t rt_usb_host_init(void)
|
||||
int rt_usb_host_init(void)
|
||||
{
|
||||
ucd_t drv;
|
||||
rt_device_t uhc;
|
||||
#ifdef RT_USBH_HID
|
||||
#ifdef RT_USB_CLASS_HID
|
||||
uprotocal_t protocal;
|
||||
#endif
|
||||
|
||||
uhc = rt_device_find(USB_HOST_CONTROLLER_NAME);
|
||||
if(uhc == RT_NULL)
|
||||
{
|
||||
rt_kprintf("can't find usb host controller %s\n", USB_HOST_CONTROLLER_NAME);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* initialize usb hub */
|
||||
rt_usbh_hub_init();
|
||||
/* initialize usb hub thread */
|
||||
rt_usb_hub_thread();
|
||||
|
||||
/* initialize class driver */
|
||||
rt_usbh_class_driver_init();
|
||||
rt_usb_class_driver_init();
|
||||
|
||||
#ifdef RT_USBH_MSTORAGE
|
||||
#ifdef RT_USB_CLASS_MASS_STORAGE
|
||||
/* register mass storage class driver */
|
||||
drv = rt_usbh_class_driver_storage();
|
||||
rt_usbh_class_driver_register(drv);
|
||||
drv = rt_usb_class_driver_storage();
|
||||
rt_usb_class_driver_register(drv);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USBH_HID
|
||||
#ifdef RT_USB_CLASS_HID
|
||||
/* register hid class driver */
|
||||
drv = rt_usbh_class_driver_hid();
|
||||
rt_usbh_class_driver_register(drv);
|
||||
drv = rt_usb_class_driver_hid();
|
||||
rt_usb_class_driver_register(drv);
|
||||
|
||||
#ifdef RT_USBH_HID_KEYBOARD
|
||||
#ifdef RT_USB_HID_KEYBOARD
|
||||
/* register hid keyboard protocal */
|
||||
protocal = rt_usbh_hid_protocal_kbd();
|
||||
rt_usbh_hid_protocal_register(protocal);
|
||||
protocal = rt_usb_hid_protocal_kbd();
|
||||
rt_usb_hid_protocal_register(protocal);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USBH_HID_MOUSE
|
||||
#ifdef RT_USB_HID_MOUSE
|
||||
/* register hid mouse protocal */
|
||||
protocal = rt_usbh_hid_protocal_mouse();
|
||||
rt_usbh_hid_protocal_register(protocal);
|
||||
protocal = rt_usb_hid_protocal_mouse();
|
||||
rt_usb_hid_protocal_register(protocal);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef RT_USBH_ADK
|
||||
#ifdef RT_USB_CLASS_ADK
|
||||
/* register adk class driver */
|
||||
drv = rt_usbh_class_driver_adk();
|
||||
rt_usbh_class_driver_register(drv);
|
||||
drv = rt_usb_class_driver_adk();
|
||||
rt_usb_class_driver_register(drv);
|
||||
#endif
|
||||
|
||||
/* register hub class driver */
|
||||
drv = rt_usbh_class_driver_hub();
|
||||
rt_usbh_class_driver_register(drv);
|
||||
drv = rt_usb_class_driver_hub();
|
||||
rt_usb_class_driver_register(drv);
|
||||
|
||||
/* initialize usb host controller */
|
||||
rt_device_init(uhc);
|
||||
|
||||
return RT_EOK;
|
||||
return 0;
|
||||
}
|
||||
INIT_COMPONENT_EXPORT(rt_usb_host_init);
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd + '/../include']
|
||||
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_WDT'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* File : watchdog.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2012-2014, Shanghai Real-Thread Electronic Technology Co.,Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2012-09-12 heyuanjie87 first version.
|
||||
* 2014-03-04 Bernard code cleanup
|
||||
*/
|
||||
|
||||
#include <drivers/watchdog.h>
|
||||
|
||||
/* RT-Thread Device Interface */
|
||||
|
||||
/*
|
||||
* This function initializes serial
|
||||
*/
|
||||
static rt_err_t rt_watchdog_init(struct rt_device *dev)
|
||||
{
|
||||
rt_watchdog_t *wtd;
|
||||
|
||||
RT_ASSERT(dev != RT_NULL);
|
||||
wtd = (rt_watchdog_t *)dev;
|
||||
if (wtd->ops->init)
|
||||
{
|
||||
return (wtd->ops->init(wtd));
|
||||
}
|
||||
|
||||
return (-RT_ENOSYS);
|
||||
}
|
||||
|
||||
static rt_err_t rt_watchdog_open(struct rt_device *dev, rt_uint16_t oflag)
|
||||
{
|
||||
return (RT_EOK);
|
||||
}
|
||||
|
||||
static rt_err_t rt_watchdog_close(struct rt_device *dev)
|
||||
{
|
||||
rt_watchdog_t *wtd;
|
||||
|
||||
RT_ASSERT(dev != RT_NULL);
|
||||
wtd = (rt_watchdog_t *)dev;
|
||||
|
||||
if (wtd->ops->control(wtd, RT_DEVICE_CTRL_WDT_STOP, RT_NULL) != RT_EOK)
|
||||
{
|
||||
rt_kprintf(" This watchdog can not be stoped\n");
|
||||
|
||||
return (-RT_ERROR);
|
||||
}
|
||||
|
||||
return (RT_EOK);
|
||||
}
|
||||
|
||||
static rt_err_t rt_watchdog_control(struct rt_device *dev,
|
||||
rt_uint8_t cmd,
|
||||
void *args)
|
||||
{
|
||||
rt_watchdog_t *wtd;
|
||||
|
||||
RT_ASSERT(dev != RT_NULL);
|
||||
wtd = (rt_watchdog_t *)dev;
|
||||
|
||||
return (wtd->ops->control(wtd, cmd, args));
|
||||
}
|
||||
|
||||
/**
|
||||
* This function register a watchdog device
|
||||
*/
|
||||
rt_err_t rt_hw_watchdog_register(struct rt_watchdog_device *wtd,
|
||||
const char *name,
|
||||
rt_uint32_t flag,
|
||||
void *data)
|
||||
{
|
||||
struct rt_device *device;
|
||||
RT_ASSERT(wtd != RT_NULL);
|
||||
|
||||
device = &(wtd->parent);
|
||||
|
||||
device->type = RT_Device_Class_Miscellaneous;
|
||||
device->rx_indicate = RT_NULL;
|
||||
device->tx_complete = RT_NULL;
|
||||
|
||||
device->init = rt_watchdog_init;
|
||||
device->open = rt_watchdog_open;
|
||||
device->close = rt_watchdog_close;
|
||||
device->read = RT_NULL;
|
||||
device->write = RT_NULL;
|
||||
device->control = rt_watchdog_control;
|
||||
device->user_data = data;
|
||||
|
||||
/* register a character device */
|
||||
return rt_device_register(device, name, flag);
|
||||
}
|
||||
46
components/external/espruino/CONTRIBUTING.md
vendored
46
components/external/espruino/CONTRIBUTING.md
vendored
@@ -1,46 +0,0 @@
|
||||
Contributing
|
||||
===========
|
||||
|
||||
Thanks for thinking about contributing to Espruino! Anything you can add is hugely appreciated, but please can you follow a few simple rules:
|
||||
|
||||
* Keep the same coding style (See **Coding Style** below)
|
||||
* Ensure that you are not contributing someone else's code, and that you are willing to add your code under Espruino's MPL Licence
|
||||
* Make sure that what you do doesn't break the Espruino board or the other boards we build for. We can't check all the boards for every commit, so if you break something you'll annoy a whole bunch of people.
|
||||
* Be aware that Espruino is designed for Microcontrollers - with very low amounts of flash and memory. Both are at a premium so don't statically allocate variables or do other stuff that will use up memory.
|
||||
* Avoid randomly adding newlines, spaces, refactoring everything or renaming things to your own personal style (some things really could do with renaming, but please check first or we may reject your pull request)
|
||||
* Don't add a whole bunch of indirection/abstraction for the sake of it - it'll probably just use of more of our precious memory.
|
||||
* If you add a new API, try and make it familiar to Arduino/JavaScript users.
|
||||
|
||||
Target Areas
|
||||
-----------
|
||||
|
||||
We'll keep the outstanding issues in GitHub's issue list, but general stuff that would really help us is:
|
||||
|
||||
* Tests. If something doesn't work, please make a test for it. Even if you don't fix it it'll help others greatly. Bonus points if it's in a pull request :)
|
||||
* Documentation. Improving the documentation (either the EspruinoDocs project, or the auto-generated reference) would be fantastic.
|
||||
* Duplication. If the same code is used for multiple platforms, try and make sure it's shared, not duplicated.
|
||||
* Remove hard-coded stuff. Various things like the SPI filesystem are still hard-coded with ifdefs for each board - we want all that stuff to be generated from build_platform_info.py
|
||||
* Speed. There are a few areas this could be improved - but please benchmark what you're doing both before and afterwards on the Espruino board to check that what you've done helps
|
||||
* Memory Usage. Both RAM and Flash are at a premium. Ways of reducing this (including stack usage) and making usage more efficient are really appreciated.
|
||||
* JavaScript compliance (without affecting speed or memory usage too much).
|
||||
|
||||
Contributing
|
||||
-----------
|
||||
|
||||
* Please RUN THE TESTS to check that there are no regressions
|
||||
* Issue us a pull request to [www.github.com/espruino] via GitHub
|
||||
* Please keep each request small (just include one fix per request)
|
||||
|
||||
Coding Style
|
||||
-----------
|
||||
|
||||
The rough coding style is as follows, but you should get a good idea from the code. If we've missed anything obvious please let us know!
|
||||
|
||||
* 2 Spaces for indents
|
||||
* Open curly braces on the same line
|
||||
* No Tabs used
|
||||
* Use bool for booleans - not int
|
||||
* ```//``` comments for single lines, ```/* ... */``` for multiple lines
|
||||
* Half-hearted Doxygen compatibility: use ```///<``` for function declaration documentation (if on same line), and ```/** ... */``` if doing it right before a function
|
||||
* Use new lines sparingly (only where it really makes sense)
|
||||
|
||||
515
components/external/espruino/ChangeLog
vendored
515
components/external/espruino/ChangeLog
vendored
@@ -1,515 +0,0 @@
|
||||
1v46 : ...
|
||||
|
||||
1v45 : Fix parseFloat("foo") not returning NaN (and assert) - fix #149
|
||||
Remove Integer.parseInt
|
||||
Fix parseInt("bar") - fix #150
|
||||
Ensure that maths ops with null do treat it as 0 rather than a string - fix #156
|
||||
Fix digitalPulse length (properly!) - fix #154
|
||||
Making sure that undefined gets cast to NaN
|
||||
Fix Array.indexOf() returns undefined instead of -1 - fix #155
|
||||
Moved memory() to process.memory() - added more info too
|
||||
Try and improve handling of PWM timer speeds
|
||||
Fixed varying SPI baud rates depending on device
|
||||
Makefile changes for OSX compile
|
||||
|
||||
1v44 : Modified build system to store binary names in the python definition
|
||||
Fix nasty regression involving losing code at the end of Strings
|
||||
Fix segfault when pinMode is called on an invalid pin
|
||||
Now disable interrupts during 4 bit SPI send - it's just too much otherwise
|
||||
Detect unfinished block comments in console (fix #138)
|
||||
Fix flash write on most 10XxB boards
|
||||
Fix PWM output on all STM32 boards
|
||||
General hardware tidy in prep for more intelligent device management
|
||||
Run initialisation code before setWatch, to make sure pullup/down is set beforehand
|
||||
Change 'Pin' datatype to be an unsigned char - makes tests easier
|
||||
Now use the hardware RTC for keeping system time. Allows proper deep sleep on Espruino board
|
||||
FINALLY - fix the USB VCP lost characters issue (#94)
|
||||
|
||||
1v43 : Added 'Modules' object with support for adding/removing cached modules
|
||||
Allow product ID to be changed via Makefile
|
||||
Fix documentation (and old-fashined Parsing style) for JSON
|
||||
build_jswrapper now outputs errors to stderr (more compatible with default (silent) build process)
|
||||
Fix issue when parsing quotes in strings
|
||||
Added void operator for closure minification compatibility
|
||||
Ensure that return takes the comma operator
|
||||
Fix issue where printing Infinity would crash Espruino (fix #129)
|
||||
Finally some working (extremely beta) cc3000 code
|
||||
Added jsvObjectGet/SetChild to simplify some wrappers
|
||||
'http' now uses JsVars for storage (so is suitable for non-linux devices)
|
||||
Turned 'http' into a library
|
||||
Added process.version and process.env (fix #131)
|
||||
Changed handling of 2nd arg of << so that precedence is correct
|
||||
Fixed handling of 'for (;;)'
|
||||
Fix lock leak in Module handling
|
||||
Update ST's library for the STM32F1
|
||||
Update ST's VCP implementation
|
||||
Added prefix operator (fix #130)
|
||||
Allow espruino for linux to be run with '#!' in scripts
|
||||
Fix indexOf on final element of strings (fix #133)
|
||||
Remove JSV_PARENTINFO, as it turns out JS doesn't keep track of function scopes anyway (fix #109)
|
||||
Make 'this' a keyword (now faster, more memory efficient)
|
||||
Make 'Hardware' (root) the default value of 'this'
|
||||
Add jsvArrayPushAndUnLock and modified code to use it (fix #135)
|
||||
Now remember I2C state (partial fix for #13)
|
||||
Replace 'pow' function with a smaller version - save ~2kb
|
||||
Shaved another 1200 bytes off jslTokenAsString
|
||||
Now store Pin state (fix for #13 on F1 parts, F4 still looks broken)
|
||||
Added Graphics.stringWidth
|
||||
Added internal Printf function
|
||||
Misc speed and code size improvements
|
||||
This version has gone to Seeed for use on the KickStarter boards
|
||||
|
||||
1v42 : [ebirger] allowing 'new' with no brackets
|
||||
Allow built-in functions with variable numbers of arguments (fix #83)
|
||||
Implement 'String' constructor in the normal way (fix #110)
|
||||
Fix regression with parsing constructors while not executing
|
||||
Allow multiple arguments to print and console.log (fix #92)
|
||||
Make 'arguments' array available in functions (fix #100)
|
||||
Fix an assert fail, and handle some potential memory leaks
|
||||
Don't show __proto__ and constructor with for..in, keys(), or JSON.stringify
|
||||
Make 'trace()' output more readable debug data for complex structures
|
||||
Fix memory leak whe parsing functions iwht variable numbers of arguments - fix #115
|
||||
Defined NaN
|
||||
Stop 'new undefined()' crashing Espruino - fix #120
|
||||
Get A13/A14 working on Espruino board (these were JTAG)
|
||||
Get bootloader size direct from Python (remove hard-coding)
|
||||
Fix '~' operator when acting on variables
|
||||
Made bootloader a bit more error tolerate (CRC on write)
|
||||
Added %=, /=, and *= operators (fix #121)
|
||||
Allowed Object.toString() to take a radix argument for integers (fix #125)
|
||||
Fix error message issue - broken strncat (fix #124)
|
||||
Add comma operator (fix #122)
|
||||
Added some basic code for STM32F429IDISCOVERY - not currently working though
|
||||
This version is the one sent off on the Test Harness (so will probably appear on boards)
|
||||
|
||||
1v41 : Fix Olimexino compile (https://github.com/espruino/Espruino/issues/6)
|
||||
[ebirger] Member constructors (eg. new a.b() )
|
||||
[ebirger] Ensuring integers with radix specifiers can still be parsed if a radix is specified
|
||||
Fix for tests/test_json_arraybuffer_001.js - iteration of arraybuffers of length==1
|
||||
Add Object.keys(...)
|
||||
More arraybuffer iteration fixes
|
||||
On linux, use built-in stringToFloat to aid debugging. Handle exponentials, fix #31
|
||||
'make serialflash' is now works correctly for Espruino Boards with bootloader
|
||||
setWatch(..A0);setWatch(..A0);clearWatch(1) does not now kill the other watch, fix #25
|
||||
One-based setTimeout/setWatch, fix #3
|
||||
Added Function.call and Function.apply, fix #54
|
||||
'http' and 'fs' are now libraries that need to be 'require'd, fix #8
|
||||
Updated pin info for STM32F103xC/D/E chips, fix #84
|
||||
Fixed linker script for STM32F4 (discovery board now works)
|
||||
Object prototypes are now Objects, fix #101
|
||||
Board docs now specify '3.3v' only pins fix #104
|
||||
Add Array.forEach
|
||||
Fix searching down >1 prototype to find functions (one more issue posted in #99)
|
||||
Fix "12345"/5 type issues (fix #90)
|
||||
'Consting' some string functions
|
||||
Fixing arrays with string indices that are actually numbers \o/ (fix #19)
|
||||
Released onto website
|
||||
|
||||
1v40 : Ensure that LCD.prototype.setPixel = function actually works
|
||||
Refactor LCD driver code to allow lcdInit (and start of making it non-platform-specific)
|
||||
Built 'LCD' support into linux/raspi/carambola
|
||||
Add initial SPI.send(ArrayBuffer) support - even if NO VALUES RETURNED
|
||||
Start of built-in Nokia 5110 LCD support
|
||||
Remove GPIO clock removal on sleep for now (it kills setWatch)
|
||||
Fix (sub)ArrayBuffer problems (test100.js)
|
||||
Added setDeepSleep - still beta put power consumption drops to 1mA
|
||||
Fix broken name for httpCRq.write
|
||||
Changed LCD to Graphics - added ability to render to ArrayBuffer
|
||||
Fix 8 char built-in class names
|
||||
Adding preliminary Sony SmartWatch support
|
||||
Adding preliminary support for completely bare 36 pin chip
|
||||
Fixing pin defs for Espruino board rev 1v1
|
||||
Added proper SDL/ArrayBuffer and JS Callback graphics support
|
||||
Added "ifdef" ability in build_jswrapper
|
||||
Take JSVAR_CACHE_SIZE out of jsutils and put it in the board config file
|
||||
Added JSV_PARENTINFO which will allow us to do things like setTimeout(foo.bar,10)
|
||||
Fixed arrays in non-executes streams - 'if (0) print([1,2,3]);'
|
||||
Added 'require' function loading modules from node_modules on SD card
|
||||
Added module cache to stop modules being re-loaded
|
||||
Renamed internal vars to start with '>' - much easier to distinguish for 'dump'/etc
|
||||
Only use parentInfo on functions
|
||||
Load all tests in test dir - don't do them by number
|
||||
Added 'zigzag' ordering for ArrayBuffer Graphics
|
||||
Added 'vertical_byte' ordering for ArrayBuffer Graphics
|
||||
toJSON now ignores 'hidden' object elements
|
||||
Special-case jsvArrayBufferIteratorSetIntegerValue
|
||||
Make SPI output an ArrayBuffer
|
||||
Use best out of 3 for DelayMicroseconds calibration - something seems flaky right after bootup
|
||||
Lines now drawn from p1 to p2 inclusive
|
||||
Events now use jshPushIOWatchEvent (should cut down on code) also fixed bug with watching pin #11
|
||||
Now remember if pinMode was set or not
|
||||
Transform ```code``` in JSON into a code tag in the documentation
|
||||
Graphics now supports FSMC for HY boards again
|
||||
Drawing vector fonts is now roughly the right size and position (still not 100%)
|
||||
Remove registration code
|
||||
Adding MPL licence
|
||||
Remove Arduino bit manipulation functions - nobody seems to use them anyway
|
||||
# of flash pages/etc now comes from board info
|
||||
[ebirger] Supply the correct arguments to Array.map
|
||||
[ebirger] Method calls and membership evaluation should be done on all factors (ee. [1,2,3].foo())
|
||||
[ebirger] When running multiple tests, only set up terminal once or it breaks the terminal window on exit
|
||||
Added STM32-style USB CDC bootloader for Espruino Boards
|
||||
Added scripts/create_espruino_image.sh to package up bootloader and espruino into one binary
|
||||
SHIPPED on Impatient developer boards
|
||||
|
||||
1v39 : Added Bitwise NOT operator
|
||||
Added Raspberry Pi version to ZIP (with HTTP support)
|
||||
Fixed load/save on Linux Devices
|
||||
Added pinMode function (to allow pull-ups/pull-downs to be turned on)
|
||||
SPI.send4bit/send8bit will now not mess up the final element
|
||||
changeInterval now clears up stored up callbacks (eg, setInterval(.., 0.01)...wait...changeInterval(...,20)
|
||||
Ctrl-C no longer prints anything, which avoids lockups
|
||||
No longer print "Execution Interrupted" if nothing was interrupted!
|
||||
Added >>>= >>= and <<=
|
||||
When entering text interactively, ensure that there are no trailing spaces
|
||||
|
||||
1v38 : Tweaks for Arduino IDE compile
|
||||
Removed '(char #)' from stack trace, as a bit pointless now
|
||||
Added better reporting of execution location when Ctrl-C pressed
|
||||
Urgent fix for non-working Olimexino since 1v33
|
||||
Fix string comparison when strings contain "\0"
|
||||
Added LED1/2/OSC/SD/etc to Olimexino Board docs
|
||||
|
||||
1v37 : Urgent fix - power saving code made it difficult to re-flash Espruino (now only apply this to Espruino Board)
|
||||
|
||||
1v36 : Fix documentation for Array.pop()
|
||||
Added some much better board documentation
|
||||
Fixed DAC output on F3
|
||||
Fixed DAC output on devices where PWM is also available and the alternate function is less than the DAC's
|
||||
|
||||
1v35 : Attempt to reduce power consumption when sleeping by turning off GPIO, and setting GPIOs to AIN on reset
|
||||
Fix F3 issue where ADC/DAC weren't picked up properly
|
||||
Tidy up register text and add KickStarter mention
|
||||
var a = {}; a[LED1]=0; - not converted to String
|
||||
JSON (and hence dump()) now dumps ArrayBuffer correctly
|
||||
|
||||
1v34 : Faster jshFromDeviceString
|
||||
Preliminary support for flow control on Serial receive
|
||||
Speed improvements by removing jsvGetRef from jsvUnLock
|
||||
fast 4 byte pre-check in jsvFindChildFromString
|
||||
Skip lock/unlock in FindChildFromString to help increase speed
|
||||
When we unplug USB, only go to the default console device IF that is the device we're currently on
|
||||
Support for custom Espruino board
|
||||
Added ArrayBufferView.interpolate
|
||||
16 bit SPI send for send4bit/sevrnd8bit (better reliability on low-end chips)
|
||||
Fix JSON dump of typed array
|
||||
Added Math.clip(x, min, max)
|
||||
When saving on flash, don't do jslTokenAsString properly
|
||||
B3/B4 move from alternate fn
|
||||
Fix incorrect reporting of analog pins
|
||||
Fix I2C.readFrom on STM32F1/4
|
||||
Make 1/2 == 0.5 (was being sensible before, but now follow JS spec)
|
||||
Ctrl-C while in timer fn clears timers (but not outside it)
|
||||
Fixed broken clearInterval from within setInterval
|
||||
Hopefully fixed issue on SSD1289 LCD controller
|
||||
Trigger wheel handler to use interrupts
|
||||
2D arraybuffer interpolation
|
||||
Added Math.wrap, fixed a lot of trigger issues
|
||||
Fixed SysTick priority/preempt problems
|
||||
Slowed the SysTick timer back down for everything
|
||||
Fix Int8Array signedness on F4 boards
|
||||
Refactored source code tree
|
||||
|
||||
1v33 : fix character encoding issue of "\16"+"1" != "\161"
|
||||
Refactoring of ArrayBuffer into iterator, and addition of a general purpose iterator
|
||||
Fancier assert for debugging
|
||||
jsvArrayJoin to use new iterator
|
||||
for (i in ...) to use new iterator
|
||||
I2C and SPI use new iterator
|
||||
Serial.write() - to allow single ints to easily be written
|
||||
changeInterval assert fail when given a function by accident
|
||||
added peek8/poke8/peek16/poke16
|
||||
memory() now takes account of command history size
|
||||
memory() on ARM reports the end address of the stack - so it can be used as a scratchpad with peek and poke
|
||||
Try and reduce code size by not inlining several functions
|
||||
No refs for StringExts - so we get one more byte per JsVar (~5%) more storage efficiency
|
||||
Move from jsvIsBuiltInFunction to computer-generated jswIsBuiltInFunction
|
||||
When creating Objects, check for built-in function BEFORE creating an Object class for it
|
||||
Built process now checks that flash usage is under the allowed value
|
||||
Added short compare to jswHandleFunctionCall to reduce code size
|
||||
Added 3 byte compare (4 byte read and AND off top byte) - faster, less code
|
||||
Auto-generate jsvGetBasicObjectName from docs
|
||||
No longer using refs for storing whether free or not - use flags with JSV_UNUSED and get one extra var with 8 bit refs
|
||||
Switch to using STRING_0...STRING_MAX in flags, rather than specific bits in JsVarFlags - allows more that 15 chars to be used per JsVar
|
||||
Make ArrayBuffers actually be ArrayBufferViews - saves on extra string-handling code at expense of one var
|
||||
Make sure Uint8Array,etc inherits from ArrayBufferView
|
||||
Fix issue where a '\0' coming in from serial was not put in e.data properly
|
||||
Don't inline some functions when we're trying to save on flash
|
||||
Re-use sin for cos, pow for sqrt to reduce code size
|
||||
|
||||
1v32 : Fixed embarassing issue with 0.999=="0.A"
|
||||
Added and checked Pin.writeAtTime on STM32
|
||||
Now don't allocate events array - just allocate directly, which saves memory and is faster (although slighty out of order)
|
||||
Docs: now Alphabetically sorted, and class instances not listed by accident
|
||||
Fix issue where Ctrl-C on ANY Serial port caused execution to be interrupted
|
||||
Updated busy indicator to cope with recent change to not allocate events in an array
|
||||
Fixed I2C on HY 2.4 board - I2C needed hard reset
|
||||
Added basic ArrayBuffers/TypedArray support
|
||||
Fix memory leak when error created with [] on a non-array/object
|
||||
Improved hyperlinking in documentation
|
||||
Fix I2C receive bug on F4
|
||||
Increased VL board's input buffer size
|
||||
|
||||
1v31 : Fix PWM output on TIMER1/8 pins of the STM32F4
|
||||
Fix PWM output for negated timers
|
||||
memory() now runs a GC pass
|
||||
Fixed multiple occurrence of functions in reference
|
||||
|
||||
1v30 : STM32F1: fixed AF issue meant peripherals would never return from AF mode
|
||||
STM32F1: When given an invalid pin, now reports if pins are 'af' or not
|
||||
Updated SPI.setup docs to mention that you can't mix AF and non-AF
|
||||
If one SPI pin is specified but others aren't, only that pin will be set up
|
||||
Added Olimexino hack so SPI1.setup works as expected
|
||||
Allow using [] on a function
|
||||
Fix precedence issue, so var a = function() { return 1; }(); works
|
||||
Update SPI documentation
|
||||
for (i in f) can now iterate over functions
|
||||
Optional argument to trace() for object to start tracing from
|
||||
Small steps towards ArrayBuffers
|
||||
Added smart edit that checks for internal functions, and uses Function.replaceWith
|
||||
Added Function.replaceWith to replace the internals of a function while keeping the scope
|
||||
|
||||
1v29 : Some hacky sysfs-based IO for running on Linux
|
||||
HTTP Callbacks are now stored as names so they can be changed on the fly (Linux only)
|
||||
Successful compile for Carambola
|
||||
Filesystem support on Linux
|
||||
Switch to variable size ref counter (marginally more efficient on very small devices, safe on Linux)
|
||||
Linux now has unlimited memory available
|
||||
Added linux/sysfs 'setWatch' (non-irq driven, so very noddy)
|
||||
Checked jswrapper check from using multi-char constants to a #define
|
||||
Improve pin suggestions for SPI/I2C/USART
|
||||
Auto-initialise USART with default values when setConsole is used
|
||||
Support for new Graphics LCD types
|
||||
3.2" VCT6 board support
|
||||
|
||||
1v28 : Faster LCD fillrect for HY 2.8
|
||||
Fix for multi-byte SPI writes on HY board at 1Mhz (touchscreen control bug)
|
||||
Fix issue with delayMicrosecond calibration on HY (and hence OneWire)
|
||||
Fixed digitalPulse on STM32VLDISCOVERY
|
||||
|
||||
1v27 : Fixed problem with OneWire constructor execution
|
||||
Added |=, &= and ^=
|
||||
Added Array.splice()
|
||||
Faster, more ROM-efficient built-in symbol table
|
||||
Fix for potential issue when using field accessor on an undefined var
|
||||
|
||||
1v26 : I2C Support on STM32F1 and STM32F4 boards too
|
||||
Emergency cut in variables for Olimexino with bootloader (as flash usage has got too high for save to flash!)
|
||||
|
||||
1v25 : http.writeHead to accept an empty header
|
||||
Fixed issue finding methods on built in classes (0 termination)
|
||||
make sure http server with no data still sends headers...
|
||||
Start of MINI-HY-2.8" support (all ok, but no SD card yet)
|
||||
Reduce RAM usage by consting some arrays that are not modified
|
||||
Vector fonts now use polys - 8kb less ROM, and faster rendering
|
||||
Start of LCD 'driver' code
|
||||
Standard way of handling events, Object.on/emit/removeAllListeners - like Node.js's EventEmitter
|
||||
Self-calibrating Microsecond delay (for intermal OneWire/etc)
|
||||
OneWire class
|
||||
Correct handling of built-in class constructors
|
||||
Fix error when parsing a zero-argument function that has been given arguments
|
||||
I2C support - currently ONLY tested on STM32F3 board
|
||||
|
||||
1v24 : SDIO-based fat driver on the HY STM32 board
|
||||
Added DAC to the HY boards (103xE-based)
|
||||
Re-named the fileSystem functions to make them more compatible with node.js (readFile/writeFile/etc)
|
||||
Added fs.appendFile
|
||||
Removed HTTP from the reference until it is included in some boards
|
||||
|
||||
1v23 : Fix 'ERROR: INTERNAL: stmADCChannel' on STM32VLDISCOVERY/F1 boards when accessing PA0
|
||||
Reference now mentions which Espruino version it is for
|
||||
|
||||
1v22 : Important fix - Events got executed in the wrong order if they got queued up
|
||||
|
||||
1v21 : Ensure SPI clock does not stop between bytes
|
||||
Added SPI.send4bit and SPI.send8bit
|
||||
Made sure the VL board's code fits into available flash
|
||||
Smart += that can append to a string rather than cloning it
|
||||
dump() prints functions properly, rather than 'var f = function() {}'
|
||||
Pageup/down move the cursor to the beginning/end of input
|
||||
LCD draw/fill with negative x and y
|
||||
|
||||
1v20 : Add console.log
|
||||
Fix automatic usleep for Linux
|
||||
Added node.js-style HTTP server for Linux version
|
||||
Fixed null-pointer issue when accessing something that doesn't exist on an object
|
||||
Added node.js-style HTTP client for Linux version
|
||||
Start of bit bashing functionality
|
||||
for (i in "ABCD") console.log(i) -> 0,1,2,3
|
||||
String array access (but not for writing - doesn't work in JS anyway)
|
||||
String String.fromCharCode / charCodeAt
|
||||
Added SPI baud rate setting
|
||||
Vector font chars 'a' and '4' now work ok
|
||||
Fix numeric exception when rendering a poly that has some identical points
|
||||
Better digitalPulse (uses timer + interrupts)
|
||||
analogWrite can now take an object with a 'frequency' argument for PWM
|
||||
|
||||
1v19 : Fixed issue where var M=Math;M.random() failed
|
||||
Fixed issue with var U=USB;U.print("Hello");
|
||||
Remove loop iteration limit
|
||||
Fix memory leak when a syntax error is in for '(i in arr)'
|
||||
Save state of pin on setWatch interrupt (e.state)
|
||||
Change setWatch to allow only on rise or fall as an option
|
||||
clearWatch() clears all watches
|
||||
|
||||
1v18 : DAC support on F3/F4
|
||||
Serial.setup() can also take a second parameter of an object {tx,rx}
|
||||
Better support for dump() with echo/setBusyIndicator/etc
|
||||
Better dumping of prototypes on built-in vars
|
||||
Don't add chars<32 (Except tab) to the input line
|
||||
SPI1/2/3/4.setup() to take an object {baud,sck,miso,mosi}
|
||||
Better hardware initialisation code (not UARTS auto-init if they are used)
|
||||
Fix issues with prototypes
|
||||
Peek/poke instructions
|
||||
Start of I2C support (not usable yet)
|
||||
Added Math. ceil/floor/exp/log
|
||||
|
||||
1v17 : Support for running alongside the Maple bootloader
|
||||
Fix parsing of numbers beginning with 0 when forceRadix!=8
|
||||
Fixed USART1 on Maple/Olimexino devices
|
||||
|
||||
1v16 : Inlining of jsvLock/UnLock in jsvar.h to improve speed
|
||||
Move non-hardware-dependent stuff into jsdevices
|
||||
Move jshardware.c into targets/stm32/jshardware.c, create 'targets/linux' and use a single makefile
|
||||
For + While loops work without reallocating lex
|
||||
Fix AddNativeFunction when function already exists (and tests + saved state)
|
||||
Change jsvFindChildFromX to use JsVar* from JsVarRef - saves a lot of lock/unlock
|
||||
Handle new Foo() as per spec (return value + init of this+prototype) - still does not cope with non-object prototype
|
||||
Beginning of SD card support (works on Olimexino, but not very flexible)
|
||||
Fix for parse/eval when given non-strings
|
||||
Strings can now contain '\0'
|
||||
Jumptable-friendly reserved word check
|
||||
Jumptable-friendly builtin functions (massive refactor)
|
||||
SPI support
|
||||
HY board support, and graphics LCD
|
||||
Added fillPoly, and Vector fonts
|
||||
Added Registration code
|
||||
Fixed some undefined function/array warnings
|
||||
Much better HTML function documentation
|
||||
Fixed edit() function
|
||||
STM32F3 support, and now peripheral stuff is done with a script
|
||||
explain what pins are available if a pin is not capable of requested fn
|
||||
power on ADCs only when needed
|
||||
LCD fillPoly speed improvements, + drawLine
|
||||
Add datatype for Pin, so pins written to console by pin name rather than integer value.
|
||||
Added Pin.set/Pin.reset
|
||||
Change warning about 'undefined.' into an error (foo.reset() had unexpected consequences!)
|
||||
Fix parsing of '1.0/-3'!
|
||||
Add typeof and instanceof operators
|
||||
Ensure that Serial1/SPI1/etc are objects of type 'Serial'/'SPI' - so prototypes can be added
|
||||
|
||||
1v15 : Escaping JSON strings
|
||||
Fix parsing of octal numbers in strings (so don't have to be 3 chars long)
|
||||
Drastically improved stack usage using small stub functions (at expense of a bit of speed)
|
||||
dump() also dumps out prototypes for functions
|
||||
|
||||
1v14 : Fix complaint about pins during setBusyIndicator()
|
||||
Increase available memory on OLIMEXINO
|
||||
Added function memory() to return memory usage
|
||||
setWatch now links to function names (rather than just functions)
|
||||
dump() also handles Serial.onData(...)
|
||||
Fix issue with JSON printing functions with arguments to console
|
||||
prefix builtin variables with '_'
|
||||
fix ArrayIndexOf when array contains undefineds
|
||||
move all devices into one git repository
|
||||
USB on F4
|
||||
call onInit function/string if it exists when Espruino powers on
|
||||
Compile F4 with -O2 - as we have the program memory for it
|
||||
Serial3/4/5/6 on F4
|
||||
Serial3 on Olimexino
|
||||
Make Serial.onData() clear onData handler
|
||||
|
||||
1v13 : Operations like + on Object/Array convert them to strings rather than error
|
||||
var now doesn't error if there is no semi-colon
|
||||
Allow new line or line delete in multi-line editing
|
||||
add edit(functionName) - which copies function definition into inputline so it can be updated
|
||||
When printing lines, delete current inputline and then put it back in idle loop (only if echo=1)
|
||||
Support *,/ etc on numpad
|
||||
|
||||
1v12 : Issue when printing lots of data and then disconnect USB
|
||||
Hide USB/Serial in Dump()
|
||||
add Array.map(fn(x), thisArg)
|
||||
For newline, count [] and () (as well as {}) - also knows about comments/strings/etc
|
||||
Fix assert fail is setTimeout with non-function
|
||||
If space at end of input line, enter still executes
|
||||
Removed some hard-coded arrays in favour of JsVar strings
|
||||
Fix confusion with jsvIsName/jsvIsString
|
||||
Handle numpad end key
|
||||
Add code to check stack and stop stack overflow if too much recursion
|
||||
Ensure that setTimeout/setWatch store the link to a function, not the function
|
||||
Fix nasty ref loop in ref loop GC issue
|
||||
Add dotty output
|
||||
Fix memory leak when error in jspParseSingleFunction
|
||||
Now run Garbage collection if we're idle, and we know we have a few ms spare
|
||||
Added setSleepIndicator
|
||||
Fix line/col indicator in errors/warnings
|
||||
Fix JSON parsing and printing when 'undefined' encountered
|
||||
Rewritten object handling code to be way more standard JavaScript compliant
|
||||
Array initialisation with 'new Array()', also for Strings
|
||||
Added a few more built in functions
|
||||
Nice error reporting with line + pointer
|
||||
fixed Math.random
|
||||
Binary style ops on doubles now work - they are just converted to ints
|
||||
Added boolean datatype
|
||||
|
||||
1v11 : Add Math functions
|
||||
Add command history (and dynamic history free if low memory)
|
||||
Fix broken jsvArrayPop
|
||||
Add tests for and fix Array.indexOf
|
||||
In-line editing for commands
|
||||
Fix bug in basicVarEquals for big strings
|
||||
More fixes for low memory conditions
|
||||
Multi-line edit for commands (but no newline or line delete yet)
|
||||
Handle Home, End + reverse delete keys
|
||||
Fix nested for loops not handling interrupts correctly
|
||||
Fix AppendString issue when given start value greater than string
|
||||
Add 'changeInterval' to allow things created with setInterval to have the frequency changed (eg. stepper motor control)
|
||||
Now puts itself to sleep to save power, when it knows nothing is required and it'll be woken up by SysTick before
|
||||
Change Math library to avoid putting constants in RAM
|
||||
|
||||
1v10 : Increase FIFO size for VL
|
||||
Marginally decrease amount of F4 vars to ensure they all fit in one flash sector
|
||||
Allow strings to be longer than the max token size
|
||||
'"key" in obj' syntax
|
||||
Detect if in FOR or WHILE loop, and if not, disallow break and continue
|
||||
Change min setInterval time to 0.1ms - F4 can get close to this
|
||||
Better analog pin error message
|
||||
USB support on Olimexino/Maple
|
||||
Start of multiple COM port support (ioEvent queue)
|
||||
Ctrl-C now clears the input line
|
||||
Save state of 'echo' into flash with save()
|
||||
Add 'setBusyIndicator(pin)' to set pin high when Espruino is busy
|
||||
Inbuilt function handling speed improvements
|
||||
Allow Serial comms via other UARTS. Serial1/2.onData and print/println
|
||||
now inserts elements into arrays in the correct order (GetLength can be (is) now much faster)
|
||||
Faster code to work out pins from strings
|
||||
Automatically convert IDs in form A#,A##,B#,B## etc into numbers.
|
||||
Built-in constants for LED1/BTN/etc.
|
||||
|
||||
1v09 : Enabled 'abs' by default
|
||||
Added flash programming to STM32F4
|
||||
analogWrite now working!
|
||||
|
||||
1v08 : Add preliminary STM32F4 support
|
||||
Allowed test cases to test timers - eg. code in jsinteractive.c
|
||||
Fix memory leak for timer
|
||||
Fix memory leak for digitalWrite
|
||||
|
||||
1v07 : Fix string charAt
|
||||
Fix watch on different pin
|
||||
Pass arguments to event handlers - eg. time
|
||||
digitalWrite/Read to take arrays of pins, and int for value
|
||||
|
||||
1v06 : Add break + continue
|
||||
Add switch statement
|
||||
Handle /r, /r/n or just /n for newlines - phone compatible
|
||||
Handle different type of delete
|
||||
|
||||
1v05 : Allow setWatch/setTimeout/setInterval with a string
|
||||
Handle adding Open bracket then deleting it
|
||||
When calling a NAMED function, zero the scopes - this stops scope table overflow
|
||||
|
||||
1v04 : Renamed to Espruino
|
||||
Fixed issue with event add when out of memory
|
||||
If out of memory happens during a timer, kill all timers
|
||||
|
||||
378
components/external/espruino/LICENSE
vendored
378
components/external/espruino/LICENSE
vendored
@@ -1,378 +0,0 @@
|
||||
All files in this package are Copyright 2013 Gordon Williams, Pur3 Ltd unless
|
||||
otherwise noted.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
969
components/external/espruino/Makefile
vendored
969
components/external/espruino/Makefile
vendored
@@ -1,969 +0,0 @@
|
||||
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
|
||||
#
|
||||
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
# Makefile for Espruino
|
||||
# -----------------------------------------------------------------------------
|
||||
# Set ONE of the following environment variables to compile for that board:
|
||||
#
|
||||
# ESPRUINO_1V0=1 # Espruino board rev 1.0
|
||||
# ESPRUINO_1V1=1 # Espruino board rev 1.1 and 1.2
|
||||
# ESPRUINO_1V3=1 # Espruino board rev 1.3
|
||||
# OLIMEXINO_STM32=1 # Olimexino STM32
|
||||
# OLIMEXINO_STM32_BOOTLOADER=1 # Olimexino STM32 with bootloader
|
||||
# EMBEDDED_PI=1 # COOCOX STM32 Embedded Pi boards
|
||||
# HYSTM32_24=1 # HY STM32 2.4 Ebay boards
|
||||
# HYSTM32_28=1 # HY STM32 2.8 Ebay boards
|
||||
# HYSTM32_32=1 # HY STM32 3.2 VCT6 Ebay boards
|
||||
# STM32VLDISCOVERY=1
|
||||
# STM32F3DISCOVERY=1
|
||||
# STM32F4DISCOVERY=1
|
||||
# STM32F429IDISCOVERY=1
|
||||
# CARAMBOLA=1
|
||||
# RASPBERRYPI=1
|
||||
# LPC1768=1 # beta
|
||||
# LCTECH_STM32F103RBT6=1 # LC Technology STM32F103RBT6 Ebay boards
|
||||
# Or nothing for standard linux compile
|
||||
#
|
||||
# Also:
|
||||
#
|
||||
# DEBUG=1 # add debug symbols (-g)
|
||||
# RELEASE=1 # Force release-style compile (no asserts, etc)
|
||||
# SINGLETHREAD=1 # Compile single-threaded to make compilation errors easier to find
|
||||
# BOOTLOADER=1 # make the bootloader (not Espruino)
|
||||
# PROFILE=1 # Compile with gprof profiling info
|
||||
|
||||
ifndef SINGLETHREAD
|
||||
MAKEFLAGS=-j5 # multicore
|
||||
endif
|
||||
|
||||
INCLUDE=-I$(ROOT) -I$(ROOT)/targets -I$(ROOT)/src -I$(ROOT)/gen
|
||||
LIBS=
|
||||
DEFINES=
|
||||
CFLAGS=-Wall -Wextra -Wconversion -Werror=implicit-function-declaration -fdiagnostics-show-option
|
||||
OPTIMIZEFLAGS=
|
||||
#-fdiagnostics-show-option - shows which flags can be used with -Werror
|
||||
|
||||
# Espruino flags...
|
||||
USE_MATH=1
|
||||
|
||||
ifeq ($(shell uname -m),armv6l)
|
||||
RASPBERRYPI=1 # just a guess
|
||||
endif
|
||||
|
||||
ifeq ($(shell uname),Darwin)
|
||||
MACOSX=1
|
||||
endif
|
||||
|
||||
# Gordon's car ECU (extremely beta!)
|
||||
ifdef ECU
|
||||
STM32F4DISCOVERY=1
|
||||
#HYSTM32_32=1
|
||||
USE_TRIGGER=1
|
||||
DEFINES += -DECU
|
||||
endif
|
||||
|
||||
ifdef RELEASE
|
||||
# force no asserts to be compiled in
|
||||
DEFINES += -DNO_ASSERT
|
||||
endif
|
||||
|
||||
CWD = $(shell pwd)
|
||||
ROOT = $(CWD)
|
||||
PRECOMPILED_OBJS=
|
||||
PLATFORM_CONFIG_FILE=gen/platform_config.h
|
||||
BASEADDRESS=0x08000000
|
||||
|
||||
###################################################
|
||||
# When adding stuff here, also remember build_pininfo, platform_config.h, jshardware.c
|
||||
ifdef ESPRUINO_1V0
|
||||
USB=1
|
||||
#USE_NET=1
|
||||
#USE_CC3000=1
|
||||
USE_GRAPHICS=1
|
||||
USE_FILESYSTEM=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RG
|
||||
BOARD=ESPRUINOBOARD_R1_0
|
||||
DEFINES+=-DESPRUINOBOARD
|
||||
STLIB=STM32F10X_XL
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_hd.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef ESPRUINO_1V1
|
||||
DEFINES+=-DESPRUINO_1V1
|
||||
USE_BOOTLOADER=1
|
||||
BOOTLOADER_PROJ_NAME=bootloader_espruino_1v1
|
||||
USB=1
|
||||
USE_NET=1
|
||||
USE_CC3000=1
|
||||
USE_GRAPHICS=1
|
||||
USE_FILESYSTEM=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RC
|
||||
BOARD=ESPRUINOBOARD_R1_1
|
||||
DEFINES+=-DESPRUINOBOARD
|
||||
STLIB=STM32F10X_XL
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_hd.o
|
||||
OPTIMIZEFLAGS+=-Os # not that short on memory, but Travis compiler is old and uses more
|
||||
else ifdef ESPRUINO_1V3
|
||||
DEFINES+=-DESPRUINO_1V3
|
||||
USE_BOOTLOADER=1
|
||||
BOOTLOADER_PROJ_NAME=bootloader_espruino_1v3
|
||||
USB=1
|
||||
USE_NET=1
|
||||
USE_CC3000=1
|
||||
USE_GRAPHICS=1
|
||||
USE_FILESYSTEM=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RC
|
||||
BOARD=ESPRUINOBOARD
|
||||
STLIB=STM32F10X_XL
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_hd.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef OLIMEXINO_STM32
|
||||
USB=1
|
||||
USE_FILESYSTEM=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RB
|
||||
BOARD=OLIMEXINO_STM32
|
||||
STLIB=STM32F10X_MD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_md.o
|
||||
OPTIMIZEFLAGS+=-Os # short on program memory
|
||||
else ifdef OLIMEXINO_STM32_BOOTLOADER
|
||||
USB=1
|
||||
USE_FILESYSTEM=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RB_MAPLE
|
||||
DEFINES += -DSTM32F103RB
|
||||
SAVE_ON_FLASH=1
|
||||
BOARD=OLIMEXINO_STM32_BOOTLOADER
|
||||
STLIB=STM32F10X_MD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_md.o
|
||||
OPTIMIZEFLAGS+=-Os # short on program memory
|
||||
else ifdef EMBEDDED_PI
|
||||
USB=1
|
||||
# USE_FILESYSTEM=1 # no SD-CARD READER
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RB
|
||||
BOARD=EMBEDDED_PI
|
||||
STLIB=STM32F10X_MD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_md.o
|
||||
OPTIMIZEFLAGS+=-Os # short on program memory
|
||||
else ifdef HYSTM32_24
|
||||
USB=1
|
||||
USE_GRAPHICS=1
|
||||
USE_LCD_FSMC=1
|
||||
USE_FILESYSTEM=1
|
||||
USE_FILESYSTEM_SDIO=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103VE
|
||||
BOARD=HYSTM32_24
|
||||
STLIB=STM32F10X_HD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_hd.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef HYSTM32_28
|
||||
USB=1
|
||||
USE_GRAPHICS=1
|
||||
USE_LCD_FSMC=1
|
||||
DEFINES+=-DILI9325_BITBANG # bit-bang the LCD driver
|
||||
SAVE_ON_FLASH=1
|
||||
#USE_FILESYSTEM=1 # just normal SPI
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RB
|
||||
BOARD=HYSTM32_28
|
||||
STLIB=STM32F10X_MD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_md.o
|
||||
OPTIMIZEFLAGS+=-Os
|
||||
else ifdef HYSTM32_32
|
||||
USB=1
|
||||
USE_GRAPHICS=1
|
||||
USE_LCD_FSMC=1
|
||||
USE_FILESYSTEM=1
|
||||
USE_FILESYSTEM_SDIO=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103VC
|
||||
BOARD=HYSTM32_32
|
||||
STLIB=STM32F10X_HD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_hd.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef STM32F4DISCOVERY
|
||||
USB=1
|
||||
#USE_NET=1
|
||||
#USE_CC3000=1
|
||||
USE_GRAPHICS=1
|
||||
DEFINES += -DUSE_USB_OTG_FS=1
|
||||
FAMILY=STM32F4
|
||||
CHIP=STM32F407
|
||||
BOARD=STM32F4DISCOVERY
|
||||
STLIB=STM32F4XX
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f4/lib/startup_stm32f4xx.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef STM32F429IDISCOVERY
|
||||
USB=1
|
||||
USE_GRAPHICS=1
|
||||
#USE_LCD_FSMC=1
|
||||
DEFINES += -DUSE_USB_OTG_FS=1
|
||||
FAMILY=STM32F4
|
||||
CHIP=STM32F429
|
||||
BOARD=STM32F429IDISCOVERY
|
||||
STLIB=STM32F4XX
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f4/lib/startup_stm32f4xx.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef SMARTWATCH
|
||||
DEFINES+=-DHSE_VALUE=26000000UL
|
||||
USB=1
|
||||
FAMILY=STM32F2
|
||||
CHIP=STM32F205RG
|
||||
BOARD=SMARTWATCH
|
||||
STLIB=STM32F2XX
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f2/lib/startup_stm32f2xx.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef STM32F3DISCOVERY
|
||||
#USE_BOOTLOADER=1
|
||||
#BOOTLOADER_PROJ_NAME=bootloader_espruino_stm32f3discovery
|
||||
USB=1
|
||||
FAMILY=STM32F3
|
||||
CHIP=STM32F303
|
||||
BOARD=STM32F3DISCOVERY
|
||||
STLIB=STM32F3XX
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f3/lib/startup_stm32f30x.o
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef STM32VLDISCOVERY
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F100RB
|
||||
BOARD=STM32VLDISCOVERY
|
||||
STLIB=STM32F10X_MD_VL
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_md_vl.o
|
||||
OPTIMIZEFLAGS+=-Os # short on program memory
|
||||
else ifdef TINYCHIP
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103TB
|
||||
BOARD=TINYCHIP
|
||||
STLIB=STM32F10X_MD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_md.o
|
||||
OPTIMIZEFLAGS+=-Os # short on program memory
|
||||
else ifdef LPC1768
|
||||
MBED=1
|
||||
FAMILY=LPC1768
|
||||
CHIP=LPC1768
|
||||
BOARD=LPC1768
|
||||
MBED_GCC_CS_DIR=$(ROOT)/targets/libmbed/LPC1768/GCC_CS
|
||||
PRECOMPILED_OBJS+=$(MBED_GCC_CS_DIR)/sys.o $(MBED_GCC_CS_DIR)/cmsis_nvic.o $(MBED_GCC_CS_DIR)/system_LPC17xx.o $(MBED_GCC_CS_DIR)/core_cm3.o $(MBED_GCC_CS_DIR)/startup_LPC17xx.o
|
||||
LIBS+=-L$(MBED_GCC_CS_DIR) -lmbed
|
||||
OPTIMIZEFLAGS+=-O3
|
||||
else ifdef CARAMBOLA
|
||||
BOARD=CARAMBOLA
|
||||
DEFINES += -DCARAMBOLA -DSYSFS_GPIO_DIR="\"/sys/class/gpio\""
|
||||
LINUX=1
|
||||
USE_FILESYSTEM=1
|
||||
USB=1
|
||||
USE_GRAPHICS=1
|
||||
USE_NET=1
|
||||
else ifdef RASPBERRYPI
|
||||
BOARD=RASPBERRYPI
|
||||
DEFINES += -DRASPBERRYPI -DSYSFS_GPIO_DIR="\"/sys/class/gpio\""
|
||||
LINUX=1
|
||||
USE_FILESYSTEM=1
|
||||
USB=1
|
||||
USE_GRAPHICS=1
|
||||
#USE_LCD_SDL=1
|
||||
USE_NET=1
|
||||
else ifdef LCTECH_STM32F103RBT6
|
||||
USB=1
|
||||
SAVE_ON_FLASH=1
|
||||
FAMILY=STM32F1
|
||||
CHIP=STM32F103RB
|
||||
BOARD=LCTECH_STM32F103RBT6
|
||||
STLIB=STM32F10X_MD
|
||||
PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f1/lib/startup_stm32f10x_md.o
|
||||
OPTIMIZEFLAGS+=-Os
|
||||
else
|
||||
BOARD=LINUX
|
||||
LINUX=1
|
||||
USE_FILESYSTEM=1
|
||||
USB=1
|
||||
USE_GRAPHICS=1
|
||||
#USE_LCD_SDL=1
|
||||
ifndef MACOSX
|
||||
# http libs need some tweaks before net can compile
|
||||
USE_NET=1
|
||||
endif
|
||||
endif
|
||||
|
||||
PROJ_NAME=$(shell python scripts/get_binary_name.py $(BOARD) | sed -e "s/.bin$$//")
|
||||
ifeq ($(PROJ_NAME),)
|
||||
$(error Unable to work out binary name (PROJ_NAME))
|
||||
endif
|
||||
ifeq ($(BOARD),LINUX)
|
||||
PROJ_NAME=espruino
|
||||
endif
|
||||
|
||||
|
||||
|
||||
ifdef DEBUG
|
||||
#OPTIMIZEFLAGS=-Os -g
|
||||
OPTIMIZEFLAGS=-g
|
||||
endif
|
||||
|
||||
ifdef PROFILE
|
||||
OPTIMIZEFLAGS+=-pg
|
||||
endif
|
||||
|
||||
WRAPPERFILE=gen/jswrapper.c
|
||||
WRAPPERSOURCES = \
|
||||
src/jswrap_pin.c \
|
||||
src/jswrap_functions.c \
|
||||
src/jswrap_modules.c \
|
||||
src/jswrap_process.c \
|
||||
src/jswrap_interactive.c \
|
||||
src/jswrap_json.c \
|
||||
src/jswrap_object.c \
|
||||
src/jswrap_string.c \
|
||||
src/jswrap_array.c \
|
||||
src/jswrap_arraybuffer.c \
|
||||
src/jswrap_serial.c \
|
||||
src/jswrap_spi_i2c.c \
|
||||
src/jswrap_onewire.c \
|
||||
src/jswrap_io.c
|
||||
# it is important that _pin comes before stuff which uses
|
||||
# integers (as the check for int *includes* the chek for pin)
|
||||
|
||||
SOURCES = \
|
||||
src/jslex.c \
|
||||
src/jsvar.c \
|
||||
src/jsutils.c \
|
||||
src/jsparse.c \
|
||||
src/jspin.c \
|
||||
src/jsinteractive.c \
|
||||
src/jsdevices.c \
|
||||
$(WRAPPERFILE)
|
||||
CPPSOURCES =
|
||||
|
||||
ifdef BOOTLOADER
|
||||
ifndef USE_BOOTLOADER
|
||||
$(error Using bootloader on device that is not expecting one)
|
||||
endif
|
||||
BUILD_LINKER_FLAGS+=--bootloader
|
||||
PROJ_NAME=$(BOOTLOADER_PROJ_NAME)
|
||||
WRAPPERSOURCES =
|
||||
SOURCES = \
|
||||
targets/stm32_boot/main.c \
|
||||
targets/stm32_boot/utils.c
|
||||
ifndef DEBUG
|
||||
OPTIMIZEFLAGS=-Os
|
||||
endif
|
||||
else # !BOOTLOADER
|
||||
ifdef USE_BOOTLOADER
|
||||
BUILD_LINKER_FLAGS+=--using_bootloader
|
||||
STM32LOADER_FLAGS+=-p /dev/ttyACM0
|
||||
BASEADDRESS=$(shell python -c "import sys;sys.path.append('scripts');import common;print hex(0x08000000+common.get_bootloader_size())")
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USB_PRODUCT_ID
|
||||
DEFINES+=-DUSB_PRODUCT_ID=$(USB_PRODUCT_ID)
|
||||
endif
|
||||
|
||||
ifdef SAVE_ON_FLASH
|
||||
DEFINES+=-DSAVE_ON_FLASH
|
||||
endif
|
||||
|
||||
ifdef USE_FILESYSTEM
|
||||
DEFINES += -DUSE_FILESYSTEM
|
||||
WRAPPERSOURCES += libs/jswrap_fat.c
|
||||
ifndef LINUX
|
||||
INCLUDE += -I$(ROOT)/libs/fat_sd
|
||||
SOURCES += \
|
||||
libs/fat_sd/fattime.c \
|
||||
libs/fat_sd/ff.c
|
||||
#libs/fat_sd/option/ccsbcs.c # for LFN support (see _USE_LFN in ff.h)
|
||||
|
||||
ifdef USE_FILESYSTEM_SDIO
|
||||
DEFINES += -DUSE_FILESYSTEM_SDIO
|
||||
SOURCES += \
|
||||
libs/fat_sd/sdio_diskio.c \
|
||||
libs/fat_sd/sdio_sdcard.c
|
||||
else #USE_FILESYSTEM_SDIO
|
||||
SOURCES += \
|
||||
libs/fat_sd/spi_diskio.c
|
||||
endif #USE_FILESYSTEM_SDIO
|
||||
endif #!LINUX
|
||||
endif #USE_FILESYSTEM
|
||||
|
||||
ifdef USE_MATH
|
||||
DEFINES += -DUSE_MATH
|
||||
WRAPPERSOURCES += libs/jswrap_math.c
|
||||
|
||||
ifndef LINUX
|
||||
INCLUDE += -I$(ROOT)/libs/math
|
||||
SOURCES += \
|
||||
libs/math/acosh.c \
|
||||
libs/math/asin.c \
|
||||
libs/math/asinh.c \
|
||||
libs/math/atan.c \
|
||||
libs/math/atanh.c \
|
||||
libs/math/cbrt.c \
|
||||
libs/math/chbevl.c \
|
||||
libs/math/clog.c \
|
||||
libs/math/cmplx.c \
|
||||
libs/math/const.c \
|
||||
libs/math/cosh.c \
|
||||
libs/math/drand.c \
|
||||
libs/math/exp10.c \
|
||||
libs/math/exp2.c \
|
||||
libs/math/exp.c \
|
||||
libs/math/fabs.c \
|
||||
libs/math/floor.c \
|
||||
libs/math/isnan.c \
|
||||
libs/math/log10.c \
|
||||
libs/math/log2.c \
|
||||
libs/math/log.c \
|
||||
libs/math/mtherr.c \
|
||||
libs/math/polevl.c \
|
||||
libs/math/pow.c \
|
||||
libs/math/powi.c \
|
||||
libs/math/round.c \
|
||||
libs/math/setprec.c \
|
||||
libs/math/sin.c \
|
||||
libs/math/sincos.c \
|
||||
libs/math/sindg.c \
|
||||
libs/math/sinh.c \
|
||||
libs/math/sqrt.c \
|
||||
libs/math/tan.c \
|
||||
libs/math/tandg.c \
|
||||
libs/math/tanh.c \
|
||||
libs/math/unity.c
|
||||
#libs/math/mod2pi.c
|
||||
#libs/math/mtst.c
|
||||
#libs/math/dtestvec.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USE_GRAPHICS
|
||||
DEFINES += -DUSE_GRAPHICS
|
||||
WRAPPERSOURCES += libs/graphics/jswrap_graphics.c
|
||||
INCLUDE += -I$(ROOT)/libs/graphics
|
||||
SOURCES += \
|
||||
libs/graphics/bitmap_font_8x8.c \
|
||||
libs/graphics/graphics.c \
|
||||
libs/graphics/lcd_arraybuffer.c \
|
||||
libs/graphics/lcd_js.c
|
||||
|
||||
ifdef USE_LCD_SDL
|
||||
DEFINES += -DUSE_LCD_SDL
|
||||
SOURCES += libs/graphics/lcd_sdl.c
|
||||
LIBS += -lSDL
|
||||
INCLUDE += -I/usr/include/SDL
|
||||
endif
|
||||
|
||||
ifdef USE_LCD_FSMC
|
||||
DEFINES += -DUSE_LCD_FSMC
|
||||
SOURCES += libs/graphics/lcd_fsmc.c
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifdef USE_NET
|
||||
DEFINES += -DUSE_NET
|
||||
WRAPPERSOURCES += libs/network/http/jswrap_http.c
|
||||
INCLUDE += -I$(ROOT)/libs/network/http
|
||||
SOURCES += \
|
||||
libs/network/http/httpserver.c
|
||||
ifdef LINUX
|
||||
#LIBS += -l...
|
||||
#INCLUDE += -I...
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USE_CC3000
|
||||
DEFINES += -DUSE_CC3000 -DSEND_NON_BLOCKING
|
||||
WRAPPERSOURCES += libs/network/cc3000/jswrap_cc3000.c
|
||||
INCLUDE += -I$(ROOT)/libs/network/cc3000
|
||||
SOURCES += \
|
||||
libs/network/cc3000/board_spi.c \
|
||||
libs/network/cc3000/cc3000_common.c \
|
||||
libs/network/cc3000/evnt_handler.c \
|
||||
libs/network/cc3000/hci.c \
|
||||
libs/network/cc3000/netapp.c \
|
||||
libs/network/cc3000/nvmem.c \
|
||||
libs/network/cc3000/security.c \
|
||||
libs/network/cc3000/socket.c \
|
||||
libs/network/cc3000/wlan.c
|
||||
endif
|
||||
|
||||
ifdef USE_TRIGGER
|
||||
DEFINES += -DUSE_TRIGGER
|
||||
WRAPPERSOURCES += libs/trigger/jswrap_trigger.c
|
||||
INCLUDE += -I$(ROOT)/libs/trigger
|
||||
SOURCES += \
|
||||
./libs/trigger/trigger.c
|
||||
endif
|
||||
|
||||
ifdef USB
|
||||
DEFINES += -DUSB
|
||||
endif
|
||||
|
||||
ifeq ($(FAMILY), STM32F1)
|
||||
ARCHFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m3 -mfix-cortex-m3-ldrd -mthumb-interwork -mfloat-abi=soft
|
||||
ARM=1
|
||||
STM32=1
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f1 -I$(ROOT)/targetlibs/stm32f1/lib
|
||||
DEFINES += -DSTM32F1
|
||||
SOURCES += \
|
||||
targetlibs/stm32f1/lib/misc.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_adc.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_bkp.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_can.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_cec.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_crc.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_dac.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_dbgmcu.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_dma.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_exti.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_flash.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_fsmc.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_gpio.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_i2c.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_iwdg.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_pwr.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_rcc.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_rtc.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_sdio.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_spi.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_tim.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_usart.c \
|
||||
targetlibs/stm32f1/lib/stm32f10x_wwdg.c \
|
||||
targetlibs/stm32f1/lib/system_stm32f10x.c
|
||||
|
||||
ifdef USB
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f1/usblib -I$(ROOT)/targetlibs/stm32f1/usb
|
||||
SOURCES += \
|
||||
targetlibs/stm32f1/usblib/otgd_fs_cal.c \
|
||||
targetlibs/stm32f1/usblib/otgd_fs_dev.c \
|
||||
targetlibs/stm32f1/usblib/otgd_fs_int.c \
|
||||
targetlibs/stm32f1/usblib/otgd_fs_pcd.c \
|
||||
targetlibs/stm32f1/usblib/usb_core.c \
|
||||
targetlibs/stm32f1/usblib/usb_init.c \
|
||||
targetlibs/stm32f1/usblib/usb_int.c \
|
||||
targetlibs/stm32f1/usblib/usb_mem.c \
|
||||
targetlibs/stm32f1/usblib/usb_regs.c \
|
||||
targetlibs/stm32f1/usblib/usb_sil.c \
|
||||
targetlibs/stm32f1/usb/usb_desc.c \
|
||||
targetlibs/stm32f1/usb/usb_endp.c \
|
||||
targetlibs/stm32f1/usb/usb_istr.c \
|
||||
targetlibs/stm32f1/usb/usb_prop.c \
|
||||
targetlibs/stm32f1/usb/usb_pwr.c \
|
||||
targetlibs/stm32f1/usb/usb_utils.c
|
||||
endif #USB
|
||||
|
||||
endif #STM32F1
|
||||
|
||||
ifeq ($(FAMILY), STM32F2)
|
||||
ARCHFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m3 -mthumb-interwork -mfpu=fpv4-sp-d16 -mfloat-abi=softfp
|
||||
ARM=1
|
||||
STM32=1
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f2 -I$(ROOT)/targetlibs/stm32f2/lib
|
||||
DEFINES += -DSTM32F2
|
||||
SOURCES += \
|
||||
targetlibs/stm32f2/lib/misc.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_adc.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_can.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_crc.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_cryp_aes.c\
|
||||
targetlibs/stm32f2/lib/stm32f2xx_cryp.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_cryp_des.c\
|
||||
targetlibs/stm32f2/lib/stm32f2xx_cryp_tdes.c\
|
||||
targetlibs/stm32f2/lib/stm32f2xx_dac.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_dbgmcu.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_dcmi.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_dma.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_exti.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_flash.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_fsmc.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_gpio.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_hash.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_hash_md5.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_hash_sha1.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_i2c.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_iwdg.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_pwr.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_rcc.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_rng.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_rtc.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_sdio.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_spi.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_syscfg.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_tim.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_usart.c \
|
||||
targetlibs/stm32f2/lib/stm32f2xx_wwdg.c \
|
||||
targetlibs/stm32f2/lib/system_stm32f2xx.c
|
||||
|
||||
|
||||
ifdef USB
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f2/usblib -I$(ROOT)/targetlibs/stm32f2/usb
|
||||
SOURCES += \
|
||||
targetlibs/stm32f2/usb/usbd_cdc_vcp.c \
|
||||
targetlibs/stm32f2/usb/usb_irq_handlers.c \
|
||||
targetlibs/stm32f2/usb/usbd_desc.c \
|
||||
targetlibs/stm32f2/usb/usbd_usr.c \
|
||||
targetlibs/stm32f2/usb/usb_bsp.c \
|
||||
targetlibs/stm32f2/usblib/usbd_req.c \
|
||||
targetlibs/stm32f2/usblib/usb_dcd_int.c \
|
||||
targetlibs/stm32f2/usblib/usbd_core.c \
|
||||
targetlibs/stm32f2/usblib/usbd_cdc_core.c \
|
||||
targetlibs/stm32f2/usblib/usbd_ioreq.c \
|
||||
targetlibs/stm32f2/usblib/usb_core.c \
|
||||
targetlibs/stm32f2/usblib/usb_dcd.c
|
||||
#targetlibs/stm32f2/usblib/usb_otg.c \
|
||||
#targetlibs/stm32f2/usblib/usb_bsp_template.c \
|
||||
#targetlibs/stm32f2/usblib/usbd_cdc_if_template.c \
|
||||
#targetlibs/stm32f2/usblib/usb_hcd.c \
|
||||
#targetlibs/stm32f2/usblib/usb_hcd_int.c
|
||||
endif #USB
|
||||
endif #STM32F2
|
||||
|
||||
ifeq ($(FAMILY), STM32F3)
|
||||
ARCHFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfpu=fpv4-sp-d16 -mfloat-abi=softfp
|
||||
ARM=1
|
||||
STM32=1
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f3 -I$(ROOT)/targetlibs/stm32f3/lib
|
||||
DEFINES += -DSTM32F3
|
||||
SOURCES += \
|
||||
targetlibs/stm32f3/lib/stm32f30x_adc.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_can.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_comp.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_crc.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_dac.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_dbgmcu.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_dma.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_exti.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_flash.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_gpio.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_i2c.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_iwdg.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_misc.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_opamp.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_pwr.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_rcc.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_rtc.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_spi.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_syscfg.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_tim.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_usart.c \
|
||||
targetlibs/stm32f3/lib/stm32f30x_wwdg.c \
|
||||
targetlibs/stm32f3/lib/system_stm32f30x.c
|
||||
|
||||
ifdef USB
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f3/usblib -I$(ROOT)/targetlibs/stm32f3/usb
|
||||
SOURCES += \
|
||||
targetlibs/stm32f3/usblib/usb_core.c \
|
||||
targetlibs/stm32f3/usblib/usb_init.c \
|
||||
targetlibs/stm32f3/usblib/usb_int.c \
|
||||
targetlibs/stm32f3/usblib/usb_mem.c \
|
||||
targetlibs/stm32f3/usblib/usb_regs.c \
|
||||
targetlibs/stm32f3/usblib/usb_sil.c \
|
||||
targetlibs/stm32f3/usb/usb_desc.c \
|
||||
targetlibs/stm32f3/usb/usb_endp.c \
|
||||
targetlibs/stm32f3/usb/usb_istr.c \
|
||||
targetlibs/stm32f3/usb/usb_prop.c \
|
||||
targetlibs/stm32f3/usb/usb_pwr.c \
|
||||
targetlibs/stm32f3/usb/usb_utils.c
|
||||
endif #USB
|
||||
endif #STM32F3
|
||||
|
||||
ifeq ($(FAMILY), STM32F4)
|
||||
ARCHFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfpu=fpv4-sp-d16 -mfloat-abi=softfp
|
||||
ARM=1
|
||||
STM32=1
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f4 -I$(ROOT)/targetlibs/stm32f4/lib
|
||||
DEFINES += -DSTM32F4
|
||||
SOURCES += \
|
||||
targetlibs/stm32f4/lib/misc.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_adc.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_can.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_crc.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_cryp_aes.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_cryp.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_cryp_des.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_cryp_tdes.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_dac.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_dbgmcu.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_dcmi.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_dma.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_exti.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_flash.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_fsmc.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_gpio.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_hash.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_hash_md5.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_hash_sha1.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_i2c.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_iwdg.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_pwr.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_rcc.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_rng.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_rtc.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_sdio.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_spi.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_syscfg.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_tim.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_usart.c \
|
||||
targetlibs/stm32f4/lib/stm32f4xx_wwdg.c \
|
||||
targetlibs/stm32f4/lib/system_stm32f4xx.c
|
||||
|
||||
ifdef USB
|
||||
INCLUDE += -I$(ROOT)/targetlibs/stm32f4/usblib -I$(ROOT)/targetlibs/stm32f4/usb
|
||||
SOURCES += \
|
||||
targetlibs/stm32f4/usblib/usb_core.c \
|
||||
targetlibs/stm32f4/usblib/usbd_cdc_core.c \
|
||||
targetlibs/stm32f4/usblib/usb_dcd.c \
|
||||
targetlibs/stm32f4/usblib/usb_dcd_int.c \
|
||||
targetlibs/stm32f4/usblib/usbd_core.c \
|
||||
targetlibs/stm32f4/usblib/usbd_ioreq.c \
|
||||
targetlibs/stm32f4/usblib/usbd_req.c \
|
||||
targetlibs/stm32f4/usb/usb_bsp.c \
|
||||
targetlibs/stm32f4/usb/usbd_cdc_vcp.c \
|
||||
targetlibs/stm32f4/usb/usbd_desc.c \
|
||||
targetlibs/stm32f4/usb/usbd_usr.c
|
||||
#targetlibs/stm32f4/usblib/usb_hcd.c
|
||||
#targetlibs/stm32f4/usblib/usb_hcd_int.c
|
||||
#targetlibs/stm32f4/usblib/usb_otg.c
|
||||
endif #USB
|
||||
endif #STM32F4
|
||||
|
||||
|
||||
ifdef MBED
|
||||
ARCHFLAGS += -mcpu=cortex-m3 -mthumb
|
||||
ARM=1
|
||||
INCLUDE+=-I$(ROOT)/targetlibs/libmbed -I$(ROOT)/targetlibs/libmbed/$(CHIP) -I$(ROOT)/targetlibs/libmbed/$(CHIP)/GCC_CS
|
||||
DEFINES += -DMBED
|
||||
INCLUDE += -I$(ROOT)/targetlibs/mbed
|
||||
SOURCES += targets/mbed/main.c
|
||||
CPPSOURCES += targets/mbed/jshardware.cpp
|
||||
endif
|
||||
|
||||
ifdef ARM
|
||||
LINKER_FILE = gen/linker.ld
|
||||
DEFINES += -DARM
|
||||
INCLUDE += -I$(ROOT)/targetlibs/arm
|
||||
OPTIMIZEFLAGS += -fno-common -fno-exceptions -fdata-sections -ffunction-sections
|
||||
# -flto -fuse-linker-plugin
|
||||
# -flto - link time optimisation - could be good for ST's libs
|
||||
# GCC suggests use of -fuse-linker-plugin with flto
|
||||
# Does not work - get errors like : `sqrt' referenced in section `.text.asin' of /tmp/ccJheOub.ltrans9.ltrans.o: defined in discarded section `.text' of libs/math/sqrt.o (symbol from plugin)
|
||||
|
||||
|
||||
# 4.6
|
||||
#export CCPREFIX=arm-linux-gnueabi-
|
||||
# 4.5
|
||||
#export CCPREFIX=~/sat/bin/arm-none-eabi-
|
||||
# 4.4
|
||||
export CCPREFIX=arm-none-eabi-
|
||||
endif # ARM
|
||||
|
||||
PININFOFILE=$(ROOT)/gen/jspininfo
|
||||
ifdef PININFOFILE
|
||||
SOURCES += $(PININFOFILE).c
|
||||
endif
|
||||
|
||||
ifdef CARAMBOLA
|
||||
TOOLCHAIN_DIR=$(shell cd ~/workspace/carambola/staging_dir/toolchain-*/bin;pwd)
|
||||
export STAGING_DIR=$(TOOLCHAIN_DIR)
|
||||
export CCPREFIX=$(TOOLCHAIN_DIR)/mipsel-openwrt-linux-
|
||||
endif
|
||||
|
||||
ifdef RASPBERRYPI
|
||||
ifneq ($(shell uname -m),armv6l)
|
||||
# eep. let's cross compile
|
||||
export CCPREFIX=targetlibs/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-
|
||||
else
|
||||
# compiling in-place, so give it a normal name
|
||||
PROJ_NAME=espruino
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
ifdef STM32
|
||||
DEFINES += -DFAKE_STDLIB
|
||||
# FAKE_STDLIB is for Espruino - it uses its own standard library so we don't have to link in the normal one + get bloated
|
||||
DEFINES += -DSTM32 -DUSE_STDPERIPH_DRIVER=1 -D$(CHIP) -D$(BOARD) -D$(STLIB)
|
||||
INCLUDE += -I$(ROOT)/targets/stm32
|
||||
ifndef BOOTLOADER
|
||||
SOURCES += \
|
||||
targets/stm32/main.c \
|
||||
targets/stm32/jshardware.c \
|
||||
targets/stm32/stm32_it.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef LINUX
|
||||
DEFINES += -DLINUX
|
||||
INCLUDE += -I$(ROOT)/targets/linux
|
||||
SOURCES += \
|
||||
targets/linux/main.c \
|
||||
targets/linux/jshardware.c
|
||||
LIBS += -lm # maths lib
|
||||
endif
|
||||
|
||||
SOURCES += $(WRAPPERSOURCES)
|
||||
SOURCEOBJS = $(SOURCES:.c=.o) $(CPPSOURCES:.cpp=.o)
|
||||
OBJS = $(SOURCEOBJS) $(PRECOMPILED_OBJS)
|
||||
|
||||
|
||||
# -ffreestanding -nodefaultlibs -nostdlib -fno-common
|
||||
# -nodefaultlibs -nostdlib -nostartfiles
|
||||
|
||||
# -fdata-sections -ffunction-sections are to help remove unused code
|
||||
CFLAGS += $(OPTIMIZEFLAGS) -c $(ARCHFLAGS) $(DEFINES) $(INCLUDE)
|
||||
|
||||
# -Wl,--gc-sections helps remove unused code
|
||||
# -Wl,--whole-archive checks for duplicates
|
||||
LDFLAGS += $(OPTIMIZEFLAGS) $(ARCHFLAGS)
|
||||
ifndef MACOSX
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
endif
|
||||
|
||||
ifdef LINKER_FILE
|
||||
LDFLAGS += -T$(LINKER_FILE)
|
||||
endif
|
||||
|
||||
export CC=$(CCPREFIX)gcc
|
||||
export LD=$(CCPREFIX)gcc
|
||||
export AR=$(CCPREFIX)ar
|
||||
export AS=$(CCPREFIX)as
|
||||
export OBJCOPY=$(CCPREFIX)objcopy
|
||||
export OBJDUMP=$(CCPREFIX)objdump
|
||||
export GDB=$(CCPREFIX)gdb
|
||||
|
||||
|
||||
.PHONY: proj
|
||||
|
||||
all: proj
|
||||
|
||||
ifeq ($(V),1)
|
||||
quiet_=
|
||||
Q=
|
||||
else
|
||||
quiet_=quiet_
|
||||
Q=@
|
||||
export SILENT=1
|
||||
endif
|
||||
|
||||
|
||||
$(WRAPPERFILE): scripts/build_jswrapper.py $(WRAPPERSOURCES)
|
||||
@echo Generating JS wrappers
|
||||
$(Q)echo WRAPPERSOURCES = $(WRAPPERSOURCES)
|
||||
$(Q)echo DEFINES = $(DEFINES)
|
||||
$(Q)python scripts/build_jswrapper.py $(WRAPPERSOURCES) $(DEFINES)
|
||||
|
||||
ifdef PININFOFILE
|
||||
$(PININFOFILE).c $(PININFOFILE).h: scripts/build_pininfo.py
|
||||
@echo Generating pin info
|
||||
$(Q)python scripts/build_pininfo.py $(BOARD) $(PININFOFILE).c $(PININFOFILE).h
|
||||
endif
|
||||
|
||||
$(LINKER_FILE): scripts/build_linker.py
|
||||
@echo Generating linker scripts
|
||||
$(Q)python scripts/build_linker.py $(BOARD) $(LINKER_FILE) $(BUILD_LINKER_FLAGS)
|
||||
|
||||
$(PLATFORM_CONFIG_FILE): boards/$(BOARD).py scripts/build_platform_config.py
|
||||
@echo Generating platform configs
|
||||
$(Q)python scripts/build_platform_config.py $(BOARD)
|
||||
|
||||
compile=$(CC) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
link=$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||
obj_dump=$(OBJDUMP) -x -S $(PROJ_NAME).elf > $(PROJ_NAME).lst
|
||||
obj_to_bin=$(OBJCOPY) -O $1 $(PROJ_NAME).elf $(PROJ_NAME).$2
|
||||
|
||||
quiet_compile= CC $@
|
||||
quiet_link= LD $@
|
||||
quiet_obj_dump= GEN $(PROJ_NAME).lst
|
||||
quiet_obj_to_bin= GEN $(PROJ_NAME).$2
|
||||
|
||||
%.o: %.c $(PLATFORM_CONFIG_FILE) $(PININFOFILE).h
|
||||
@echo $($(quiet_)compile)
|
||||
@$(call compile)
|
||||
|
||||
.cpp.o: $(PLATFORM_CONFIG_FILE) $(PININFOFILE).h
|
||||
@echo $($(quiet_)compile)
|
||||
@$(call compile)
|
||||
|
||||
.s.o:
|
||||
@echo $($(quiet_)compile)
|
||||
@$(call compile)
|
||||
|
||||
ifdef LINUX # ---------------------------------------------------
|
||||
proj: $(PLATFORM_CONFIG_FILE) $(PROJ_NAME)
|
||||
|
||||
$(PROJ_NAME): $(OBJS)
|
||||
@echo $($(quiet_)link)
|
||||
@$(call link)
|
||||
|
||||
else # embedded, so generate bin, etc ---------------------------
|
||||
|
||||
$(PROJ_NAME).elf: $(OBJS) $(LINKER_FILE)
|
||||
@echo $($(quiet_)link)
|
||||
@$(call link)
|
||||
|
||||
$(PROJ_NAME).lst : $(PROJ_NAME).elf
|
||||
@echo $($(quiet_)obj_dump)
|
||||
@$(call obj_dump)
|
||||
|
||||
$(PROJ_NAME).hex: $(PROJ_NAME).elf
|
||||
@echo $(call $(quiet_)obj_to_bin,ihex,hex)
|
||||
@$(call obj_to_bin,ihex,hex)
|
||||
|
||||
$(PROJ_NAME).srec : $(PROJ_NAME).elf
|
||||
@echo $(call $(quiet_)obj_to_bin,srec,srec)
|
||||
@$(call obj_to_bin,srec,srec)
|
||||
|
||||
$(PROJ_NAME).bin : $(PROJ_NAME).elf
|
||||
@echo $(call $(quiet_)obj_to_bin,binary,bin)
|
||||
@$(call obj_to_bin,binary,bin)
|
||||
bash scripts/check_size.sh $(PROJ_NAME).bin
|
||||
|
||||
proj: $(PROJ_NAME).lst $(PROJ_NAME).bin
|
||||
#proj: $(PROJ_NAME).lst $(PROJ_NAME).hex $(PROJ_NAME).srec $(PROJ_NAME).bin
|
||||
|
||||
flash: all
|
||||
ifdef OLIMEXINO_STM32_BOOTLOADER
|
||||
echo Olimexino Serial bootloader
|
||||
dfu-util -a1 -d 0x1EAF:0x0003 -D $(PROJ_NAME).bin
|
||||
else
|
||||
ifdef MBED
|
||||
cp $(PROJ_NAME).bin /media/MBED;sync
|
||||
else
|
||||
echo ST-LINK flash
|
||||
~/bin/st-flash write $(PROJ_NAME).bin $(BASEADDRESS)
|
||||
endif
|
||||
endif
|
||||
|
||||
serialflash: all
|
||||
echo STM32 inbuilt serial bootloader, set BOOT0=1, BOOT1=0
|
||||
python scripts/stm32loader.py -b 460800 -a $(BASEADDRESS) -ew $(STM32LOADER_FLAGS) $(PROJ_NAME).bin
|
||||
# python scripts/stm32loader.py -b 460800 -a $(BASEADDRESS) -ewv $(STM32LOADER_FLAGS) $(PROJ_NAME).bin
|
||||
|
||||
gdb:
|
||||
echo "target extended-remote :4242" > gdbinit
|
||||
echo "file $(PROJ_NAME).elf" >> gdbinit
|
||||
#echo "load" >> gdbinit
|
||||
echo "break main" >> gdbinit
|
||||
echo "break HardFault_Handler" >> gdbinit
|
||||
$(GDB) -x gdbinit
|
||||
rm gdbinit
|
||||
endif # ---------------------------------------------------
|
||||
|
||||
clean:
|
||||
@echo Cleaning targets
|
||||
$(Q)find . -name *.o | grep -v libmbed | grep -v arm-bcm2708 | xargs rm -f
|
||||
$(Q)rm -f $(ROOT)/gen/*.c $(ROOT)/gen/*.h $(ROOT)/gen/*.ld
|
||||
$(Q)rm -f $(PROJ_NAME).elf
|
||||
$(Q)rm -f $(PROJ_NAME).hex
|
||||
$(Q)rm -f $(PROJ_NAME).bin
|
||||
$(Q)rm -f $(PROJ_NAME).srec
|
||||
$(Q)rm -f $(PROJ_NAME).lst
|
||||
161
components/external/espruino/README.md
vendored
161
components/external/espruino/README.md
vendored
@@ -1,161 +0,0 @@
|
||||
Espruino JavaScript for Microcontrollers
|
||||
========================================
|
||||
<pre>
|
||||
_____ _
|
||||
| __|___ ___ ___ _ _|_|___ ___
|
||||
| __|_ -| . | _| | | | | . |
|
||||
|_____|___| _|_| |___|_|_|_|___|
|
||||
|_|
|
||||
</pre>
|
||||
http://www.espruino.com
|
||||
|
||||
**NOTE:** This software is beta and is provided as-is, and won't be considered even remotely final until we've released the Espruino Board. As such, don't expect support, and do expect it to change rapidly and without warning. Build your own documentation (see **Building**), as the API may be different from the one described on the Espruino website.
|
||||
|
||||
The KickStarter campaign said the Espruino Board will have some things which this repository does not yet have (like working CC3000 support). These are works in progress and should be done by the time you get your board (or will be available as a software update).
|
||||
|
||||
|
||||
About
|
||||
-----
|
||||
|
||||
It'd probably help to read the [FAQ](http://www.espruino.com/FAQ), and specifically the page about [Performance](http://www.espruino.com/Performance) as it contains information about how Espruino itself works.
|
||||
|
||||
There's also the auto-generated [Reference](http://www.espruino.com/Reference) for JavaScript commands as well as the [Tutorials](http://www.espruino.com/Tutorials) on the website. However please note that this repository is under heavy development, and the documentation on the Espruino website will match the version [available for download](http://www.espruino.com/Download) but **not** the latest version from Git.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Please see the [LICENSE](LICENSE) file
|
||||
|
||||
|
||||
Found a Bug?
|
||||
------------
|
||||
|
||||
Please check that:
|
||||
* It hasn't [already been found](https://github.com/espruino/Espruino/issues) or [been covered on our forum](www.espruino.com/Forum)
|
||||
* You're not just looking at outdated documentation (See the [Building](#Building) section to see how to build documentation)
|
||||
|
||||
Please [submit bugs](https://github.com/espruino/Espruino/issues) with clear steps to reproduce them (and ideally a test case for the ```tests``` directory), and if at all possible try and include a patch to fix them. Please be aware that we have a whole bunch of outstanding issues (some quite large), so if you report something (especially if it doesn't contain a test or a pull request) it may not be fixed for quite some time.
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
Current State
|
||||
-------------
|
||||
|
||||
You can download binaries from http://www.espruino.com/Download (these aren't the latest, but are more likely to work with your board)
|
||||
|
||||
Please note that this is BETA. We've been working hard on the Espruino Board support but we haven't had time to check the other boards properly.
|
||||
|
||||
* Espruino Board - working
|
||||
* Linux - working
|
||||
* STM32VLDISCOVERY - WORKING
|
||||
* STM32F3DISCOVERY - WORKING
|
||||
* STM32F4DISCOVERY - WORKING
|
||||
* STM32F429IDISCOVERY - not working, currently no LCD support
|
||||
* HY STM32 2.4" - NOT WORKING - appears to crash after startup
|
||||
* HY STM32 2.8" - WORKING, but screen is not black at startup
|
||||
* HY STM32 3.2" - WORKING
|
||||
* Olimexino - WORKING
|
||||
* Carambola - ?
|
||||
* Raspberry Pi - WORKING
|
||||
* Sony SmartWatch - USB VCP support still needed
|
||||
* MBed platforms - have not worked for a while - hardware wrapper still needed
|
||||
* Arduino - has never worked. Compiles but doesn't even get past init
|
||||
* LC-TECH STM32F103RBT6 - WORKING, but with some issues (LED inverted logic, BTN needs pullup to work)
|
||||
|
||||
Using
|
||||
-----
|
||||
|
||||
If you're using Espruino for your own personal projects - go ahead, we hope you have fun - and please let us know what you do with it on http://www.espruino.com/Forum!
|
||||
|
||||
However if you're planning on selling the Espruino software on your own board, please talk to us:
|
||||
|
||||
* Read the terms of the MPLv2 Licence that Espruino is distributed under, and make sure you comply with it
|
||||
* You won't be able to call your board 'Espruino' but you must explain clearly that it uses 'Espruino' internally (we own the trademark)
|
||||
* If you're profiting from Espruino without contributing anything back, we won't support you (or your users)
|
||||
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
Espruino is easy to build under Linux, and it is possible to build under MacOS. We'd strongly suggest that you DO NOT TRY AND BUILD UNDER WINDOWS, and instead use a Virtual Machine. There's a good post on this here: http://forum.espruino.com/conversations/151
|
||||
|
||||
We suggest that you use the CodeSourcery GCC compiler, but paths in Makefile may need changing...
|
||||
|
||||
``` BOARDNAME=1 RELEASE=1 make```
|
||||
|
||||
* See the top of Makefile for board names
|
||||
* Without `RELEASE=1`, assertions are kept in the code (which is good for debugging, bad for performance + code size)
|
||||
* `BOARDNAME=1 RELEASE=1 make serialflash` will flash to /dev/ttyUSB0 using the STM32 serial bootloader (what's needed for Espruino + HY boards)
|
||||
* `BOARDNAME=1 RELEASE=1 make flash` will flash using st-flash if discovery, or maple bootloader if using that board
|
||||
|
||||
You can build documentation by running:
|
||||
|
||||
``` python scripts/build_docs.py ```
|
||||
|
||||
This will create a file called ```functions.html```
|
||||
|
||||
Directories and Files
|
||||
---------------------
|
||||
|
||||
* `ChangeLog`: What's new
|
||||
* `TODO`: List of things to do
|
||||
* `boards/`: Information on boards, used to auto-generate a lot of the code
|
||||
* `code/`: Example JavaScript code
|
||||
* `gen/`: Auto-Generated Source Files
|
||||
* `libs/`: Optional libraries to include in Espruino (Math, Filesystem, Graphics, etc)
|
||||
* `linker/`: Linker files for various processors
|
||||
* `misc/`: random other stuff
|
||||
* `scripts/`: Scripts for generating files in gen, and for analysing code/compilation/etc
|
||||
* `src/`: Main source code
|
||||
* `targetlibs/`: Libraries for targeted architectures
|
||||
* `targets/`: Specific code for targeted architectures
|
||||
* `tests/`: JavaScript Testcases
|
||||
* `benchmark/`: JavaScript Benchmarks
|
||||
* `dist_*`: files to be copied into distribution zip file
|
||||
|
||||
Adding more devices
|
||||
-------------------
|
||||
|
||||
Currently there are a bunch of different files to modify. Eventually the plan is to fit everything into boards/BOARDNAME.py and to auto-generate the rest of the config files.
|
||||
|
||||
* Most build options handled in `Makefile`
|
||||
* Extra libraries like USB/LCD/filesystem in `Makefile`
|
||||
* Linker Scripts are in `linker/`
|
||||
* `boards/*.py` files handle loading the list of available pins so the relevant headers + docs can be created
|
||||
* Processor-specific code in `targets/stm32`, `targets/linux`, etc.
|
||||
* Processor-specific libs in `targetlibs/foo`
|
||||
* `src/jshardware.h` is effectively a simple abstraction layer for SPI/I2C/etc
|
||||
* `targets/stm32/jshardware.c` also has flash-size-specific defines
|
||||
* `libs/fat_sd` and `libs/lcd` still have some device-specific defines in too
|
||||
|
||||
Adding libraries
|
||||
-------------------
|
||||
|
||||
* Create `jswrap_mylib.c/h` in `libs/`
|
||||
* Create library functions (see examples in other jswrap files, also the comments in `scripts/common.py`)
|
||||
|
||||
|
||||
Arduino Compile (beta)
|
||||
----------------------
|
||||
* Ensure that `targets/arduino/utility` is symlinked to `src`
|
||||
* Symlink `...arduino_workspace/libraries/Espruino` to `targets/arduino`
|
||||
|
||||
Cross Compile for Raspberry Pi
|
||||
------------------------------
|
||||
```
|
||||
cd targetlibs
|
||||
mkdir raspberrypi
|
||||
cd raspberrypi
|
||||
git clone git://github.com/raspberrypi/tools.git
|
||||
sudo apt-get install ia32-libs
|
||||
```
|
||||
|
||||
Cross Compile for Carambola (OpenWRT)
|
||||
-------------------------------------
|
||||
* Follow instructions at <https://github.com/8devices/carambola> to set toolchain up in ```~/workspace/carambola```
|
||||
* Run ```CARAMBOLA=1 make```
|
||||
2
components/external/espruino/README_cn.md
vendored
2
components/external/espruino/README_cn.md
vendored
@@ -1,2 +0,0 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD>Espruino<EFBFBD><EFBFBD>ֲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>javascript<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>newlib<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>rtconfig.h<>п<EFBFBD><D0BF><EFBFBD>RT_USING_JS<4A><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
53
components/external/espruino/SConscript
vendored
53
components/external/espruino/SConscript
vendored
@@ -1,53 +0,0 @@
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
path = [cwd, cwd + '/src', cwd + '/gen', cwd + '/libs', cwd + '/targets/rtthread']
|
||||
|
||||
src = Split("""
|
||||
src/jsdevices.c
|
||||
src/jslex.c
|
||||
src/jswrap_array.c
|
||||
src/jswrap_json.c
|
||||
src/jswrap_process.c
|
||||
src/jsutils.c
|
||||
src/jswrap_interactive.c
|
||||
src/jswrap_onewire.c
|
||||
src/jswrap_string.c
|
||||
src/jsparse.c
|
||||
src/jswrap_arraybuffer.c
|
||||
src/jswrap_modules.c
|
||||
src/jswrap_serial.c
|
||||
src/jsinteractive.c
|
||||
src/jsvar.c
|
||||
src/jswrap_io.c
|
||||
src/jswrap_pin.c
|
||||
src/jspin.c
|
||||
src/jswrap_functions.c
|
||||
src/jswrap_object.c
|
||||
src/jswrap_spi_i2c.c
|
||||
"""
|
||||
)
|
||||
|
||||
gen = Split("""
|
||||
gen/jspininfo.c
|
||||
gen/jswrapper.c
|
||||
"""
|
||||
)
|
||||
|
||||
target = Split("""
|
||||
targets/rtthread/espruino.c
|
||||
targets/rtthread/jshardware.c
|
||||
"""
|
||||
)
|
||||
|
||||
libs = Split(
|
||||
"""
|
||||
libs/jswrap_math.c
|
||||
"""
|
||||
)
|
||||
|
||||
src = src + gen + target + libs
|
||||
|
||||
group = DefineGroup('Espruino', src, depend = ['RT_USING_JS', 'RT_USING_NEWLIB'], CPPPATH = path)
|
||||
|
||||
Return('group')
|
||||
109
components/external/espruino/dist_licences.txt
vendored
109
components/external/espruino/dist_licences.txt
vendored
@@ -1,109 +0,0 @@
|
||||
Espruino uses a few libraries of code that have been generously given away for
|
||||
free. Their licences are included below.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
FATFS
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ FatFs - FAT file system module include file R0.07c (C)ChaN, 2009
|
||||
/----------------------------------------------------------------------------/
|
||||
/ FatFs module is an open source software to implement FAT file system to
|
||||
/ small embedded systems. This is a free software and is opened for education,
|
||||
/ research and commercial developments under license policy of following terms.
|
||||
/
|
||||
/ Copyright (C) 2009, ChaN, all right reserved.
|
||||
/
|
||||
/ * The FatFs module is a free software and there is NO WARRANTY.
|
||||
/ * No restriction on use. You can use, modify and redistribute it for
|
||||
/ personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.
|
||||
/ * Redistributions of source code must retain the above copyright notice.*/
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
FATFS to SPI bridge
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
/* Copyright (c) 2009, Martin Thomas, ChaN
|
||||
All rights reserved.
|
||||
|
||||
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 the copyright holders nor the names of
|
||||
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. */
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
FATFS to SDIO bridge
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
/* author: ickle */ - No details given with source code. If you have
|
||||
anything you'd like to include, pleas e-mail us and let us know.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
8x8 LCD Font
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
http://forum.osdev.org/viewtopic.php?f=2&t=22033
|
||||
|
||||
Created Sunday, May 23, 2010 by Quinn Evans
|
||||
Renamed and updated Monday 24, 2010
|
||||
|
||||
This font (Vincent) is released by me into the public domain. I claim no
|
||||
copyright, and hereby make this software available to the public for any use,
|
||||
at any time, free of restrictions, legal or otherwise.
|
||||
*/
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
CC3000 Host Driver Implementation.
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Copyright (C) 2011 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.
|
||||
57
components/external/espruino/dist_readme.txt
vendored
57
components/external/espruino/dist_readme.txt
vendored
@@ -1,57 +0,0 @@
|
||||
_____ _
|
||||
| __|___ ___ ___ _ _|_|___ ___
|
||||
| __|_ -| . | _| | | | | . |
|
||||
|_____|___| _|_| |___|_|_|_|___|
|
||||
|_|
|
||||
Copyright 2013 Gordon Williams
|
||||
|
||||
http://www.espruino.com
|
||||
|
||||
--------------------------------------------------------------
|
||||
|
||||
There are a few different binaries in this ZIP file, for different
|
||||
types of Microcontroller:
|
||||
|
||||
espruino_#v##_hystm32_24_ve.bin
|
||||
- 'HY'STM32F103VET6 ARM with 2.4" LCD display
|
||||
This is available from eBay
|
||||
|
||||
espruino_#v##_hystm32_28_rb.bin
|
||||
- 'HY'STM32F103RBT6 ARM with 2.8" LCD display
|
||||
This is available from eBay
|
||||
|
||||
espruino_#v##_hystm32_32_vc.bin
|
||||
- 'HY'STM32F103VCT6 ARM with 3.2" LCD display
|
||||
This is available from eBay
|
||||
|
||||
espruino_#v##_olimexino_stm32.bin
|
||||
- You will need to overwrite the Maple bootloader to install this.
|
||||
Espruino is now too large to fit in flash alongside it.
|
||||
- Olimexino-STM32 Arduino form factor board
|
||||
- Leaf Labs Maple Arduino form factor board
|
||||
|
||||
espruino_#v##_stm32vldiscovery.bin
|
||||
- STM32VLDISCOVERY board
|
||||
|
||||
espruino_#v##_stm32f3discovery.bin
|
||||
- STM32F3DISCOVERY board
|
||||
|
||||
espruino_#v##_stm32f4discovery.bin
|
||||
- STM32F4DISCOVERY board
|
||||
|
||||
espruino_#v##_raspberrypi
|
||||
- Raspberry Pi executable (just copy it to the device and run it)
|
||||
NOTE: There is GPIO support (which requires you to run Espruino as root)
|
||||
however there is no Serial, SPI, OneWire or I2C support at the moment so
|
||||
you're pretty limited!
|
||||
|
||||
For information on devices, and on how to flash these binary files on to
|
||||
each device, please see our website, http://www.espruino.com
|
||||
|
||||
NOTES:
|
||||
|
||||
* On the STM32F4DISCOVERY the default USART is USART2 (because
|
||||
USART1 shares some pins with USB). This means you must connect
|
||||
serial connections to PA2/PA3 NOT PA9/PA10 as you would for
|
||||
the STM32VLDISCOVERY.
|
||||
|
||||
1
components/external/espruino/gen/README
vendored
1
components/external/espruino/gen/README
vendored
@@ -1 +0,0 @@
|
||||
This directory contains auto-generated files
|
||||
7
components/external/espruino/gen/jspininfo.c
vendored
7
components/external/espruino/gen/jspininfo.c
vendored
@@ -1,7 +0,0 @@
|
||||
// auto-generated pin info file
|
||||
// for board LINUX
|
||||
#include "jspininfo.h"
|
||||
|
||||
const JshPinInfo pinInfo[JSH_PIN_COUNT] = {
|
||||
};
|
||||
|
||||
39
components/external/espruino/gen/jspininfo.h
vendored
39
components/external/espruino/gen/jspininfo.h
vendored
@@ -1,39 +0,0 @@
|
||||
// auto-generated pin info file
|
||||
// for board LINUX
|
||||
#ifndef __JSPININFO_H_
|
||||
#define __JSPININFO_H_
|
||||
|
||||
#include "jspin.h"
|
||||
|
||||
#define JSH_PIN_COUNT 0
|
||||
|
||||
#define JSH_PORTA_COUNT 0
|
||||
#define JSH_PORTB_COUNT 0
|
||||
#define JSH_PORTC_COUNT 0
|
||||
#define JSH_PORTD_COUNT 0
|
||||
#define JSH_PORTE_COUNT 0
|
||||
#define JSH_PORTF_COUNT 0
|
||||
#define JSH_PORTG_COUNT 0
|
||||
#define JSH_PORTH_COUNT 0
|
||||
#define JSH_PORTA_OFFSET -1
|
||||
#define JSH_PORTB_OFFSET -1
|
||||
#define JSH_PORTC_OFFSET -1
|
||||
#define JSH_PORTD_OFFSET -1
|
||||
#define JSH_PORTE_OFFSET -1
|
||||
#define JSH_PORTF_OFFSET -1
|
||||
#define JSH_PORTG_OFFSET -1
|
||||
#define JSH_PORTH_OFFSET -1
|
||||
|
||||
#define JSH_PININFO_FUNCTIONS 0
|
||||
|
||||
typedef struct JshPinInfo {
|
||||
JsvPinInfoPort port;
|
||||
JsvPinInfoPin pin;
|
||||
JsvPinInfoAnalog analog; // TODO: maybe we don't need to store analogs separately
|
||||
JshPinFunction functions[JSH_PININFO_FUNCTIONS];
|
||||
} PACKED_FLAGS JshPinInfo;
|
||||
|
||||
extern const JshPinInfo pinInfo[JSH_PIN_COUNT];
|
||||
|
||||
#endif
|
||||
|
||||
1203
components/external/espruino/gen/jswrapper.c
vendored
1203
components/external/espruino/gen/jswrapper.c
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,53 +0,0 @@
|
||||
|
||||
// Automatically generated header file for LINUX
|
||||
// Generated by scripts/build_platform_config.py
|
||||
|
||||
#ifndef _PLATFORM_CONFIG_H
|
||||
#define _PLATFORM_CONFIG_H
|
||||
#include <rtthread.h>
|
||||
|
||||
#define PC_BOARD_ID "LINUX"
|
||||
#define PC_BOARD_CHIP "LINUX"
|
||||
#define PC_BOARD_CHIP_FAMILY "LINUX"
|
||||
|
||||
|
||||
|
||||
// SYSTICK is the counter that counts up and that we use as the real-time clock
|
||||
// The smaller this is, the longer we spend in interrupts, but also the more we can sleep!
|
||||
#define SYSTICK_RANGE 0x1000000 // the Maximum (it is a 24 bit counter) - on Olimexino this is about 0.6 sec
|
||||
#define SYSTICKS_BEFORE_USB_DISCONNECT 2
|
||||
|
||||
#define DEFAULT_BUSY_PIN_INDICATOR (Pin)-1 // no indicator
|
||||
#define DEFAULT_SLEEP_PIN_INDICATOR (Pin)-1 // no indicator
|
||||
|
||||
// When to send the message that the IO buffer is getting full
|
||||
#define IOBUFFER_XOFF ((TXBUFFERMASK)*6/8)
|
||||
// When to send the message that we can start receiving again
|
||||
#define IOBUFFER_XON ((TXBUFFERMASK)*3/8)
|
||||
|
||||
|
||||
|
||||
#define RAM_TOTAL (-1*1024)
|
||||
#define FLASH_TOTAL (-1*1024)
|
||||
|
||||
#define RESIZABLE_JSVARS // Allocate variables in blocks using malloc
|
||||
|
||||
#define USARTS 0
|
||||
#define SPIS 1
|
||||
#define I2CS 0
|
||||
#define ADCS 0
|
||||
#define DACS 0
|
||||
|
||||
#define DEFAULT_CONSOLE_DEVICE EV_USBSERIAL
|
||||
|
||||
#define IOBUFFERMASK 31 // (max 255) amount of items in event buffer - events take ~9 bytes each
|
||||
#define TXBUFFERMASK 31 // (max 255)
|
||||
|
||||
|
||||
// definition to avoid compilation when Pin/platform config is not defined
|
||||
#define IS_PIN_USED_INTERNALLY(PIN) ((false))
|
||||
#define IS_PIN_A_LED(PIN) ((false))
|
||||
#define IS_PIN_A_BUTTON(PIN) ((false))
|
||||
|
||||
#endif // _PLATFORM_CONFIG_H
|
||||
|
||||
233
components/external/espruino/libs/jswrap_math.c
vendored
233
components/external/espruino/libs/jswrap_math.c
vendored
@@ -1,233 +0,0 @@
|
||||
/*
|
||||
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
|
||||
*
|
||||
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* This file is designed to be parsed during the build process
|
||||
*
|
||||
* Contains built-in functions for Maths
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
#include "jswrap_math.h"
|
||||
|
||||
/*JSON{ "type":"class",
|
||||
"class" : "Math",
|
||||
"description" : "This is a standard JavaScript class that contains useful Maths routines"
|
||||
}*/
|
||||
|
||||
// -------------------------------------------------------------------- Integer
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Integer", "name" : "valueOf",
|
||||
"generate" : "jswrap_integer_valueOf",
|
||||
"description" : "Given a string containing a single character, return the numeric value of it",
|
||||
"params" : [ [ "character" ,"JsVar", "A string containing a single character"] ],
|
||||
"return" : ["int", "The integer value of char"]
|
||||
}*/
|
||||
JsVarInt jswrap_integer_valueOf(JsVar *v) {
|
||||
if (!jsvIsString(v) || jsvGetStringLength(v)!=1)
|
||||
return 0;
|
||||
return (int)v->varData.str[0];
|
||||
}
|
||||
/*JSON{ "type":"variable", "name" : "NaN",
|
||||
"generate_full" : "NAN",
|
||||
"return" : ["float", "Not a Number"]
|
||||
}*/
|
||||
// -------------------------------------------------------------------- Double
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Double", "name" : "doubleToIntBits",
|
||||
"generate_full" : "*(JsVarInt*)&x",
|
||||
"description" : " Convert the floating point value given into an integer representing the bits contained in it",
|
||||
"params" : [ [ "x", "float", "A floating point number"] ],
|
||||
"return" : ["int", "The integer representation of x"]
|
||||
}*/
|
||||
// -------------------------------------------------------------------- Math
|
||||
/*JSON{ "type":"staticproperty",
|
||||
"class" : "Math", "name" : "E",
|
||||
"generate_full" : "2.71828182846",
|
||||
"return" : ["float", "The value of E - 2.71828182846"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticproperty",
|
||||
"class" : "Math", "name" : "PI",
|
||||
"generate_full" : "3.14159265359",
|
||||
"return" : ["float", "The value of PI - 3.14159265359"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "abs",
|
||||
"generate" : "jswrap_math_abs",
|
||||
"params" : [ [ "x", "float", "A floating point value"] ],
|
||||
"return" : ["float", "The absolute value of x (eg, ```Math.abs(2)==2```, but also ```Math.abs(-2)==2```)"]
|
||||
}*/
|
||||
JsVarFloat jswrap_math_abs(JsVarFloat x) {
|
||||
return (x<0)?-x:x;
|
||||
}
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "acos",
|
||||
"generate" : "acos",
|
||||
"params" : [ [ "x", "float", "The value to get the arc cosine of"] ],
|
||||
"return" : ["float", "The arc cosine of x, between 0 and PI"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "asin",
|
||||
"generate" : "asin",
|
||||
"params" : [ [ "x", "float", "The value to get the arc sine of"] ],
|
||||
"return" : ["float", "The arc sine of x, between -PI/2 and PI/2"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "atan",
|
||||
"generate" : "atan",
|
||||
"params" : [ [ "x", "float", "The value to get the arc tangent of"] ],
|
||||
"return" : ["float", "The arc tangent of x, between -PI/2 and PI/2"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "atan2",
|
||||
"generate" : "atan2",
|
||||
"params" : [ [ "y", "float", "The Y-part of the angle to get the arc tangent of"],
|
||||
[ "x", "float", "The X-part of the angle to get the arc tangent of"] ],
|
||||
"return" : ["float", "The arctangent of Y/X, between -PI and PI"]
|
||||
}*/
|
||||
|
||||
/* we use sin here, not cos, to try and save a bit of code space */
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "cos",
|
||||
"generate_full" : "sin(jsvGetFloat(theta) + (3.14159265359/2.0))",
|
||||
"params" : [ [ "theta", "float", "The angle to get the cosine of"] ],
|
||||
"return" : ["float", "The cosine of theta"]
|
||||
}*/
|
||||
|
||||
#define DBL_MAX 1.7976931348623157E+308
|
||||
|
||||
double fs_fmod(double x, double y)
|
||||
{
|
||||
double a, b;
|
||||
const double c = x;
|
||||
|
||||
if (0 > c) {
|
||||
x = -x;
|
||||
}
|
||||
if (0 > y) {
|
||||
y = -y;
|
||||
}
|
||||
if (y != 0 && DBL_MAX >= y && DBL_MAX >= x) {
|
||||
while (x >= y) {
|
||||
a = x / 2;
|
||||
b = y;
|
||||
while (a >= b) {
|
||||
b *= 2;
|
||||
}
|
||||
x -= b;
|
||||
}
|
||||
} else {
|
||||
x = 0;
|
||||
}
|
||||
return 0 > c ? -x : x;
|
||||
}
|
||||
|
||||
double jswrap_math_pow(double x, double y)
|
||||
{
|
||||
double p;
|
||||
if (0 > x && fs_fmod(y, 1) == 0) {
|
||||
if (fs_fmod(y, 2) == 0) {
|
||||
p = exp(log(-x) * y);
|
||||
} else {
|
||||
p = -exp(log(-x) * y);
|
||||
}
|
||||
} else {
|
||||
if (x != 0 || 0 >= y) {
|
||||
p = exp(log( x) * y);
|
||||
} else {
|
||||
p = 0;
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "pow",
|
||||
"generate" : "jswrap_math_pow",
|
||||
"params" : [ [ "x", "float", "The value to raise to the power"],
|
||||
[ "y", "float", "The power x should be raised to"] ],
|
||||
"return" : ["float", "x raised to the power y (x^y)"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "random",
|
||||
"generate_full" : "(JsVarFloat)rand() / (JsVarFloat)RAND_MAX",
|
||||
"return" : ["float", "A random number between 0 and 1"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "round",
|
||||
"generate" : "(JsVarInt)round",
|
||||
"params" : [ [ "x", "float", "The value to round"] ],
|
||||
"return" : ["int", "x, rounded to the nearest integer"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "sin",
|
||||
"generate" : "sin",
|
||||
"params" : [ [ "theta", "float", "The angle to get the sine of"] ],
|
||||
"return" : ["float", "The sine of theta"]
|
||||
}*/
|
||||
|
||||
/* we could use the real sqrt - but re-use pow to save on code space */
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "sqrt",
|
||||
"generate_full" : "jswrap_math_pow(jsvGetFloat(x),0.5)",
|
||||
"params" : [ [ "x", "float", "The value to take the square root of"] ],
|
||||
"return" : ["float", "The square root of x"]
|
||||
}*/
|
||||
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "ceil",
|
||||
"generate" : "ceil",
|
||||
"params" : [ [ "x", "float", "The value to round up"] ],
|
||||
"return" : ["float", "x, rounded upwards to the nearest integer"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "floor",
|
||||
"generate" : "floor",
|
||||
"params" : [ [ "x", "float", "The value to round down"] ],
|
||||
"return" : ["float", "x, rounded downwards to the nearest integer"]
|
||||
}*/
|
||||
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "exp",
|
||||
"generate" : "exp",
|
||||
"params" : [ [ "x", "float", "The value raise E to the power of"] ],
|
||||
"return" : ["float", "E^x"]
|
||||
}*/
|
||||
/*JSON{ "type":"staticmethod",
|
||||
"class" : "Math", "name" : "log",
|
||||
"generate" : "log",
|
||||
"params" : [ [ "x", "float", "The value to take the logarithm (base E) root of"] ],
|
||||
"return" : ["float", "The log (base E) of x"]
|
||||
}*/
|
||||
|
||||
/*JSON{ "type":"staticmethod", "ifndef" : "SAVE_ON_FLASH",
|
||||
"class" : "Math", "name" : "clip",
|
||||
"generate" : "jswrap_math_clip",
|
||||
"description" : "Clip a number to be between min and max (inclusive)",
|
||||
"params" : [ [ "x", "float", "A floating point value to clip"],
|
||||
[ "min", "float", "The smallest the value should be"],
|
||||
[ "max", "float", "The largest the value should be"] ],
|
||||
"return" : ["float", "The value of x, clipped so as not to be below min or above max."]
|
||||
}*/
|
||||
JsVarFloat jswrap_math_clip(JsVarFloat x, JsVarFloat min, JsVarFloat max) {
|
||||
if (x<min) x=min;
|
||||
if (x>max) x=max;
|
||||
return x;
|
||||
}
|
||||
|
||||
/*JSON{ "type":"staticmethod", "ifndef" : "SAVE_ON_FLASH",
|
||||
"class" : "Math", "name" : "wrap",
|
||||
"generate" : "wrapAround",
|
||||
"description" : "Wrap a number around if it is less than 0 or greater than or equal to max. For instance you might do: ```Math.wrap(angleInDegrees, 360)```",
|
||||
"params" : [ [ "x", "float", "A floating point value to wrap"],
|
||||
[ "max", "float", "The largest the value should be"] ],
|
||||
"return" : ["float", "The value of x, wrapped so as not to be below min or above max."]
|
||||
}*/
|
||||
|
||||
|
||||
28
components/external/espruino/libs/jswrap_math.h
vendored
28
components/external/espruino/libs/jswrap_math.h
vendored
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
|
||||
*
|
||||
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* Contains built-in functions for Maths
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
#include "jsutils.h"
|
||||
#include "jsvar.h"
|
||||
|
||||
#ifdef ARM
|
||||
#include "mconf.h"
|
||||
#include "protos.h"
|
||||
#else
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
|
||||
JsVarInt jswrap_integer_valueOf(JsVar *v);
|
||||
JsVarFloat jswrap_math_abs(JsVarFloat x);
|
||||
double jswrap_math_pow(double x, double y);
|
||||
JsVarFloat jswrap_math_clip(JsVarFloat x, JsVarFloat min, JsVarFloat max);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user