aboutsummaryrefslogtreecommitdiffstats
path: root/os/various
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-04-03 12:48:22 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-04-03 12:48:22 +0000
commit15d0007e9687428fe314e1369a9bb4eeb427cfcc (patch)
tree0ac60d4ec0245764ad601d763b0d3d5dc7c76539 /os/various
parent67b6d6cebf167faaf544886e1b1f41aaa404cb35 (diff)
downloadChibiOS-15d0007e9687428fe314e1369a9bb4eeb427cfcc.tar.gz
ChibiOS-15d0007e9687428fe314e1369a9bb4eeb427cfcc.tar.bz2
ChibiOS-15d0007e9687428fe314e1369a9bb4eeb427cfcc.zip
Mass change, all thread functions now return void.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7849 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/various')
-rw-r--r--os/various/lwip_bindings/lwipthread.c2
-rw-r--r--os/various/lwip_bindings/lwipthread.h2
-rw-r--r--os/various/shell.c25
3 files changed, 12 insertions, 17 deletions
diff --git a/os/various/lwip_bindings/lwipthread.c b/os/various/lwip_bindings/lwipthread.c
index 2335c01b2..ddb476aed 100644
--- a/os/various/lwip_bindings/lwipthread.c
+++ b/os/various/lwip_bindings/lwipthread.c
@@ -210,7 +210,7 @@ static err_t ethernetif_init(struct netif *netif) {
* @param[in] p pointer to a @p lwipthread_opts structure or @p NULL
* @return The function does not return.
*/
-msg_t lwip_thread(void *p) {
+THD_FUNCTION(lwip_thread, p) {
event_timer_t evt;
event_listener_t el0, el1;
struct ip_addr ip, gateway, netmask;
diff --git a/os/various/lwip_bindings/lwipthread.h b/os/various/lwip_bindings/lwipthread.h
index 5d3beb7ac..d69323e64 100644
--- a/os/various/lwip_bindings/lwipthread.h
+++ b/os/various/lwip_bindings/lwipthread.h
@@ -121,7 +121,7 @@ extern THD_WORKING_AREA(wa_lwip_thread, LWIP_THREAD_STACK_SIZE);
#ifdef __cplusplus
extern "C" {
#endif
- msg_t lwip_thread(void *p);
+ THD_FUNCTION(lwip_thread, p);
#ifdef __cplusplus
}
#endif
diff --git a/os/various/shell.c b/os/various/shell.c
index 09b61f836..4c2f3c6cd 100644
--- a/os/various/shell.c
+++ b/os/various/shell.c
@@ -121,22 +121,19 @@ static bool cmdexec(const ShellCommand *scp, BaseSequentialStream *chp,
while (scp->sc_name != NULL) {
if (strcasecmp(scp->sc_name, name) == 0) {
scp->sc_function(chp, argc, argv);
- return FALSE;
+ return false;
}
scp++;
}
- return TRUE;
+ return true;
}
/**
* @brief Shell thread function.
*
* @param[in] p pointer to a @p BaseSequentialStream object
- * @return Termination reason.
- * @retval MSG_OK terminated by command.
- * @retval MSG_RESET terminated by reset condition on the I/O channel.
*/
-static msg_t shell_thread(void *p) {
+static THD_FUNCTION(shell_thread, p) {
int n;
BaseSequentialStream *chp = ((ShellConfig *)p)->sc_channel;
const ShellCommand *scp = ((ShellConfig *)p)->sc_commands;
@@ -145,7 +142,7 @@ static msg_t shell_thread(void *p) {
chRegSetThreadName("shell");
chprintf(chp, "\r\nChibiOS/RT Shell\r\n");
- while (TRUE) {
+ while (true) {
chprintf(chp, "ch> ");
if (shellGetLine(chp, line, sizeof(line))) {
chprintf(chp, "\r\nlogout");
@@ -190,8 +187,6 @@ static msg_t shell_thread(void *p) {
}
}
shellExit(MSG_OK);
- /* Never executed, silencing a warning.*/
- return 0;
}
/**
@@ -265,22 +260,22 @@ thread_t *shellCreateStatic(const ShellConfig *scp, void *wsp,
* @param[in] line pointer to the line buffer
* @param[in] size buffer maximum length
* @return The operation status.
- * @retval TRUE the channel was reset or CTRL-D pressed.
- * @retval FALSE operation successful.
+ * @retval true the channel was reset or CTRL-D pressed.
+ * @retval false operation successful.
*
* @api
*/
bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size) {
char *p = line;
- while (TRUE) {
+ while (true) {
char c;
if (chSequentialStreamRead(chp, (uint8_t *)&c, 1) == 0)
- return TRUE;
+ return true;
if (c == 4) {
chprintf(chp, "^D");
- return TRUE;
+ return true;
}
if ((c == 8) || (c == 127)) {
if (p != line) {
@@ -294,7 +289,7 @@ bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size) {
if (c == '\r') {
chprintf(chp, "\r\n");
*p = 0;
- return FALSE;
+ return false;
}
if (c < 0x20)
continue;