}
implementation
{
-#warning Accessing TimerA for ADC12
+
+#ifdef ADC12_TIMERA_ENABLED
+ #warning Accessing TimerA for ADC12
+#endif
+
enum {
SINGLE_DATA = 1,
SINGLE_DATA_REPEAT = 2,
{
error_t result = ERESERVE;
#ifdef ADC12_CHECK_ARGS
+#ifndef ADC12_TIMERA_ENABLED
+ if (jiffies>0)
+ return EINVAL;
+#endif
if (!config || jiffies == 1 || jiffies == 2)
return EINVAL;
#endif
{
error_t result = ERESERVE;
#ifdef ADC12_CHECK_ARGS
+#ifndef ADC12_TIMERA_ENABLED
+ if (jiffies>0)
+ return EINVAL;
+#endif
if (!config || !buf || !length || jiffies == 1 || jiffies == 2)
return EINVAL;
#endif
{
error_t result = ERESERVE;
#ifdef ADC12_CHECK_ARGS
+#ifndef ADC12_TIMERA_ENABLED
+ if (jiffies>0)
+ return EINVAL;
+#endif
if (!config || !buf || !length || length > 16 || jiffies == 1 || jiffies == 2)
return EINVAL;
#endif
{
atomic {
if (call ADCArbiterInfo.userId() == id){
- if (state & MULTIPLE_DATA_REPEAT && !resultBufferStart)
+ if ((state & MULTIPLE_DATA_REPEAT) && !resultBufferStart)
return EINVAL;
if (state & ADC_BUSY)
return EBUSY;
{
error_t result = ERESERVE;
#ifdef ADC12_CHECK_ARGS
+#ifndef ADC12_TIMERA_ENABLED
+ if (jiffies>0)
+ return EINVAL;
+#endif
if (!config || !memctl || !numMemctl || numMemctl > 15 || !numSamples ||
!buf || jiffies == 1 || jiffies == 2 || numSamples % (numMemctl+1) != 0)
return EINVAL;
case MULTI_CHANNEL:
{
uint16_t i = 0, k;
- resultBuffer = resultBufferStart;
+ resultBuffer = resultBufferStart + resultBufferIndex;
do {
*resultBuffer++ = call HplAdc12.getMem(i);
} while (++i < numChannels);
resultBufferIndex = 0;
signal MultiChannel.dataReady[clientID](resultBuffer,
overflow ? k : resultBufferLength);
- } else call HplAdc12.enableConversion();
+ }
}
break;
case MULTIPLE_DATA: