diff options
-rw-r--r-- | os/hal/platforms/Linux/console.c | 20 | ||||
-rw-r--r-- | os/hal/platforms/Linux/console.h | 24 | ||||
-rw-r--r-- | os/hal/platforms/Linux/hal_lld.c | 10 | ||||
-rw-r--r-- | os/hal/platforms/Linux/hal_lld.h | 4 | ||||
-rw-r--r-- | os/hal/platforms/Linux/serial_lld.c | 14 | ||||
-rw-r--r-- | os/hal/platforms/Linux/serial_lld.h | 10 |
6 files changed, 73 insertions, 9 deletions
diff --git a/os/hal/platforms/Linux/console.c b/os/hal/platforms/Linux/console.c index e6e9a1be8..c7b71823a 100644 --- a/os/hal/platforms/Linux/console.c +++ b/os/hal/platforms/Linux/console.c @@ -28,11 +28,23 @@ #include "ch.h"
#include "console.h"
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
/**
* @brief Console driver 1. */
BaseChannel CD1;
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions. */
+/*===========================================================================*/
+
static bool_t putwouldblock(void *ip) {
(void)ip;
@@ -65,6 +77,14 @@ static const struct BaseChannelVMT vmt = { {putwouldblock, getwouldblock, put, get}
};
+/*===========================================================================*/
+/* Driver interrupt handlers. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions. */
+/*===========================================================================*/
+
void conInit(void) {
CD1.vmt = &vmt;
diff --git a/os/hal/platforms/Linux/console.h b/os/hal/platforms/Linux/console.h index e8079a042..d6f6cc9c4 100644 --- a/os/hal/platforms/Linux/console.h +++ b/os/hal/platforms/Linux/console.h @@ -26,6 +26,30 @@ #ifndef _CONSOLE_H_
#define _CONSOLE_H_
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
extern BaseChannel CD1;
#ifdef __cplusplus
diff --git a/os/hal/platforms/Linux/hal_lld.c b/os/hal/platforms/Linux/hal_lld.c index 713d10637..e6679d07a 100644 --- a/os/hal/platforms/Linux/hal_lld.c +++ b/os/hal/platforms/Linux/hal_lld.c @@ -32,26 +32,26 @@ #include "hal.h"
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
static struct timeval nextcnt;
static struct timeval tick = {0, 1000000 / CH_FREQUENCY};
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/platforms/Linux/hal_lld.h b/os/hal/platforms/Linux/hal_lld.h index 3394546c7..42f8f5268 100644 --- a/os/hal/platforms/Linux/hal_lld.h +++ b/os/hal/platforms/Linux/hal_lld.h @@ -51,6 +51,10 @@ /*===========================================================================*/
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/platforms/Linux/serial_lld.c b/os/hal/platforms/Linux/serial_lld.c index 4d1de5b1f..b94e95039 100644 --- a/os/hal/platforms/Linux/serial_lld.c +++ b/os/hal/platforms/Linux/serial_lld.c @@ -36,6 +36,10 @@ #if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
/** @brief Serial driver 1 identifier.*/
#if USE_SIM_SERIAL1 || defined(__DOXYGEN__)
SerialDriver SD1;
@@ -45,6 +49,10 @@ SerialDriver SD1; SerialDriver SD2;
#endif
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
/** @brief Driver default configuration.*/
static const SerialDriverConfig default_config = {
};
@@ -52,7 +60,7 @@ static const SerialDriverConfig default_config = { static u_long nb = 1;
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
static void init(SerialDriver *sdp, uint16_t port) {
@@ -185,11 +193,11 @@ static bool_t outint(SerialDriver *sdp) { }
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/platforms/Linux/serial_lld.h b/os/hal/platforms/Linux/serial_lld.h index 481244ce3..a825ecc81 100644 --- a/os/hal/platforms/Linux/serial_lld.h +++ b/os/hal/platforms/Linux/serial_lld.h @@ -30,6 +30,10 @@ #if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@@ -75,7 +79,7 @@ #endif
/*===========================================================================*/
-/* Unsupported event flags and custom events. */
+/* Derived constants and error checks. */
/*===========================================================================*/
/*===========================================================================*/
@@ -145,6 +149,10 @@ typedef struct { } SerialDriverConfig;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
|