aboutsummaryrefslogtreecommitdiffstats
path: root/src/gadc
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-06-23 13:02:07 +1000
committerinmarket <andrewh@inmarket.com.au>2018-06-23 13:02:07 +1000
commit41271d632b74f5cf47c30d3b699eb6b2786f2136 (patch)
tree78bcb729c6d6177ca598f28908fefd186c50e9b6 /src/gadc
parent3b97fb798e96514057bcf17263c1e5dbdcd7da26 (diff)
downloaduGFX-41271d632b74f5cf47c30d3b699eb6b2786f2136.tar.gz
uGFX-41271d632b74f5cf47c30d3b699eb6b2786f2136.tar.bz2
uGFX-41271d632b74f5cf47c30d3b699eb6b2786f2136.zip
Added new type definitions - moving towards V3.0
Diffstat (limited to 'src/gadc')
-rw-r--r--src/gadc/gadc.c10
-rw-r--r--src/gadc/gadc.h14
2 files changed, 8 insertions, 16 deletions
diff --git a/src/gadc/gadc.c b/src/gadc/gadc.c
index 32a30930..8e8553df 100644
--- a/src/gadc/gadc.c
+++ b/src/gadc/gadc.c
@@ -214,7 +214,7 @@ void gadcHighSpeedInit(uint32_t physdev, uint32_t frequency)
#if GFX_USE_GEVENT
GSourceHandle gadcHighSpeedGetSource(void) {
if (!gtimerIsActive(&hsGTimer))
- gtimerStart(&hsGTimer, HighSpeedGTimerCallback, 0, TRUE, TIME_INFINITE);
+ gtimerStart(&hsGTimer, HighSpeedGTimerCallback, 0, gTrue, TIME_INFINITE);
hsFlags |= GADC_HSADC_GTIMER;
return (GSourceHandle)&hsGTimer;
}
@@ -319,16 +319,16 @@ void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer) {
gfxSemDestroy(&ndata.sigdone);
}
-bool_t gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param) {
+gBool gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param) {
NonTimerData *pdata;
/* Start the Low Speed Timer */
if (!gtimerIsActive(&lsGTimer))
- gtimerStart(&lsGTimer, LowSpeedGTimerCallback, 0, TRUE, TIME_INFINITE);
+ gtimerStart(&lsGTimer, LowSpeedGTimerCallback, 0, gTrue, TIME_INFINITE);
// Prepare the job
if (!(pdata = gfxAlloc(sizeof(NonTimerData))))
- return FALSE;
+ return gFalse;
pdata->job.physdev = physdev;
pdata->job.buffer = buffer;
pdata->callback = fn;
@@ -347,7 +347,7 @@ bool_t gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunc
gfxQueueGSyncPutI(&lsListToDo, (gfxQueueGSyncItem *)pdata);
}
gfxSystemUnlock();
- return TRUE;
+ return gTrue;
}
#endif /* GFX_USE_GADC */
diff --git a/src/gadc/gadc.h b/src/gadc/gadc.h
index 94321192..3e995db6 100644
--- a/src/gadc/gadc.h
+++ b/src/gadc/gadc.h
@@ -94,10 +94,6 @@ typedef void (*GADCISRCallbackFunction)(void);
/* External declarations. */
/*===========================================================================*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* @brief Initialise the high speed ADC.
* @details Initialises but does not start the conversions.
@@ -219,14 +215,14 @@ void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer);
/**
* @brief Perform a low speed ADC conversion with callback (in a thread context)
- * @details Returns FALSE if internal memory allocation fails
+ * @details Returns gFalse if internal memory allocation fails
*
* @param[in] physdev A value passed to describe which physical ADC devices/channels to use.
* @param[in] buffer The static buffer to put the ADC samples into.
* @param[in] fn The callback function to call when the conversion is complete.
* @param[in] param A parameter to pass to the callback function.
*
- * @return FALSE if no free low speed ADC slots.
+ * @return gFalse if no free low speed ADC slots.
*
* @note This may be safely called from within a GTimer callback.
* @note The callback may take a while to occur if the high speed ADC is running as the
@@ -240,11 +236,7 @@ void gadcLowSpeedGet(uint32_t physdev, adcsample_t *buffer);
*
* @api
*/
-bool_t gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param);
-
-#ifdef __cplusplus
-}
-#endif
+gBool gadcLowSpeedStart(uint32_t physdev, adcsample_t *buffer, GADCCallbackFunction fn, void *param);
#endif /* GFX_USE_GADC */