Fixed calls to test suite in all applications.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9202 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
Giovanni Di Sirio 2016-04-02 07:11:56 +00:00
parent 109a347ca4
commit aed82faf72
59 changed files with 187 additions and 105 deletions

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
static WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) {
@ -56,7 +56,7 @@ int main(void) {
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
while(TRUE) {
chThdSleepMilliseconds(1000);
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
static THD_WORKING_AREA(waThread1, 64);
static THD_FUNCTION(Thread1, arg) {
@ -78,7 +78,7 @@ int main(void) {
chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
chThdCreateStatic(waThread3, sizeof(waThread3), NORMALPRIO, Thread3, NULL);
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
while (1) {
chThdSleepMilliseconds(500);
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
static THD_WORKING_AREA(waThread1, 64);
static THD_FUNCTION(Thread1, arg) {
@ -78,7 +78,7 @@ int main(void) {
chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
chThdCreateStatic(waThread3, sizeof(waThread3), NORMALPRIO, Thread3, NULL);
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
while (1) {
chThdSleepMilliseconds(500);
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* LED blinker thread.
@ -57,7 +57,7 @@ int main(void) {
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
while (true) {
chThdSleepMilliseconds(1000);
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#define BOTH_BUTTONS (PAL_PORT_BIT(PA_BUTTON1) | PAL_PORT_BIT(PA_BUTTON2))
@ -90,7 +90,7 @@ int main(void) {
if (!palReadPad(IOPORT1, PA_BUTTON1))
sdWrite(&SD1, (uint8_t *)"Hello World!\r\n", 14);
if (!palReadPad(IOPORT1, PA_BUTTON2))
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
return 0;

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -66,7 +66,7 @@ int main(void) {
*/
while (true) {
if (!palReadLine(LINE_ARD_D3))
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -66,7 +66,7 @@ int main(void) {
*/
while (true) {
if (!palReadLine(LINE_ARD_D3))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Blue LED blinker thread, times are in milliseconds.
@ -87,7 +87,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Blue LED blinker thread, times are in milliseconds.
@ -87,7 +87,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
}

View File

@ -17,7 +17,7 @@
#include "ch.h"
#include "hal.h"
#include "chprintf.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -67,7 +67,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Blinker thread #1.
@ -86,7 +86,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
}

View File

@ -516,6 +516,8 @@
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/
#define CORTEX_VTOR_INIT 0x5000
#endif /* CHCONF_H */
/** @} */

View File

@ -19,7 +19,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Blinker thread.
@ -68,7 +68,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -19,7 +19,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "chprintf.h"
#include "shell.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -19,7 +19,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* This is a periodic thread that does absolutely nothing except flashing
@ -69,7 +69,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Blinker thread #1.
@ -112,7 +112,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -66,7 +66,7 @@ int main(void) {
*/
while (true) {
if (!palReadLine(LINE_ARD_D3))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* LEDs blinker thread, times are in milliseconds.
@ -84,7 +84,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* This is a periodic thread that does absolutely nothing except flashing LEDs.
@ -76,7 +76,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_WKUP_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* This is a periodic thread that does absolutely nothing except flashing
@ -69,7 +69,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.hpp"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
using namespace chibios_rt;
@ -129,7 +129,7 @@ protected:
setName("tester");
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
exit(test_global_fail);
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "chprintf.h"
#include "shell.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* This is a periodic thread that does absolutely nothing except flashing
@ -69,7 +69,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -19,7 +19,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "chprintf.h"
#include "shell.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "chprintf.h"
#include "shell.h"

View File

@ -19,7 +19,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "chprintf.h"
#include "shell.h"

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Blinker thread #1.
@ -88,7 +88,7 @@ int main(void) {
*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
TestThread(&SD1);
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadPad(GPIOC, GPIOC_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* LEDs blinker thread, times are in milliseconds.
@ -69,7 +69,7 @@ int main(void) {
*/
while (true) {
if (palReadLine(LINE_JOY_CENTER))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
/*
* Green LED blinker thread, times are in milliseconds.
@ -65,7 +65,7 @@ int main(void) {
*/
while (true) {
if (!palReadLine(LINE_BUTTON))
TestThread(&SD2);
test_execute((BaseSequentialStream *)&SD2);
chThdSleepMilliseconds(500);
}
}

View File

@ -16,7 +16,7 @@
#include "ch.h"
#include "hal.h"
#include "test.h"
#include "ch_test.h"
#include "shell.h"
#include "chprintf.h"

View File

@ -93,6 +93,11 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
#endif /* CHTYPES_H */
/** @} */

View File

@ -93,6 +93,11 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define PACKED_VAR __packed
/**
* @brief Memory alignment enforcement for variables.
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
#endif /* CHTYPES_H */
/** @} */

View File

@ -93,6 +93,11 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define PACKED_VAR __packed
/**
* @brief Memory alignment enforcement for variables.
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
#endif /* CHTYPES_H */
/** @} */

View File

@ -105,6 +105,11 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
#endif /* CHTYPES_H */
/** @} */

View File

@ -88,6 +88,16 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
#endif /* CHTYPES_H */
/** @} */

View File

@ -88,6 +88,16 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define PORT_THD_FUNCTION(tname, arg) void tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
#endif /* CHTYPES_H */
/** @} */

View File

@ -22,19 +22,52 @@
*/
MEMORY
{
flash : org = 0x08005000, len = 128k - 0x5000
ram0 : org = 0x20000C00, len = 20k - 0xC00
ram1 : org = 0x00000000, len = 0
ram2 : org = 0x00000000, len = 0
ram3 : org = 0x00000000, len = 0
ram4 : org = 0x00000000, len = 0
ram5 : org = 0x00000000, len = 0
ram6 : org = 0x00000000, len = 0
ram7 : org = 0x00000000, len = 0
flash0 : org = 0x08005000, len = 128k - 0x5000
flash1 : org = 0x00000000, len = 0
flash2 : org = 0x00000000, len = 0
flash3 : org = 0x00000000, len = 0
flash4 : org = 0x00000000, len = 0
flash5 : org = 0x00000000, len = 0
flash6 : org = 0x00000000, len = 0
flash7 : org = 0x00000000, len = 0
ram0 : org = 0x20000C00, len = 20k - 0xC00
ram1 : org = 0x00000000, len = 0
ram2 : org = 0x00000000, len = 0
ram3 : org = 0x00000000, len = 0
ram4 : org = 0x00000000, len = 0
ram5 : org = 0x00000000, len = 0
ram6 : org = 0x00000000, len = 0
ram7 : org = 0x00000000, len = 0
}
/* For each data/text section two region are defined, a virtual region
and a load region (_LMA suffix).*/
/* Flash region to be used for exception vectors.*/
REGION_ALIAS("VECTORS_FLASH", flash0);
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
/* Flash region to be used for constructors and destructors.*/
REGION_ALIAS("XTORS_FLASH", flash0);
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
/* Flash region to be used for code text.*/
REGION_ALIAS("TEXT_FLASH", flash0);
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
/* Flash region to be used for read only data.*/
REGION_ALIAS("RODATA_FLASH", flash0);
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
/* Flash region to be used for various.*/
REGION_ALIAS("VARIOUS_FLASH", flash0);
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
/* Flash region to be used for RAM(n) initialization data.*/
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
/* RAM region to be used for Main stack. This stack accommodates the processing
of all exceptions and interrupts*/
of all exceptions and interrupts.*/
REGION_ALIAS("MAIN_STACK_RAM", ram0);
/* RAM region to be used for the process stack. This is the stack used by
@ -43,6 +76,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0);
/* RAM region to be used for data segment.*/
REGION_ALIAS("DATA_RAM", ram0);
REGION_ALIAS("DATA_RAM_LMA", flash0);
/* RAM region to be used for BSS segment.*/
REGION_ALIAS("BSS_RAM", ram0);
@ -50,4 +84,5 @@ REGION_ALIAS("BSS_RAM", ram0);
/* RAM region to be used for the default heap.*/
REGION_ALIAS("HEAP_RAM", ram0);
/* Generic rules inclusion.*/
INCLUDE rules.ld

View File

@ -136,12 +136,12 @@ static void serve_interrupt(SerialDriver *sdp) {
case IIR_SRC_TIMEOUT:
case IIR_SRC_RX:
osalSysLockFromISR();
if (chIQIsEmptyI(&sdp->iqueue))
if (iqIsEmptyI(&sdp->iqueue))
chnAddFlagsI(sdp, CHN_INPUT_AVAILABLE);
osalSysUnlockFromISR();
while (u->UART_LSR & LSR_RBR_FULL) {
osalSysLockFromISR();
if (chIQPutI(&sdp->iqueue, u->UART_RBR) < MSG_OK)
if (iqPutI(&sdp->iqueue, u->UART_RBR) < MSG_OK)
chnAddFlagsI(sdp, SD_OVERRUN_ERROR);
osalSysUnlockFromISR();
}
@ -153,7 +153,7 @@ static void serve_interrupt(SerialDriver *sdp) {
msg_t b;
osalSysLockFromISR();
b = chOQGetI(&sdp->oqueue);
b = oqGetI(&sdp->oqueue);
osalSysUnlockFromISR();
if (b < MSG_OK) {
u->UART_IER &= ~IER_THRE;
@ -182,7 +182,7 @@ static void preload(SerialDriver *sdp) {
if (u->UART_LSR & LSR_THRE) {
int i = LPC214x_UART_FIFO_PRELOAD;
do {
msg_t b = chOQGetI(&sdp->oqueue);
msg_t b = oqGetI(&sdp->oqueue);
if (b < MSG_OK) {
chnAddFlagsI(sdp, CHN_OUTPUT_EMPTY);
return;

View File

@ -31,7 +31,7 @@
#include "chprintf.h"
#if (SHELL_CMD_TEST_ENABLED == TRUE) || defined(__DOXYGEN__)
#include "test.h"
#include "ch_test.h"
#endif
/*===========================================================================*/
@ -181,7 +181,7 @@ static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) {
}
tp = chThdCreateFromHeap(NULL, SHELL_CMD_TEST_WA_SIZE,
"test", chThdGetPriorityX(),
TestThread, chp);
(tfunc_t)test_execute, chp);
if (tp == NULL) {
chprintf(chp, "out of memory\r\n");
return;

View File

@ -39,6 +39,11 @@
*/
unsigned test_step;
/**
* @brief Test result flag.
*/
bool test_global_fail;
/*===========================================================================*/
/* Module local types. */
/*===========================================================================*/
@ -48,7 +53,6 @@ unsigned test_step;
/*===========================================================================*/
static bool test_local_fail;
static bool test_global_fail;
static const char *test_failure_message;
static char test_tokens_buffer[TEST_MAX_TOKENS];
static char *test_tokp;
@ -74,7 +78,7 @@ static void execute_test(const testcase_t *tcp) {
/* Initialization */
clear_tokens();
test_local_fail = FALSE;
test_local_fail = false;
if (tcp->setup != NULL)
tcp->setup();
@ -97,17 +101,17 @@ static void print_line(void) {
bool _test_fail(const char *msg) {
test_local_fail = TRUE;
test_global_fail = TRUE;
test_local_fail = true;
test_global_fail = true;
test_failure_message = msg;
return TRUE;
return true;
}
bool _test_assert(bool condition, const char *msg) {
if (!condition)
return _test_fail(msg);
return FALSE;
return false;
}
bool _test_assert_sequence(char *expected, const char *msg) {
@ -123,7 +127,7 @@ bool _test_assert_sequence(char *expected, const char *msg) {
clear_tokens();
return FALSE;
return false;
}
bool _test_assert_time_window(systime_t start,
@ -215,8 +219,8 @@ void test_emit_token_i(char token) {
* @param[in] stream pointer to a @p BaseSequentialStream object for test
* output
* @return A failure boolean value casted to @p msg_t.
* @retval FALSE if no errors occurred.
* @retval TRUE if one or more tests failed.
* @retval false if no errors occurred.
* @retval true if one or more tests failed.
*
* @api
*/
@ -246,7 +250,7 @@ msg_t test_execute(BaseSequentialStream *stream) {
#endif
test_println("");
test_global_fail = FALSE;
test_global_fail = false;
i = 0;
while (test_suite[i]) {
j = 0;

View File

@ -156,6 +156,7 @@ typedef struct {
#if !defined(__DOXYGEN__)
extern unsigned test_step;
extern bool test_global_fail;
#endif
#ifdef __cplusplus