[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/handhelds/apps/MOBIUS/SixAxisCmdCtrl
SixAxisCmdCtrlM.nc, 1.1, 1.2
steve ayer
ayer1 at users.sourceforge.net
Wed Dec 19 07:35:51 PST 2007
Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/MOBIUS/SixAxisCmdCtrl
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12943/SixAxisCmdCtrl
Modified Files:
SixAxisCmdCtrlM.nc
Log Message:
all files:
---------
bluetooth api updates used: disableRemoteConfig() and setBaudrate().
xt2 bug fixes added (bcsctl2 init)
dma transfer bug fix (changed dmadt_5, repeat, to dmadt_1, single
transfer).
SixAxisCmdCtrlM.nc only:
-----------------------
fixed datatype mismatch bug in sample frequency change routine.
Index: SixAxisCmdCtrlM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/MOBIUS/SixAxisCmdCtrl/SixAxisCmdCtrlM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SixAxisCmdCtrlM.nc 19 Nov 2007 18:51:04 -0000 1.1
--- SixAxisCmdCtrlM.nc 19 Dec 2007 15:35:49 -0000 1.2
***************
*** 117,121 ****
norace uint8_t current_buffer = 0, dma_blocks = 0, g_data;
! uint16_t leftover_byte_count, sbuf0[36], sbuf1[36], wheressbuf0, timestamp0, timestamp1,
sample_freq = SAMPLING_100HZ, new_sample_freq = SAMPLING_0HZ_OFF;
--- 117,121 ----
norace uint8_t current_buffer = 0, dma_blocks = 0, g_data;
! uint16_t leftover_byte_count, sbuf0[36], sbuf1[36], timestamp0, timestamp1,
sample_freq = SAMPLING_100HZ, new_sample_freq = SAMPLING_0HZ_OFF;
***************
*** 145,149 ****
call DMA0.setBlockSize(7);
! // we want block transfer, repeated
DMA0CTL = DMADT_1 + DMADSTINCR_3 + DMASRCINCR_3;
}
--- 145,149 ----
call DMA0.setBlockSize(7);
! // we want block transfer, single
DMA0CTL = DMADT_1 + DMADSTINCR_3 + DMASRCINCR_3;
}
***************
*** 207,212 ****
register uint8_t i;
- wheressbuf0 = (uint16_t)&sbuf0;
-
atomic CLR_FLAG(BCSCTL1, XT2OFF); // basic clock system control reg, turn off XT2 osc
--- 207,210 ----
***************
*** 224,229 ****
call Leds.yellowOn();
TOSH_uwait(50000UL);
! atomic SET_FLAG(BCSCTL2, SELM_2); /* select master clock source, XT2CLK when XT2 oscillator present
! on-chip. LFXT1CLK when XT2 oscillator not present on-chip. */
call Leds.yellowOff();
--- 222,231 ----
call Leds.yellowOn();
TOSH_uwait(50000UL);
!
! atomic{
! BCSCTL2 = 0;
! SET_FLAG(BCSCTL2, SELM_2); /* select master clock source, XT2CLK when XT2 oscillator present */
! } /*on-chip. LFXT1CLK when XT2 oscillator not present on-chip. */
!
call Leds.yellowOff();
***************
*** 257,260 ****
--- 259,266 ----
call BTStdControl.init();
+ call Bluetooth.disableRemoteConfig(TRUE);
+ /* if CPU=8Mhz then customise roving networks baudrate to suit 8Mhz/9 baud */
+ call Bluetooth.setBaudrate("452");
+
call SerialCommandStdControl.init();
dma_blocks = 0;
***************
*** 293,341 ****
result_t result;
! result = SUCCESS;
! switch ( new_sample_freq ) {
! case 1000:
! new_sample_freq = SAMPLING_1000HZ;
! break;
! case 500:
! new_sample_freq = SAMPLING_500HZ;
! break;
! case 250:
! new_sample_freq = SAMPLING_250HZ;
! break;
! case 200:
! new_sample_freq = SAMPLING_200HZ;
! break;
! case 166:
! new_sample_freq = SAMPLING_166HZ;
! break;
! case 125:
! new_sample_freq = SAMPLING_125HZ;
! break;
! case 100:
! new_sample_freq = SAMPLING_100HZ;
! break;
! case 50:
! new_sample_freq = SAMPLING_50HZ;
! break;
! case 10:
! new_sample_freq = SAMPLING_10HZ;
! break;
! break;
! default:
! result = FAIL;
! }
!
! if(result == SUCCESS) {
! sample_freq = new_sample_freq;
! if(sensor_sampling) {
! call SampleTimer.stop();
! call SampleTimer.start(TIMER_REPEAT, sample_freq);
! }
! signal SensorControl.sampleFrequencyChanged(SUCCESS);
! }
! else {
! signal SensorControl.sampleFrequencyChanged(FAIL);
}
}
--- 299,308 ----
result_t result;
! sample_freq = new_sample_freq;
! if(sensor_sampling) {
! call SampleTimer.stop();
! call SampleTimer.start(TIMER_REPEAT, sample_freq);
}
+ signal SensorControl.sampleFrequencyChanged(SUCCESS);
}
***************
*** 373,379 ****
command result_t SensorControl.changeSampleFrequency(uint16_t new_freq){
! if(new_freq == sample_freq)
return SUCCESS;
!
new_sample_freq = new_freq;
post setSampleFrequency();
--- 340,378 ----
command result_t SensorControl.changeSampleFrequency(uint16_t new_freq){
!
! switch ( new_freq ) {
! case 1000:
! new_freq = SAMPLING_1000HZ;
! break;
! case 500:
! new_freq = SAMPLING_500HZ;
! break;
! case 250:
! new_freq = SAMPLING_250HZ;
! break;
! case 200:
! new_freq = SAMPLING_200HZ;
! break;
! case 166:
! new_freq = SAMPLING_166HZ;
! break;
! case 125:
! new_freq = SAMPLING_125HZ;
! break;
! case 100:
! new_freq = SAMPLING_100HZ;
! break;
! case 50:
! new_freq = SAMPLING_50HZ;
! break;
! case 10:
! new_freq = SAMPLING_10HZ;
! break;
! }
!
! if(new_freq == sample_freq) {
! signal SensorControl.sampleFrequencyChanged(SUCCESS);
return SUCCESS;
! }
new_sample_freq = new_freq;
post setSampleFrequency();
***************
*** 400,405 ****
case SAMPLING_10HZ:
return 10;
- break;
- break;
default:
return 0;
--- 399,402 ----
More information about the Tinyos-contrib-commits
mailing list