Update all demos comments and indent

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11429 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Theodore Ateba 2018-02-04 13:36:12 +00:00
parent d9ad41cec2
commit dacb403627
15 changed files with 43 additions and 26 deletions

View File

@ -41,7 +41,7 @@ THD_FUNCTION(Thread2, arg) {
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
* PA9 and PA10 are routed to USART1. * PE0(RX) and PE1(TX) are routed to USART0.
*/ */
sdStart(&SD1, NULL); sdStart(&SD1, NULL);

View File

@ -41,7 +41,7 @@ THD_FUNCTION(Thread2, arg) {
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
* PA9 and PA10 are routed to USART1. * PD0(RX) and PD1(TX) are routed to USART0.
*/ */
sdStart(&SD1, NULL); sdStart(&SD1, NULL);

View File

@ -41,7 +41,7 @@ THD_FUNCTION(Thread2, arg) {
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
* PA9 and PA10 are routed to USART1. * PD0(RX) and PD1(TX) are routed to USART0.
*/ */
sdStart(&SD1, NULL); sdStart(&SD1, NULL);

View File

@ -41,7 +41,7 @@ THD_FUNCTION(Thread2, arg) {
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
* PA9 and PA10 are routed to USART1. * PD0(RX) and PD1(TX) are routed to USART0.
*/ */
sdStart(&SD1, NULL); sdStart(&SD1, NULL);

View File

@ -17,6 +17,9 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {

View File

@ -17,6 +17,9 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
@ -43,8 +46,6 @@ int main(void) {
halInit(); halInit();
chSysInit(); chSysInit();
palClearPad(IOPORT2, PORTB_LED1);
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
*/ */

View File

@ -17,6 +17,9 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
@ -43,8 +46,6 @@ int main(void) {
halInit(); halInit();
chSysInit(); chSysInit();
palClearPad(IOPORT2, PORTB_LED1);
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
*/ */

View File

@ -17,6 +17,9 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
@ -43,8 +46,6 @@ int main(void) {
halInit(); halInit();
chSysInit(); chSysInit();
palClearPad(IOPORT2, PORTB_LED1);
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
*/ */
@ -56,6 +57,7 @@ int main(void) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14); chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14);
while (TRUE) { while (TRUE) {
chThdSleepMilliseconds(1000); chThdSleepMilliseconds(1000);
} }

View File

@ -29,12 +29,14 @@ const UARTConfig uartConf = {
38400, /* UART baudrate. */ 38400, /* UART baudrate. */
}; };
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
(void)arg; (void)arg;
chRegSetThreadName("Blinker"); chRegSetThreadName("Blinker");
while (true) { while (true) {
palTogglePad(IOPORT2, PORTB_LED1); palTogglePad(IOPORT2, PORTB_LED1);
uartStartSend(&UARTD1, 30, (const void *) "ChibiOS PORT on ATtiny-167!.\n\r"); uartStartSend(&UARTD1, 30, (const void *) "ChibiOS PORT on ATtiny-167!.\n\r");
@ -57,8 +59,6 @@ int main(void) {
halInit(); halInit();
chSysInit(); chSysInit();
//palClearPad(IOPORT2, PORTB_LED1);
/* /*
* Initialize the UART interface. * Initialize the UART interface.
*/ */

View File

@ -17,12 +17,14 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
(void)arg; (void)arg;
chRegSetThreadName("Blinker"); chRegSetThreadName("Blinker");
while (true) { while (true) {
palClearPad(IOPORT5, PORTE_LED); palClearPad(IOPORT5, PORTE_LED);
chThdSleepMilliseconds(1000); chThdSleepMilliseconds(1000);

View File

@ -20,6 +20,9 @@
SerialUSBDriver SDU1; SerialUSBDriver SDU1;
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {

View File

@ -19,6 +19,9 @@
#include "shell.h" #include "shell.h"
#include "usbcfg.h" #include "usbcfg.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 128); static THD_WORKING_AREA(waThread1, 128);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
(void)arg; (void)arg;

View File

@ -18,6 +18,9 @@
#include "hal.h" #include "hal.h"
#include "oslib_test_root.h" #include "oslib_test_root.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
@ -44,8 +47,6 @@ int main(void) {
halInit(); halInit();
chSysInit(); chSysInit();
palClearPad(IOPORT2, PORTB_LED1);
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
*/ */

View File

@ -18,6 +18,9 @@
#include "hal.h" #include "hal.h"
#include "rt_test_root.h" #include "rt_test_root.h"
/*
* LED blinker thread, times are in milliseconds.
*/
static THD_WORKING_AREA(waThread1, 32); static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) { static THD_FUNCTION(Thread1, arg) {
@ -44,8 +47,6 @@ int main(void) {
halInit(); halInit();
chSysInit(); chSysInit();
palClearPad(IOPORT2, PORTB_LED1);
/* /*
* Activates the serial driver 1 using the driver default configuration. * Activates the serial driver 1 using the driver default configuration.
*/ */