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

This commit is contained in:
Giovanni Di Sirio 2017-09-19 09:27:46 +00:00
parent ddd5260f0c
commit bdada7a07e
4 changed files with 64 additions and 57 deletions

View File

@ -42,7 +42,7 @@
* @note This number is not inclusive of the idle thread which is
* Implicitly handled.
*/
#define CH_CFG_NUM_THREADS 3
#define CH_CFG_NUM_THREADS 4
/** @} */

View File

@ -34,8 +34,8 @@
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList/&gt;"/>
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;globalVariableList/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;globalVariableList/&gt;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList/&gt;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="NIL-STM32F051-DISCOVERY"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>

View File

@ -16,6 +16,7 @@
#include "hal.h"
#include "ch.h"
#include "ch_test.h"
/*
* Thread 1.
@ -65,9 +66,14 @@ THD_FUNCTION(Thread3, arg) {
palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(1)); /* USART1 TX. */
palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(1)); /* USART1 RX. */
while (true) {
/* Welcome message.*/
chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14);
chThdSleepMilliseconds(2000);
/* Waiting for button push and activation of the test suite.*/
while (true) {
if (palReadLine(LINE_BUTTON))
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}
}
@ -78,7 +84,8 @@ THD_FUNCTION(Thread3, arg) {
THD_TABLE_BEGIN
THD_TABLE_ENTRY(waThread1, "blinker1", Thread1, NULL)
THD_TABLE_ENTRY(waThread2, "blinker2", Thread2, NULL)
THD_TABLE_ENTRY(waThread3, "hello", Thread3, NULL)
THD_TABLE_ENTRY(wa_test_support, "test_support", test_support, (void *)&nil.threads[3])
THD_TABLE_ENTRY(waThread3, "tester", Thread3, NULL)
THD_TABLE_END
/*

View File

@ -95,7 +95,7 @@ THD_FUNCTION(Thread3, arg) {
/* Waiting for button push and activation of the test suite.*/
while (true) {
if (palReadPad(GPIOA, GPIOA_BUTTON))
if (palReadLine(LINE_BUTTON))
test_execute((BaseSequentialStream *)&SD1);
chThdSleepMilliseconds(500);
}