[KINETIS] Add serial support to K20D50M demo + TestThread
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7150 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
6d80d25b76
commit
3ff810e5ee
|
@ -125,7 +125,7 @@
|
||||||
* @brief Enables the SERIAL subsystem.
|
* @brief Enables the SERIAL subsystem.
|
||||||
*/
|
*/
|
||||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||||
#define HAL_USE_SERIAL FALSE
|
#define HAL_USE_SERIAL TRUE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include "ch.h"
|
#include "ch.h"
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
|
#include "test.h"
|
||||||
|
|
||||||
static THD_WORKING_AREA(waThread1, 64);
|
static THD_WORKING_AREA(waThread1, 64);
|
||||||
static THD_FUNCTION(Thread1, arg) {
|
static THD_FUNCTION(Thread1, arg) {
|
||||||
|
@ -71,6 +72,11 @@ int main(void) {
|
||||||
halInit();
|
halInit();
|
||||||
chSysInit();
|
chSysInit();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Activates serial 1 (UART0) using the driver default configuration.
|
||||||
|
*/
|
||||||
|
sdStart(&SD1, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Creates the blinker threads.
|
* Creates the blinker threads.
|
||||||
*/
|
*/
|
||||||
|
@ -78,6 +84,7 @@ int main(void) {
|
||||||
chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
|
chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
|
||||||
chThdCreateStatic(waThread3, sizeof(waThread3), NORMALPRIO, Thread3, NULL);
|
chThdCreateStatic(waThread3, sizeof(waThread3), NORMALPRIO, Thread3, NULL);
|
||||||
|
|
||||||
|
TestThread(&SD1);
|
||||||
while (1) {
|
while (1) {
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,4 +54,4 @@
|
||||||
/*
|
/*
|
||||||
* SERIAL driver system settings.
|
* SERIAL driver system settings.
|
||||||
*/
|
*/
|
||||||
#define KINETIS_SERIAL_USE_UART0 FALSE
|
#define KINETIS_SERIAL_USE_UART0 TRUE
|
||||||
|
|
Loading…
Reference in New Issue