git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@588 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2009-01-06 09:32:35 +00:00
parent fee14cb4ce
commit 9f6887fdd7
7 changed files with 27 additions and 15 deletions

View File

@ -30,6 +30,15 @@
* that this is not related to the compiler optimization options.*/ * that this is not related to the compiler optimization options.*/
#define CH_OPTIMIZE_SPEED #define CH_OPTIMIZE_SPEED
/** Configuration option: If enabled then the used of nested @p chSysLock() /
* @p chSysUnlock() operations is allowed.<br>
* For performance and code size reasons the recommended setting is leave
* this option disabled.<br>
* You can use this option if you need to merge with ChibiOS/RT external
* libraries that require nested lock/unlock operations.
*/
//#define CH_USE_NESTED_LOCKS
/** Configuration option: if specified then the kernel performs the round /** Configuration option: if specified then the kernel performs the round
* robin scheduling algorithm on threads of equal priority. */ * robin scheduling algorithm on threads of equal priority. */
#define CH_USE_ROUNDROBIN #define CH_USE_ROUNDROBIN

View File

@ -55,9 +55,9 @@ static void SetError(uint16_t sr, FullDuplexDriver *com) {
sts |= SD_FRAMING_ERROR; sts |= SD_FRAMING_ERROR;
if (sr & SR_LBD) if (sr & SR_LBD)
sts |= SD_BREAK_DETECTED; sts |= SD_BREAK_DETECTED;
chSysLock(); chSysLockI();
chFDDAddFlagsI(com, sts); chFDDAddFlagsI(com, sts);
chSysUnlock(); chSysUnlockI();
} }
static void ServeInterrupt(USART_TypeDef *u, FullDuplexDriver *com) { static void ServeInterrupt(USART_TypeDef *u, FullDuplexDriver *com) {
@ -66,14 +66,14 @@ static void ServeInterrupt(USART_TypeDef *u, FullDuplexDriver *com) {
if (sr & (SR_ORE | SR_FE | SR_PE | SR_LBD)) if (sr & (SR_ORE | SR_FE | SR_PE | SR_LBD))
SetError(sr, com); SetError(sr, com);
if (sr & SR_RXNE) { if (sr & SR_RXNE) {
chSysLock(); chSysLockI();
chFDDIncomingDataI(com, u->DR); chFDDIncomingDataI(com, u->DR);
chSysUnlock(); chSysUnlockI();
} }
if (sr & SR_TXE) { if (sr & SR_TXE) {
chSysLock(); chSysLockI();
msg_t b = chFDDRequestDataI(com); msg_t b = chFDDRequestDataI(com);
chSysUnlock(); chSysUnlockI();
if (b < Q_OK) if (b < Q_OK)
u->CR1 &= ~CR1_TXEIE; u->CR1 &= ~CR1_TXEIE;
else else

View File

@ -135,7 +135,7 @@ typedef struct {
/** /**
* Computes the thread working area global size. * Computes the thread working area global size.
*/ */
#define THD_WA_SIZE(n) StackAlign(sizeof(Thread) + \ #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
sizeof(struct intctx) + \ sizeof(struct intctx) + \
sizeof(struct extctx) + \ sizeof(struct extctx) + \
(n) + (INT_REQUIRED_STACK)) (n) + (INT_REQUIRED_STACK))
@ -209,6 +209,7 @@ extern "C" {
#endif #endif
void sys_puts(char *msg); void sys_puts(char *msg);
void sys_halt(void); void sys_halt(void);
void threadstart(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -85,6 +85,8 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
*** 1.0.0rc2 *** *** 1.0.0rc2 ***
- FIX: Removed unused variable "retaddr" from the Cortex-M3 port. - FIX: Removed unused variable "retaddr" from the Cortex-M3 port.
- FIX: The macro THD_WA_SIZE was defined wrongly in the file
./src/templates/chcore.h.
*** 1.0.0rc1 *** *** 1.0.0rc1 ***
- NEW: Added new macros CH_KERNEL_VERSION set to "1.0.0rc1", CH_KERNEL_MAJOR - NEW: Added new macros CH_KERNEL_VERSION set to "1.0.0rc1", CH_KERNEL_MAJOR

View File

@ -71,7 +71,7 @@ void chSysInit(void) {
* serve interrupts in its context while keeping the lowest energy saving * serve interrupts in its context while keeping the lowest energy saving
* mode compatible with the system status. * mode compatible with the system status.
*/ */
chThdCreateStatic(idle_wa, sizeof(idle_thread_wa), IDLEPRIO, chThdCreateStatic(idle_thread_wa, sizeof(idle_thread_wa), IDLEPRIO,
(tfunc_t)idle_thread, NULL); (tfunc_t)idle_thread, NULL);
} }

View File

@ -153,7 +153,7 @@
*/ */
#if defined(CH_OPTIMIZE_SPEED) #if defined(CH_OPTIMIZE_SPEED)
#define chSysLock() chSysLockInline() #define chSysLock() chSysLockInline()
#define chSysUnlock chSysUnlockInline() #define chSysUnlock() chSysUnlockInline()
#endif /* defined(CH_OPTIMIZE_SPEED) */ #endif /* defined(CH_OPTIMIZE_SPEED) */
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -98,7 +98,7 @@ typedef struct {
/** /**
* Computes the thread working area global size. * Computes the thread working area global size.
*/ */
#define THD_WA_SIZE(n) StackAlign(sizeof(Thread) + \ #define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
sizeof(struct intctx) + \ sizeof(struct intctx) + \
sizeof(struct extctx) + \ sizeof(struct extctx) + \
(n) + (INT_REQUIRED_STACK)) (n) + (INT_REQUIRED_STACK))