From 41271d632b74f5cf47c30d3b699eb6b2786f2136 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 23 Jun 2018 13:02:07 +1000 Subject: Added new type definitions - moving towards V3.0 --- src/ginput/ginput_toggle.h | 60 ++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 34 deletions(-) (limited to 'src/ginput/ginput_toggle.h') diff --git a/src/ginput/ginput_toggle.h b/src/ginput/ginput_toggle.h index 7d028301..a8719db6 100644 --- a/src/ginput/ginput_toggle.h +++ b/src/ginput/ginput_toggle.h @@ -48,7 +48,7 @@ typedef struct GEventToggle_t { GEventType type; // The type of this event (GEVENT_TOGGLE) uint16_t instance; // The toggle instance - bool_t on; // True if the toggle/button is on + gBool on; // True if the toggle/button is on } GEventToggle; // Toggle Listen Flags - passed to geventAddSourceToListener() @@ -59,40 +59,32 @@ typedef struct GEventToggle_t { /* External declarations. */ /*===========================================================================*/ -#ifdef __cplusplus -extern "C" { -#endif +/** + * @brief Create a toggle input instance + * + * @param[in] instance The ID of the toggle input instance (from 0 to 9999) + * + * @return The source handle of the created instance + */ +GSourceHandle ginputGetToggle(uint16_t instance); - /** - * @brief Create a toggle input instance - * - * @param[in] instance The ID of the toggle input instance (from 0 to 9999) - * - * @return The source handle of the created instance - */ - GSourceHandle ginputGetToggle(uint16_t instance); - - /** - * @brief Can be used to invert the sense of a toggle - * - * @param[in] instance The ID of the toggle input instance - * @param[in] invert If TRUE, will be inverted - */ - void ginputInvertToggle(uint16_t instance, bool_t invert); - - /** - * @brief Get the current toggle status - * - * @param[in] instance The ID of the toggle input instance - * @param[in] ptoggle The toggle event struct - * - * @return Returns FALSE on an error (eg invalid instance) - */ - bool_t ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle); - -#ifdef __cplusplus -} -#endif +/** + * @brief Can be used to invert the sense of a toggle + * + * @param[in] instance The ID of the toggle input instance + * @param[in] invert If gTrue, will be inverted + */ +void ginputInvertToggle(uint16_t instance, gBool invert); + +/** + * @brief Get the current toggle status + * + * @param[in] instance The ID of the toggle input instance + * @param[in] ptoggle The toggle event struct + * + * @return Returns gFalse on an error (eg invalid instance) + */ +gBool ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle); #endif /* GINPUT_NEED_TOGGLE */ -- cgit v1.2.3