aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gdisp/fonts.c6
-rw-r--r--src/gdisp/gdisp.c2
-rw-r--r--src/gevent/gevent.c96
-rw-r--r--src/ginput/dial.c3
-rw-r--r--src/ginput/keyboard.c5
-rw-r--r--src/ginput/mouse.c12
-rw-r--r--src/ginput/toggle.c3
-rw-r--r--src/gtimer/gtimer.c84
-rw-r--r--src/gwin/button.c6
-rw-r--r--src/gwin/console.c6
-rw-r--r--src/gwin/graph.c6
-rw-r--r--src/gwin/gwin.c6
12 files changed, 34 insertions, 201 deletions
diff --git a/src/gdisp/fonts.c b/src/gdisp/fonts.c
index e02dc3bd..59293359 100644
--- a/src/gdisp/fonts.c
+++ b/src/gdisp/fonts.c
@@ -737,7 +737,7 @@ static bool_t matchfont(const char *pattern, const char *name) {
* @details The supplied name is matched against the font name. A '*' will replace 0 or more characters.
* @return Returns a font or NULL if no matching font could be found.
*
- * @params[in] name The font name to find.
+ * @param[in] name The font name to find.
*
* @note Wildcard matching will match the shortest possible match.
*
@@ -756,7 +756,7 @@ font_t gdispOpenFont(const char *name) {
/**
* @brief Release a font after use.
*
- * @params[in] font The font to release.
+ * @param[in] font The font to release.
*
* @api
*/
@@ -768,7 +768,7 @@ void gdispCloseFont(font_t font) {
* @brief Get the name of the specified font.
* @returns The name of the font.
*
- * @params[in] font The font to get the name for.
+ * @param[in] font The font to get the name for.
*
* @api
*/
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 1f37e107..48d00b95 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -19,7 +19,7 @@
*/
/**
- * @file src/gdisp.c
+ * @file src/gdisp/gdisp.c
* @brief GDISP Driver code.
*
* @addtogroup GDISP
diff --git a/src/gevent/gevent.c b/src/gevent/gevent.c
index be3ad7df..f3d909f0 100644
--- a/src/gevent/gevent.c
+++ b/src/gevent/gevent.c
@@ -19,7 +19,7 @@
*/
/**
- * @file src/gevent.c
+ * @file src/gevent/gevent.c
* @brief GEVENT Driver code.
*
* @addtogroup GEVENT
@@ -61,13 +61,6 @@ static void deleteAssignments(GListener *pl, GSourceHandle gsh) {
}
}
-/**
- * @brief Create a Listener
- * @details If insufficient resources are available it will either assert or return NULL
- * depending on the value of GEVENT_ASSERT_NO_RESOURCE.
- *
- * @param[in] pl A listener
- */
void geventListenerInit(GListener *pl) {
chSemInit(&pl->waitqueue, 0); // Next wait'er will block
chBSemInit(&pl->eventlock, FALSE); // Only one thread at a time looking at the event buffer
@@ -75,19 +68,6 @@ void geventListenerInit(GListener *pl) {
pl->event.type = GEVENT_NULL; // Always safety
}
-/**
- * @brief Attach a source to a listener
- * @details Flags are interpreted by the source when generating events for each listener.
- * If this source is already assigned to the listener it will update the flags.
- * If insufficient resources are available it will either assert or return FALSE
- * depending on the value of GEVENT_ASSERT_NO_RESOURCE.
- *
- * @param[in] pl The listener
- * @param[in] gsh The source which has to be attached to the listener
- * @param[in] flags The flags
- *
- * @return TRUE if succeeded, FALSE otherwise
- */
bool_t geventAttachSource(GListener *pl, GSourceHandle gsh, unsigned flags) {
GSourceListener *psl, *pslfree;
@@ -127,14 +107,6 @@ bool_t geventAttachSource(GListener *pl, GSourceHandle gsh, unsigned flags) {
return pslfree != 0;
}
-/**
- * @brief Detach a source from a listener
- * @details If gsh is NULL detach all sources from this listener and if there is still
- * a thread waiting for events on this listener, it is sent the exit event.
- *
- * @param[in] pl The listener
- * @param[in] gsh The source
- */
void geventDetachSource(GListener *pl, GSourceHandle gsh) {
if (pl && gsh) {
chMtxLock(&geventMutex);
@@ -149,47 +121,12 @@ void geventDetachSource(GListener *pl, GSourceHandle gsh) {
}
}
-/**
- * @brief Wait for an event on a listener from an assigned source.
- * @details The type of the event should be checked (pevent->type) and then pevent should
- * be typecast to the actual event type if it needs to be processed.
- * timeout specifies the time to wait in system ticks.
- * TIME_INFINITE means no timeout - wait forever for an event.
- * TIME_IMMEDIATE means return immediately
- * @note The GEvent buffer is staticly allocated within the GListener so the event does not
- * need to be dynamicly freed however it will get overwritten by the next call to
- * this routine.
- *
- * @param[in] pl The listener
- * @param[in] timeout The timeout
- *
- * @return NULL on timeout
- */
GEvent *geventEventWait(GListener *pl, systime_t timeout) {
if (pl->callback || chSemGetCounterI(&pl->waitqueue) < 0)
return 0;
return chSemWaitTimeout(&pl->waitqueue, timeout) == RDY_OK ? &pl->event : 0;
}
-/* @brief Register a callback for an event on a listener from an assigned source.
- * @details The type of the event should be checked (pevent->type) and then pevent should be typecast to the
- * actual event type if it needs to be processed.
- *
- * @params[in] pl The Listener
- * @params[in] fn The function to call back
- * @params[in] param A parameter to pass the callback function
- *
- * @note The GEvent buffer is valid only during the time of the callback. The callback MUST NOT save
- * a pointer to the buffer for use outside the callback.
- * @note An existing callback function is de-registered by passing a NULL for 'fn'. Any existing
- * callback function is replaced. Any thread currently waiting using geventEventWait will be sent the exit event.
- * @note Callbacks occur in a thread context but stack space must be kept to a minumum and
- * the callback must process quickly as all other events are performed on a single thread.
- * @note In the callback function you should never call ANY event functions using your own GListener handle
- * as it WILL create a deadlock and lock the system up.
- * @note Applications should not use this call - geventEventWait() is the preferred mechanism for an
- * application. This call is provided for GUI objects that may not have their own thread.
- */
void geventRegisterCallback(GListener *pl, GEventCallbackFn fn, void *param) {
if (pl) {
chMtxLock(&geventMutex);
@@ -205,15 +142,6 @@ void geventRegisterCallback(GListener *pl, GEventCallbackFn fn, void *param) {
}
}
-/**
- * @brief Called by a source with a possible event to get a listener record.
- * @details @p lastlr should be NULL on the first call and thereafter the result of the previous call.
- *
- * @param[in] gsh The source handler
- * @param[in] lastlr The source listener
- *
- * @return NULL when there are no more listeners for this source
- */
GSourceListener *geventGetSourceListener(GSourceHandle gsh, GSourceListener *lastlr) {
GSourceListener *psl;
@@ -239,28 +167,11 @@ GSourceListener *geventGetSourceListener(GSourceHandle gsh, GSourceListener *las
return 0;
}
-/**
- * @brief Get the event buffer from the GSourceListener.
- * @details A NULL return allows the source to record (perhaps in glr->scrflags) that the listener
- * has missed events. This can then be notified as part of the next event for the listener.
- * The buffer can only be accessed untill the next call to geventGetSourceListener
- * or geventSendEvent
- *
- * @param[in] psl The source listener
- *
- * @return NULL if the listener is not currently listening.
- */
GEvent *geventGetEventBuffer(GSourceListener *psl) {
// We already know we have the event lock
return &psl->pListener->callback || chSemGetCounterI(&psl->pListener->waitqueue) < 0 ? &psl->pListener->event : 0;
}
-/**
- * @brief Called by a source to indicate the listener's event buffer has been filled.
- * @details After calling this function the source must not reference in fields in the GSourceListener or the event buffer.
- *
- * @param[in] psl The source listener
- */
void geventSendEvent(GSourceListener *psl) {
chMtxLock(&geventMutex);
if (psl->pListener->callback) { // This test needs to be taken inside the mutex
@@ -276,11 +187,6 @@ void geventSendEvent(GSourceListener *psl) {
}
}
-/**
- * @brief Detach any listener that has this source attached
- *
- * @param[in] gsh The source handle
- */
void geventDetachSourceListeners(GSourceHandle gsh) {
chMtxLock(&geventMutex);
deleteAssignments(0, gsh);
diff --git a/src/ginput/dial.c b/src/ginput/dial.c
index 233daa08..a447d8bc 100644
--- a/src/ginput/dial.c
+++ b/src/ginput/dial.c
@@ -22,7 +22,8 @@
* @file src/ginput/dial.c
* @brief GINPUT dial code.
*
- * @addtogroup GINPUT
+ * @defgroup Dial Dial
+ * @ingroup GINPUT
* @{
*/
#include "ch.h"
diff --git a/src/ginput/keyboard.c b/src/ginput/keyboard.c
index bd443e77..56ff5e8a 100644
--- a/src/ginput/keyboard.c
+++ b/src/ginput/keyboard.c
@@ -22,9 +22,12 @@
* @file src/ginput/keyboard.c
* @brief GINPUT keyboard code.
*
- * @addtogroup GINPUT
+ * @defgroup Keyboard Keyboard
+ * @ingroup GINPUT
+ *
* @{
*/
+
#include "ch.h"
#include "hal.h"
#include "gfx.h"
diff --git a/src/ginput/mouse.c b/src/ginput/mouse.c
index 5e762ef9..35a55bc5 100644
--- a/src/ginput/mouse.c
+++ b/src/ginput/mouse.c
@@ -22,7 +22,8 @@
* @file src/ginput/mouse.c
* @brief GINPUT mouse/touch code.
*
- * @addtogroup GINPUT_MOUSE
+ * @defgroup Mouse Mouse
+ * @ingroup GINPUT
* @{
*/
#include "ch.h"
@@ -322,7 +323,6 @@ static void MousePoll(void *param) {
}
}
-/* Mouse Functions */
GSourceHandle ginputGetMouse(uint16_t instance) {
#if GINPUT_MOUSE_NEED_CALIBRATION
Calibration *pc;
@@ -377,10 +377,6 @@ GSourceHandle ginputGetMouse(uint16_t instance) {
return (GSourceHandle)&MouseConfig;
}
-/* Get the current mouse position and button status.
- * Unlike a listener event, this status cannot record meta events such as "CLICK"
- * Returns FALSE on error (eg invalid instance)
- */
bool_t ginputGetMouseStatus(uint16_t instance, GEventMouse *pe) {
if (instance || (MouseConfig.flags & (FLG_INIT_DONE|FLG_IN_CAL)) != FLG_INIT_DONE)
return FALSE;
@@ -401,9 +397,6 @@ bool_t ginputGetMouseStatus(uint16_t instance, GEventMouse *pe) {
return TRUE;
}
-/* Run a mouse calibration.
- * Returns FALSE if the driver doesn't support it or if the handle is invalid.
- */
bool_t ginputCalibrateMouse(uint16_t instance) {
#if !GINPUT_MOUSE_NEED_CALIBRATION
(void) instance;
@@ -527,6 +520,7 @@ bool_t ginputCalibrateMouse(uint16_t instance) {
MouseConfig.fnsavecal(instance, (const uint8_t *)&MouseConfig.caldata, sizeof(MouseConfig.caldata));
MouseConfig.flags |= FLG_CAL_SAVED;
}
+
return TRUE;
#endif
}
diff --git a/src/ginput/toggle.c b/src/ginput/toggle.c
index 3b2e98bf..66021cd0 100644
--- a/src/ginput/toggle.c
+++ b/src/ginput/toggle.c
@@ -22,7 +22,8 @@
* @file src/ginput/toggle.c
* @brief GINPUT toggle code.
*
- * @addtogroup GINPUT_TOGGLE
+ * @defgroup Toggle Toggle
+ * @ingroup GINPUT
* @{
*/
#include "ch.h"
diff --git a/src/gtimer/gtimer.c b/src/gtimer/gtimer.c
index 76c527f4..76dd57e2 100644
--- a/src/gtimer/gtimer.c
+++ b/src/gtimer/gtimer.c
@@ -43,7 +43,7 @@
/* Don't rework this macro to use a ternary operator - the gcc compiler stuffs it up */
#define TimeIsWithin(x, start, end) ((end >= start && x >= start && x <= end) || (end < start && (x >= start || x <= end)))
-// This mutex protects access to our tables
+/* This mutex protects access to our tables */
static MUTEX_DECL(mutex);
static Thread *pThread = 0;
static GTimer *pTimerHead = 0;
@@ -141,46 +141,10 @@ static msg_t GTimerThreadHandler(void *arg) {
return 0;
}
-/**
- * @brief Initialise a timer.
- *
- * @param[in] pt pointer to a GTimer structure
- *
- * @api
- */
void gtimerInit(GTimer *pt) {
pt->flags = 0;
}
-/**
- * @brief Set a timer going or alter its properties if it is already going.
- *
- * @param[in] pt Pointer to a GTimer structure
- * @param[in] fn The callback function
- * @param[in] param The parameter to pass to the callback function
- * @param[in] periodic Is the timer a periodic timer? FALSE is a once-only timer.
- * @param[in] millisec The timer period. The following special values are allowed:
- * TIME_IMMEDIATE causes the callback function to be called asap.
- * A periodic timer with this value will fire once only.
- * TIME_INFINITE never timeout (unless triggered by gtimerJab or gtimerJabI)
- *
- * @note If the timer is already active its properties are updated with the new parameters.
- * The current period will be immediately canceled (without the callback function being
- * called) and the timer will be restart with the new timer properties.
- * @note The callback function should be careful not to over-run the thread stack.
- * Define a new value for the macro GTIME_THREAD_STACK_SIZE if you want to
- * change the default size.
- * @note The callback function should return as quickly as possible as all
- * timer callbacks are performed by a single thread. If a callback function
- * takes too long it could affect the timer response for other timers.
- * @note A timer callback function is not a replacement for a dedicated thread if the
- * function wants to perform computationally expensive stuff.
- * @note As the callback function is called on GTIMER's thread, the function must make sure it uses
- * appropriate synchronisation controls such as semaphores or mutexes around any data
- * structures it shares with other threads such as the main application thread.
- *
- * @api
- */
void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, bool_t periodic, systime_t millisec) {
chMtxLock(&mutex);
@@ -230,15 +194,6 @@ void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, bool_t periodic, sy
chMtxUnlock();
}
-/**
- * @brief Stop a timer (periodic or otherwise)
- *
- * @param[in] pt Pointer to a GTimer structure
- *
- * @note If the timer is not active this does nothing.
- *
- * @api
- */
void gtimerStop(GTimer *pt) {
chMtxLock(&mutex);
if (pt->flags & GTIMER_FLG_SCHEDULED) {
@@ -257,32 +212,10 @@ void gtimerStop(GTimer *pt) {
chMtxUnlock();
}
-/**
- * @brief Test if a timer is currently active
- *
- * @param[in] pt Pointer to a GTimer structure
- *
- * @return TRUE if active, FALSE otherwise
- *
- * @api
- */
bool_t gtimerIsActive(GTimer *pt) {
return (pt->flags & GTIMER_FLG_SCHEDULED) ? TRUE : FALSE;
}
-/**
- * @brief Jab a timer causing the current period to immediate expire
- * @details The callback function will be called as soon as possible.
- *
- * @pre Use from a normal thread context.
- *
- * @param[in] pt Pointer to a GTimer structure
- *
- * @note If the timer is not active this does nothing.
- * @note Repeated Jabs before the callback function actually happens are ignored.
- *
- * @api
- */
void gtimerJab(GTimer *pt) {
chMtxLock(&mutex);
@@ -294,20 +227,6 @@ void gtimerJab(GTimer *pt) {
chMtxUnlock();
}
-/**
- * @brief Jab a timer causing the current period to immediate expire
- * @details The callback function will be called as soon as possible.
- *
- * @pre Use from an interrupt routine context.
- *
- * @param[in] pt Pointer to a GTimer structure
- *
- * @note If the timer is not active this does nothing.
- * @note Repeated Jabs before the callback function actually happens are ignored.
- *
- * @iclass
- * @api
- */
void gtimerJabI(GTimer *pt) {
// Jab it!
pt->flags |= GTIMER_FLG_JABBED;
@@ -318,3 +237,4 @@ void gtimerJabI(GTimer *pt) {
#endif /* GFX_USE_GTIMER */
/** @} */
+
diff --git a/src/gwin/button.c b/src/gwin/button.c
index 0c2c1ab3..9a06f4fe 100644
--- a/src/gwin/button.c
+++ b/src/gwin/button.c
@@ -17,14 +17,16 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
/**
* @file src/gwin/button.c
* @brief GWIN sub-system button code.
*
- * @addtogroup GWIN_BUTTON
+ * @defgroup Button Button
+ * @ingroup GWIN
+ *
* @{
*/
+
#include "ch.h"
#include "hal.h"
#include "gfx.h"
diff --git a/src/gwin/console.c b/src/gwin/console.c
index 7854b658..0297da30 100644
--- a/src/gwin/console.c
+++ b/src/gwin/console.c
@@ -17,14 +17,16 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
/**
* @file src/gwin/console.c
* @brief GWIN sub-system console code.
*
- * @addtogroup GWIN_CONSOLE
+ * @defgroup Console Console
+ * @ingroup GWIN
+ *
* @{
*/
+
#include "ch.h"
#include "hal.h"
#include "gfx.h"
diff --git a/src/gwin/graph.c b/src/gwin/graph.c
index cc457d7d..39628047 100644
--- a/src/gwin/graph.c
+++ b/src/gwin/graph.c
@@ -17,14 +17,16 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
/**
* @file src/gwin/button.c
* @brief GWIN sub-system button code.
*
- * @addtogroup GWIN_BUTTON
+ * @defgroup Button Button
+ * @ingroup GWIN
+ *
* @{
*/
+
#include "ch.h"
#include "hal.h"
#include "gfx.h"
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c
index 999ea304..4eef79ad 100644
--- a/src/gwin/gwin.c
+++ b/src/gwin/gwin.c
@@ -17,14 +17,16 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
/**
* @file src/gwin/gwin.c
* @brief GWIN sub-system code.
*
- * @addtogroup GWIN
+ * @defgroup Window Window
+ * @ingroup GWIN
+ *
* @{
*/
+
#include "ch.h"
#include "hal.h"
#include "gfx.h"