git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2237 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
c2efc1ebe9
commit
38cc48d575
|
@ -79,7 +79,7 @@ extern "C" {
|
||||||
((mbp)->mb_top - (mbp)->mb_buffer)
|
((mbp)->mb_top - (mbp)->mb_buffer)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the free space into the mailbox.
|
* @brief Returns the number of free message slots into a mailbox.
|
||||||
* @note Can be invoked in any system state but if invoked out of a locked
|
* @note Can be invoked in any system state but if invoked out of a locked
|
||||||
* state then the returned value may change after reading.
|
* state then the returned value may change after reading.
|
||||||
* @note The returned value can be less than zero when there are waiting
|
* @note The returned value can be less than zero when there are waiting
|
||||||
|
@ -90,10 +90,10 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @iclass
|
* @iclass
|
||||||
*/
|
*/
|
||||||
#define chMBGetEmptyI(mbp) chSemGetCounterI(&(mbp)->mb_emptysem)
|
#define chMBGetFreeCountI(mbp) chSemGetCounterI(&(mbp)->mb_emptysem)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the number of messages into the mailbox.
|
* @brief Returns the number of queued messages into a mailbox.
|
||||||
* @note Can be invoked in any system state but if invoked out of a locked
|
* @note Can be invoked in any system state but if invoked out of a locked
|
||||||
* state then the returned value may change after reading.
|
* state then the returned value may change after reading.
|
||||||
* @note The returned value can be less than zero when there are waiting
|
* @note The returned value can be less than zero when there are waiting
|
||||||
|
@ -104,14 +104,14 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @iclass
|
* @iclass
|
||||||
*/
|
*/
|
||||||
#define chMBGetFullI(mbp) chSemGetCounterI(&(mbp)->mb_fullsem)
|
#define chMBGetFullCountI(mbp) chSemGetCounterI(&(mbp)->mb_fullsem)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the next message in the queue without removing it.
|
* @brief Returns the next message in the queue without removing it.
|
||||||
* @pre A message must be waiting in the queue for this function to work
|
* @pre A message must be waiting in the queue for this function to work
|
||||||
* or it would return garbage. The correct way to use this macro is
|
* or it would return garbage. The correct way to use this macro is
|
||||||
* to use @p chMBGetFull() and then use this macro, all within a
|
* to use @p chMBGetFullCountI() and then use this macro, all within
|
||||||
* lock state.
|
* a lock state.
|
||||||
*
|
*
|
||||||
* @iclass
|
* @iclass
|
||||||
*/
|
*/
|
||||||
|
|
10
readme.txt
10
readme.txt
|
@ -122,13 +122,13 @@
|
||||||
semaphores.
|
semaphores.
|
||||||
- OPT: The fix to the bug 3075544 considerably improved the threads creation
|
- OPT: The fix to the bug 3075544 considerably improved the threads creation
|
||||||
benchmarks score.
|
benchmarks score.
|
||||||
- OPT: Speed optimizations of the STM32 SPI driver, improved latency.
|
- OPT: Speed optimizations to the STM32 SPI driver, improved latency.
|
||||||
- OPT: Speed optimizations of the STM32 ADC driver.
|
- OPT: Speed optimizations to the STM32 ADC driver.
|
||||||
- CHANGE: The API chThdInit() has been renamed to chThdCreateI() in order to
|
- CHANGE: The API chThdInit() has been renamed to chThdCreateI() in order to
|
||||||
make clear it is useable from interrupt handlers.
|
make clear it is usable from interrupt handlers.
|
||||||
- CHANGE: The mailboxes macros chMBSize(), chMBGetEmpty(), chMBGetFull(),
|
- CHANGE: The mailboxes macros chMBSize(), chMBGetEmpty(), chMBGetFull(),
|
||||||
chMBPeek() have been renamed to chMBSizeI(), chMBGetEmptyI(),
|
chMBPeek() have been renamed to chMBSizeI(), chMBGetFreeCountI(),
|
||||||
chMBGetFullI(), chMBPeekI().
|
chMBGetFullCountI(), chMBPeekI().
|
||||||
- CHANGE: The queue APIs chQSize(), chQSpace(), chIQIsEmpty(), chIQIsFull(),
|
- CHANGE: The queue APIs chQSize(), chQSpace(), chIQIsEmpty(), chIQIsFull(),
|
||||||
chOQIsEmpty(), chOQIsFull() have been renamed to chQSizeI(), chQSpaceI(),
|
chOQIsEmpty(), chOQIsFull() have been renamed to chQSizeI(), chQSpaceI(),
|
||||||
chIQIsEmptyI(), chIQIsFullI(), chOQIsEmptyI(), chOQIsFullI().
|
chIQIsEmptyI(), chIQIsFullI(), chOQIsEmptyI(), chOQIsFullI().
|
||||||
|
|
|
@ -83,7 +83,7 @@ static void mbox1_execute(void) {
|
||||||
/*
|
/*
|
||||||
* Testing initial space.
|
* Testing initial space.
|
||||||
*/
|
*/
|
||||||
test_assert(1, chMBGetEmptyI(&mb1) == MB_SIZE, "wrong size");
|
test_assert(1, chMBGetFreeCountI(&mb1) == MB_SIZE, "wrong size");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing enqueuing and backward circularity.
|
* Testing enqueuing and backward circularity.
|
||||||
|
@ -104,8 +104,8 @@ static void mbox1_execute(void) {
|
||||||
/*
|
/*
|
||||||
* Testing final conditions.
|
* Testing final conditions.
|
||||||
*/
|
*/
|
||||||
test_assert(5, chMBGetEmptyI(&mb1) == 0, "still empty");
|
test_assert(5, chMBGetFreeCountI(&mb1) == 0, "still empty");
|
||||||
test_assert(6, chMBGetFullI(&mb1) == MB_SIZE, "not full");
|
test_assert(6, chMBGetFullCountI(&mb1) == MB_SIZE, "not full");
|
||||||
test_assert(7, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned");
|
test_assert(7, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -137,8 +137,8 @@ static void mbox1_execute(void) {
|
||||||
/*
|
/*
|
||||||
* Testing final conditions.
|
* Testing final conditions.
|
||||||
*/
|
*/
|
||||||
test_assert(15, chMBGetEmptyI(&mb1) == MB_SIZE, "not empty");
|
test_assert(15, chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
|
||||||
test_assert(16, chMBGetFullI(&mb1) == 0, "still full");
|
test_assert(16, chMBGetFullCountI(&mb1) == 0, "still full");
|
||||||
test_assert(17, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned");
|
test_assert(17, mb1.mb_rdptr == mb1.mb_wrptr, "pointers not aligned");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -149,8 +149,8 @@ static void mbox1_execute(void) {
|
||||||
/*
|
/*
|
||||||
* Re-testing final conditions.
|
* Re-testing final conditions.
|
||||||
*/
|
*/
|
||||||
test_assert(18, chMBGetEmptyI(&mb1) == MB_SIZE, "not empty");
|
test_assert(18, chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
|
||||||
test_assert(19, chMBGetFullI(&mb1) == 0, "still full");
|
test_assert(19, chMBGetFullCountI(&mb1) == 0, "still full");
|
||||||
test_assert(20, mb1.mb_buffer == mb1.mb_wrptr, "write pointer not aligned to base");
|
test_assert(20, mb1.mb_buffer == mb1.mb_wrptr, "write pointer not aligned to base");
|
||||||
test_assert(21, mb1.mb_buffer == mb1.mb_rdptr, "read pointer not aligned to base");
|
test_assert(21, mb1.mb_buffer == mb1.mb_rdptr, "read pointer not aligned to base");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue