[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/msp430/adc12 AdcStreamP.nc, 1.5, 1.6 Msp430Adc12ImplP.nc, 1.13, 1.14
Jan-Hinrich Hauer
janhauer at users.sourceforge.net
Mon Nov 10 06:56:14 PST 2008
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2311/tos/chips/msp430/adc12
Modified Files:
AdcStreamP.nc Msp430Adc12ImplP.nc
Log Message:
Now returns an error if ADC12_TIMERA_ENABLED is not defined but configuration requires TimerA.
Index: AdcStreamP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12/AdcStreamP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AdcStreamP.nc 25 Jun 2008 16:36:29 -0000 1.5
--- AdcStreamP.nc 10 Nov 2008 14:56:12 -0000 1.6
***************
*** 94,98 ****
}
! command error_t ReadStream.postBuffer[uint8_t c](uint16_t *buf, uint16_t n) {
if (n < sizeof(struct list_entry_t))
return ESIZE;
--- 94,99 ----
}
! error_t postBuffer(uint8_t c, uint16_t *buf, uint16_t n)
! {
if (n < sizeof(struct list_entry_t))
return ESIZE;
***************
*** 112,115 ****
--- 113,120 ----
}
+ command error_t ReadStream.postBuffer[uint8_t c](uint16_t *buf, uint16_t n) {
+ return postBuffer(c, buf, n);
+ }
+
task void readStreamDone() {
uint8_t c = client;
***************
*** 205,210 ****
config.sampcon_ssel = SAMPCON_SOURCE_SMCLK; // assumption: SMCLK runs at 1 MHz
config.sampcon_id = SAMPCON_CLOCK_DIV_1;
! call SingleChannel.configureMultiple[c]( &config, pos, count, period);
! call SingleChannel.getData[c]();
}
}
--- 210,219 ----
config.sampcon_ssel = SAMPCON_SOURCE_SMCLK; // assumption: SMCLK runs at 1 MHz
config.sampcon_id = SAMPCON_CLOCK_DIV_1;
! if (call SingleChannel.configureMultiple[c]( &config, pos, count, period) == SUCCESS)
! call SingleChannel.getData[c]();
! else {
! postBuffer(c, pos, count);
! post readStreamFail();
! }
}
}
Index: Msp430Adc12ImplP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/adc12/Msp430Adc12ImplP.nc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Msp430Adc12ImplP.nc 29 Sep 2008 15:51:24 -0000 1.13
--- Msp430Adc12ImplP.nc 10 Nov 2008 14:56:12 -0000 1.14
***************
*** 64,68 ****
implementation
{
! #warning Accessing TimerA for ADC12
enum {
SINGLE_DATA = 1,
--- 64,72 ----
implementation
{
!
! #ifdef ADC12_TIMERA_ENABLED
! #warning Accessing TimerA for ADC12
! #endif
!
enum {
SINGLE_DATA = 1,
***************
*** 219,222 ****
--- 223,230 ----
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;
***************
*** 267,270 ****
--- 275,282 ----
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;
***************
*** 324,327 ****
--- 336,343 ----
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;
***************
*** 403,406 ****
--- 419,426 ----
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)
More information about the Tinyos-2-commits
mailing list