mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-08-18 20:48:41 +08:00
add the standard CMSIS(Version 3.01) into components
and implement examples in MB9BF506R and LPC176x branches define RT_USING_BSP_CMSIS in rtconfig.h will use CMSIS in bsp define RT_USING_RTT_CMSIS in rtconfig.h will use CMSIS in components git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2146 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
src = ['CM3/CoreSupport/core_cm3.c', 'CM3/DeviceSupport/NXP/LPC17xx/system_LPC17xx.c']
|
||||
|
||||
src = ['CM3/DeviceSupport/NXP/LPC17xx/system_LPC17xx.c']
|
||||
|
||||
# add for startup script
|
||||
if rtconfig.CROSS_TOOL == 'gcc':
|
||||
src += ['CM3/DeviceSupport/NXP/LPC17xx/startup/gcc/startup_LPC17xx.s']
|
||||
@@ -12,7 +14,13 @@ elif rtconfig.CROSS_TOOL == 'keil':
|
||||
elif rtconfig.CROSS_TOOL == 'iar':
|
||||
src += ['CM3/DeviceSupport/NXP/LPC17xx/startup/iar/startup_LPC17xx.s']
|
||||
|
||||
CPPPATH = [cwd + '/CM3/CoreSupport', cwd + '/CM3/DeviceSupport/NXP/LPC17xx/']
|
||||
CPPPATH = [cwd + '/CM3/DeviceSupport/NXP/LPC17xx/']
|
||||
|
||||
if GetDepend(['RT_USING_BSP_CMSIS']):
|
||||
CPPPATH += [cwd + '/CM3/CoreSupport']
|
||||
src += ['CM3/CoreSupport/core_cm3.c']
|
||||
elif GetDepend(['RT_USING_RTT_CMSIS']):
|
||||
CPPPATH += [RTT_ROOT + '/components/CMSIS/Include']
|
||||
|
||||
group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
|
||||
@@ -180,6 +180,13 @@
|
||||
#define RT_LWIP_MSKADDR3 0
|
||||
// </section>
|
||||
|
||||
// <bool name="RT_USING_CMSIS_OS" description="Using CMSIS OS API" default="true" />
|
||||
// #define RT_USING_CMSIS_OS
|
||||
// <bool name="RT_USING_RTT_CMSIS" description="Using CMSIS in RTT" default="true" />
|
||||
// #define RT_USING_RTT_CMSIS
|
||||
// <bool name="RT_USING_BSP_CMSIS" description="Using CMSIS in BSP" default="true" />
|
||||
#define RT_USING_BSP_CMSIS
|
||||
|
||||
// </RDTConfigurator>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
src = ['Device/FUJISTU/MB9BF50x/Source/system_mb9bf50x.c', 'CMSIS/RTOS/rtt_cmsis.c']
|
||||
src = ['Device/FUJISTU/MB9BF50x/Source/system_mb9bf50x.c']
|
||||
|
||||
# add for startup script
|
||||
if rtconfig.CROSS_TOOL == 'gcc':
|
||||
@@ -13,7 +14,12 @@ elif rtconfig.CROSS_TOOL == 'keil':
|
||||
elif rtconfig.CROSS_TOOL == 'iar':
|
||||
src += ['Device/FUJISTU/MB9BF50x/Source/IAR/startup_mb9bf50x.S']
|
||||
|
||||
CPPPATH = [cwd + '/CMSIS/Include', cwd + '/CMSIS/RTOS', cwd + '/Device/FUJISTU/MB9BF50x/Include']
|
||||
CPPPATH = [cwd + '/Device/FUJISTU/MB9BF50x/Include']
|
||||
|
||||
if GetDepend(['RT_USING_BSP_CMSIS']):
|
||||
CPPPATH += [cwd + '/CMSIS/Include']
|
||||
elif GetDepend(['RT_USING_RTT_CMSIS']):
|
||||
CPPPATH += [RTT_ROOT + '/components/CMSIS/Include']
|
||||
|
||||
group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
|
||||
@@ -164,6 +164,13 @@
|
||||
#define RT_NFS_HOST_EXPORT "192.168.1.5:/"
|
||||
// </section>
|
||||
|
||||
// <bool name="RT_USING_CMSIS_OS" description="Using CMSIS OS API" default="true" />
|
||||
// #define RT_USING_CMSIS_OS
|
||||
// <bool name="RT_USING_RTT_CMSIS" description="Using CMSIS in RTT" default="true" />
|
||||
#define RT_USING_RTT_CMSIS
|
||||
// <bool name="RT_USING_BSP_CMSIS" description="Using CMSIS in BSP" default="true" />
|
||||
// #define RT_USING_BSP_CMSIS
|
||||
|
||||
// </RDTConfigurator>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
* Copyright (C) 2010 ARM Limited. All rights reserved.
|
||||
*
|
||||
* $Date: 11. November 2010
|
||||
* $Revision: V1.0.2
|
||||
*
|
||||
* Project: CMSIS DSP Library
|
||||
* Title: arm_common_tables.h
|
||||
*
|
||||
* Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions
|
||||
*
|
||||
* Target Processor: Cortex-M4/Cortex-M3
|
||||
*
|
||||
* Version 1.0.2 2010/11/11
|
||||
* Documentation updated.
|
||||
*
|
||||
* Version 1.0.1 2010/10/05
|
||||
* Production release and review comments incorporated.
|
||||
*
|
||||
* Version 1.0.0 2010/09/20
|
||||
* Production release and review comments incorporated.
|
||||
* -------------------------------------------------------------------- */
|
||||
|
||||
#ifndef _ARM_COMMON_TABLES_H
|
||||
#define _ARM_COMMON_TABLES_H
|
||||
|
||||
#include "arm_math.h"
|
||||
|
||||
extern const uint16_t armBitRevTable[1024];
|
||||
extern const q15_t armRecipTableQ15[64];
|
||||
extern const q31_t armRecipTableQ31[64];
|
||||
extern const q31_t realCoefAQ31[1024];
|
||||
extern const q31_t realCoefBQ31[1024];
|
||||
extern const float32_t twiddleCoef[6144];
|
||||
extern const q31_t twiddleCoefQ31[6144];
|
||||
extern const q15_t twiddleCoefQ15[6144];
|
||||
|
||||
#endif /* ARM_COMMON_TABLES_H */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
* -------------------------------------------------------------------
|
||||
* Copyright (C) 2011-2012 ARM Limited. All rights reserved.
|
||||
*
|
||||
* Date: 07 March 2012
|
||||
* Revision: V3.01
|
||||
*
|
||||
* Project: Cortex Microcontroller Software Interface Standard (CMSIS)
|
||||
* Title: Release Note for CMSIS
|
||||
*
|
||||
* -------------------------------------------------------------------
|
||||
|
||||
|
||||
NOTE - Open the index.html file to access CMSIS documentation
|
||||
|
||||
|
||||
The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all
|
||||
Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects
|
||||
and reduces time-to-market for new embedded applications.
|
||||
|
||||
CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf").
|
||||
Any user of the software package is bound to the terms and conditions of the end user license agreement.
|
||||
|
||||
|
||||
You will find the following sub-directories:
|
||||
|
||||
Documentation - Contains CMSIS documentation.
|
||||
|
||||
DSP_Lib - MDK project files, Examples and source files etc.. to build the
|
||||
CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors.
|
||||
|
||||
Include - CMSIS Core Support and CMSIS DSP Include Files.
|
||||
|
||||
Lib - CMSIS DSP Libraries.
|
||||
|
||||
RTOS - CMSIS RTOS API template header file.
|
||||
|
||||
SVD - CMSIS SVD Schema files and Conversion Utility.
|
||||
@@ -0,0 +1,8 @@
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
group = DefineGroup('CMSIS_OS', src, depend = ['RT_USING_CMSIS_OS'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
+27
-6
@@ -43,7 +43,7 @@ osStatus osThreadTerminate(osThreadId thread_id)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
result = rt_thread_suspend(thread_id);
|
||||
result = rt_thread_delete(thread_id);
|
||||
|
||||
if (result == RT_EOK)
|
||||
return osOK;
|
||||
@@ -67,22 +67,27 @@ osStatus osThreadYield(void)
|
||||
/// Change prority of an active thread
|
||||
osStatus osThreadSetPriority(osThreadId thread_id, osPriority priority)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
if (thread_id == RT_NULL)
|
||||
return osErrorOS;
|
||||
|
||||
if (priority < osPriorityIdle || priority > osPriorityRealtime)
|
||||
return osErrorOS;
|
||||
|
||||
thread_id->current_priority = priority;
|
||||
return osErrorPriority;
|
||||
|
||||
return osOK;
|
||||
result = rt_thread_control(thread_id, RT_THREAD_CTRL_CHANGE_PRIORITY, &priority);
|
||||
|
||||
if (result == RT_EOK)
|
||||
return osOK;
|
||||
else
|
||||
return osErrorOS;
|
||||
}
|
||||
|
||||
/// Get current prority of an active thread
|
||||
osPriority osThreadGetPriority(osThreadId thread_id)
|
||||
{
|
||||
if (thread_id == RT_NULL)
|
||||
return osPriorityError;
|
||||
return osErrorOS;
|
||||
|
||||
if (thread_id->current_priority < osPriorityIdle || thread_id->current_priority > osPriorityRealtime)
|
||||
return osPriorityError;
|
||||
@@ -110,6 +115,17 @@ osStatus osDelay(uint32_t millisec)
|
||||
/// Wait for Signal, Message, Mail, or Timeout
|
||||
osEvent osWait(uint32_t millisec)
|
||||
{
|
||||
rt_err_t result;
|
||||
rt_tick_t ticks;
|
||||
|
||||
ticks = rt_tick_from_millisecond(millisec);
|
||||
result = rt_thread_delay(ticks);
|
||||
/*
|
||||
if (result == RT_EOK)
|
||||
return osOK;
|
||||
else
|
||||
return osErrorOS;
|
||||
*/
|
||||
}
|
||||
|
||||
// Timer Management Public API
|
||||
@@ -193,8 +209,13 @@ int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec)
|
||||
{
|
||||
rt_tick_t ticks;
|
||||
|
||||
if (semaphore_id == RT_NULL)
|
||||
return -1;
|
||||
|
||||
ticks = rt_tick_from_millisecond(millisec);
|
||||
rt_sem_take(semaphore_id, ticks);
|
||||
|
||||
return semaphore_id->value;
|
||||
}
|
||||
|
||||
/// Release a Semaphore
|
||||
@@ -0,0 +1,14 @@
|
||||
# for module compiling
|
||||
import os
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
||||
Reference in New Issue
Block a user