summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorja Martinez2016-12-16 10:35:28 -0600
committerBorja Martinez2016-12-16 10:35:28 -0600
commit444105ac3e09205bf148123a9634f6935313d946 (patch)
treee89f0688ab3ce891c81493a3d68e32a4e08375de
parent02b40175b0334de46a8f51979d7ed0e4ecc119ee (diff)
downloadi3-mote-444105ac3e09205bf148123a9634f6935313d946.tar.gz
i3-mote-444105ac3e09205bf148123a9634f6935313d946.tar.xz
i3-mote-444105ac3e09205bf148123a9634f6935313d946.zip
Update CC2650 Tests
-rw-r--r--Basic-Test-Package/CC2650/Test_CC2650_3wSPI_DAC8730/main.c143
-rw-r--r--Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Master_MSP432_SlaveIRQ/main.c28
-rw-r--r--Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Slave_MSP432_Master/main.c21
-rw-r--r--Basic-Test-Package/CC2650/Test_CC2650_DebugUART_EchoPC/main.c9
-rw-r--r--Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c27
5 files changed, 174 insertions, 54 deletions
diff --git a/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_DAC8730/main.c b/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_DAC8730/main.c
index a359419..3d5ed6a 100644
--- a/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_DAC8730/main.c
+++ b/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_DAC8730/main.c
@@ -4,12 +4,14 @@
4/* XDCtools Header files */ 4/* XDCtools Header files */
5#include <xdc/std.h> 5#include <xdc/std.h>
6#include <xdc/runtime/System.h> 6#include <xdc/runtime/System.h>
7#include <xdc/runtime/Error.h>
7 8
8/* BIOS Header files */ 9/* BIOS Header files */
9#include <ti/sysbios/BIOS.h> 10#include <ti/sysbios/BIOS.h>
10#include <ti/sysbios/knl/Task.h> 11#include <ti/sysbios/knl/Task.h>
11#include <ti/sysbios/knl/Clock.h> 12#include <ti/sysbios/knl/Clock.h>
12#include <ti/sysbios/knl/Semaphore.h> 13#include <ti/sysbios/knl/Semaphore.h>
14#include <ti/sysbios/knl/Event.h>
13 15
14/* TI-RTOS Header files */ 16/* TI-RTOS Header files */
15//#include <ti/drivers/I2C.h> 17//#include <ti/drivers/I2C.h>
@@ -34,6 +36,10 @@ Task_Struct task2Struct;
34Char task2Stack[TASKSTACKSIZE]; 36Char task2Stack[TASKSTACKSIZE];
35 37
36 38
39
40Event_Handle myEvent;
41Error_Block eb;
42
37Semaphore_Struct semStruct; 43Semaphore_Struct semStruct;
38Semaphore_Handle semHandle; 44Semaphore_Handle semHandle;
39 45
@@ -73,22 +79,49 @@ PIN_Config buttonPinTable[] = {
73 79
74void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) { 80void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) {
75 81
76 PIN_setOutputValue(ledPinHandle, Board_LED1,1); 82 CPUdelay(8000*200);
77 Semaphore_post(semHandle); 83
78 CPUdelay(8000*50); 84 Semaphore_post(semHandle);
79 PIN_setOutputValue(ledPinHandle, Board_LED1,0); 85 //Event_post(myEvent,Event_Id_02);
86
87}
88
89Void uartFxn(UArg arg0, UArg arg1)
90{
91 char input;
92
93 while (1) {
94 // Blocking Read
95 input=uart_getch();
96 if(input=='g'){
97 //Event_post(myEvent,Event_Id_02);
98 Semaphore_post(semHandle);
99 }
100 Task_sleep((UInt)arg0);
101 }
102
80} 103}
81 104
82 105
106
83#define REGSBW 0x1E 107#define REGSBW 0x1E
84#define REGSBR 0x0F 108#define REGSBR 0x0F
109
110#define EEPSBW 0x5A
85#define EEPSBR 0x4B 111#define EEPSBR 0x4B
86 112
87#define CMRST 0xC3 113#define CMRST 0xC3
88 114
89#define WENA 0x00 115#define WENA 0x00
116#define VCFG1 0x01
117#define VCFG2 0x01
118
119#define STA1 0x07
120#define STA2 0x08
90#define GPVR 0x0C 121#define GPVR 0x0C
91 122
123#define CFG3 0xA6
124
92 125
93Void spiFxn(UArg arg0, UArg arg1) 126Void spiFxn(UArg arg0, UArg arg1)
94{ 127{
@@ -97,11 +130,13 @@ Void spiFxn(UArg arg0, UArg arg1)
97 130
98 int i; 131 int i;
99 uint8_t k=0; 132 uint8_t k=0;
133 int flagerr=0;
100 134
101 SPI_Handle spi; 135 SPI_Handle spi;
102 SPI_Params spiParams; 136 SPI_Params spiParams;
103 SPI_Transaction spiTransaction; 137 SPI_Transaction spiTransaction;
104 138
139 UInt events;
105 140
106 SPI_Params_init(&spiParams); 141 SPI_Params_init(&spiParams);
107 // Slave mode 142 // Slave mode
@@ -119,8 +154,15 @@ Void spiFxn(UArg arg0, UArg arg1)
119 //Task_sleep((UInt)arg0); 154 //Task_sleep((UInt)arg0);
120 155
121 System_printf("Press button:\r\n"); 156 System_printf("Press button:\r\n");
157 PIN_setOutputValue(ledPinHandle, Board_LED0,1);
158 PIN_setOutputValue(ledPinHandle, Board_LED1,1);
159
122 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER); 160 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
123 161
162 /* Start test */
163 PIN_setOutputValue(ledPinHandle, Board_LED0,0);
164 PIN_setOutputValue(ledPinHandle, Board_LED1,0);
165
124 /* Send SPI Reset Command */ 166 /* Send SPI Reset Command */
125 167
126 spiTransaction.rxBuf = rxBufferPointer; 168 spiTransaction.rxBuf = rxBufferPointer;
@@ -136,8 +178,17 @@ Void spiFxn(UArg arg0, UArg arg1)
136 rxBufferPointer[2]=0; 178 rxBufferPointer[2]=0;
137 179
138 if (SPI_transfer(spi,&spiTransaction)) { 180 if (SPI_transfer(spi,&spiTransaction)) {
139 System_printf("Rst: %x %x %x\r\n",rxBufferPointer[0],rxBufferPointer[1],rxBufferPointer[2]); 181 if (rxBufferPointer[2] != 0xF0)
182 {
183 Event_post(myEvent, Event_Id_00);
184 flagerr=1;
185 }
186 System_printf("RST: %x %x %x\r\n",rxBufferPointer[0],rxBufferPointer[1],rxBufferPointer[2]);
140 System_flush(); 187 System_flush();
188 }else{
189 Event_post(myEvent, Event_Id_00);
190 flagerr=1;
191 //Task_exit();
141 } 192 }
142 for(i=1000;i>0;i--); 193 for(i=1000;i>0;i--);
143 194
@@ -156,14 +207,37 @@ Void spiFxn(UArg arg0, UArg arg1)
156 spiTransaction.count = 7; 207 spiTransaction.count = 7;
157 208
158 if (SPI_transfer(spi,&spiTransaction)) { 209 if (SPI_transfer(spi,&spiTransaction)) {
210
211 if (rxBufferPointer[2] != 0xF0)
212 {
213 Event_post(myEvent, Event_Id_00);
214 flagerr=1;
215 }
216
159 System_printf("IDC: "); 217 System_printf("IDC: ");
160 for(i=0;i<7;i++){ 218 for(i=0;i<7;i++){
161 System_printf("%x ",rxBufferPointer[i]); 219 System_printf("%x ",rxBufferPointer[i]);
162 } 220 }
163 System_printf("\r\n"); 221 System_printf("\r\n");
164 System_flush(); 222 System_flush();
223 }else{
224 Event_post(myEvent, Event_Id_00);
225 flagerr=1;
226 //Task_exit();
165 } 227 }
166 228
229 /* OK! */
230 if(flagerr==0){
231 Event_post(myEvent, Event_Id_01);
232 System_printf("***\r\n");
233 System_flush();
234 }else{
235 System_printf("KO!\r\n");
236 System_flush();
237 }
238
239 System_printf("Press button to continue:\r\n");
240 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
167 241
168 while(1){ 242 while(1){
169 243
@@ -216,7 +290,6 @@ Void spiFxn(UArg arg0, UArg arg1)
216 System_flush(); 290 System_flush();
217 } 291 }
218 292
219
220 /* READ 1 BYTE from EEPROM 293 /* READ 1 BYTE from EEPROM
221 txBufferPointer[0]=EEPSBR; 294 txBufferPointer[0]=EEPSBR;
222 txBufferPointer[1]=0xA0; 295 txBufferPointer[1]=0xA0;
@@ -247,10 +320,26 @@ Void spiFxn(UArg arg0, UArg arg1)
247 */ 320 */
248Void heartBeatFxn(UArg arg0, UArg arg1) 321Void heartBeatFxn(UArg arg0, UArg arg1)
249{ 322{
250 while (1) { 323
324 UInt events;
325
326 events=Event_pend(myEvent,Event_Id_NONE,Event_Id_00+Event_Id_01,BIOS_WAIT_FOREVER);
327
328 if(events & Event_Id_00){
329 while (1)
330 {
331 Task_sleep((UInt)arg0);
332 PIN_setOutputValue(ledPinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));
333 }
334 }
335
336 if(events & Event_Id_01){
337 while (1)
338 {
251 Task_sleep((UInt)arg0); 339 Task_sleep((UInt)arg0);
252 PIN_setOutputValue(ledPinHandle, Board_LED0,!PIN_getOutputValue(Board_LED0)); 340 PIN_setOutputValue(ledPinHandle, Board_LED0,!PIN_getOutputValue(Board_LED0));
253 } 341 }
342 }
254} 343}
255 344
256/* 345/*
@@ -268,6 +357,15 @@ int main(void)
268 Board_initUART(); 357 Board_initUART();
269 // Board_initWatchdog(); 358 // Board_initWatchdog();
270 359
360
361 /* Default instance configuration params */
362 Error_init(&eb);
363 myEvent = Event_create(NULL,&eb);
364 if (myEvent == NULL) {
365 System_abort("Event create failed");
366 }
367
368
271 /* BMH Init UART for System_printf() */ 369 /* BMH Init UART for System_printf() */
272 UART_Params uartParams; 370 UART_Params uartParams;
273 UART_Params_init(&uartParams); 371 UART_Params_init(&uartParams);
@@ -276,6 +374,14 @@ int main(void)
276 System_printf("Uart open\r\n"); 374 System_printf("Uart open\r\n");
277 375
278 376
377 /* Construct SPI Echo Task thread */
378 Task_Params_init(&taskParams);
379 taskParams.arg0 = 1000000 / Clock_tickPeriod;
380 taskParams.stackSize = TASKSTACKSIZE;
381 taskParams.stack = &task1Stack;
382 Task_construct(&task1Struct, (Task_FuncPtr)spiFxn, &taskParams, NULL);
383
384
279 /* Construct heartBeat Task thread */ 385 /* Construct heartBeat Task thread */
280 Task_Params_init(&taskParams); 386 Task_Params_init(&taskParams);
281 taskParams.arg0 = 500000 / Clock_tickPeriod; 387 taskParams.arg0 = 500000 / Clock_tickPeriod;
@@ -283,20 +389,21 @@ int main(void)
283 taskParams.stack = &task0Stack; 389 taskParams.stack = &task0Stack;
284 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL); 390 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
285 391
286 /* Construct SPI Echo Task thread */ 392
393 /* Construct Uart Task thread */
287 Task_Params_init(&taskParams); 394 Task_Params_init(&taskParams);
288 taskParams.arg0 = 1000000 / Clock_tickPeriod; 395 taskParams.arg0 = 100000 / Clock_tickPeriod;
289 taskParams.stackSize = TASKSTACKSIZE; 396 taskParams.stackSize = TASKSTACKSIZE;
290 taskParams.stack = &task1Stack; 397 taskParams.stack = &task2Stack;
291 Task_construct(&task1Struct, (Task_FuncPtr)spiFxn, &taskParams, NULL); 398 Task_construct(&task2Struct, (Task_FuncPtr)uartFxn, &taskParams, NULL);
292 399
293 /* Construct Semaphore */ 400
401 /* Construct Semaphore Obtain instance handle */
294 Semaphore_Params_init(&semParams); 402 Semaphore_Params_init(&semParams);
295 Semaphore_construct(&semStruct,0, &semParams); 403 Semaphore_construct(&semStruct,0, &semParams);
296
297 /* Obtain instance handle */
298 semHandle = Semaphore_handle(&semStruct); 404 semHandle = Semaphore_handle(&semStruct);
299 405
406
300 /* Setup callback for button pins */ 407 /* Setup callback for button pins */
301 buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable); 408 buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable);
302 if(!buttonPinHandle) { 409 if(!buttonPinHandle) {
@@ -313,8 +420,8 @@ int main(void)
313 System_abort("Error initializing board LED pins\n"); 420 System_abort("Error initializing board LED pins\n");
314 } 421 }
315 422
316 PIN_setOutputValue(ledPinHandle, Board_LED0, 0); 423 PIN_setOutputValue(ledPinHandle, Board_LED0, 1);
317 PIN_setOutputValue(ledPinHandle, Board_LED1, 0); 424 PIN_setOutputValue(ledPinHandle, Board_LED1, 1);
318 425
319 /* Start BIOS */ 426 /* Start BIOS */
320 BIOS_start(); 427 BIOS_start();
diff --git a/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Master_MSP432_SlaveIRQ/main.c b/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Master_MSP432_SlaveIRQ/main.c
index f96d641..e758490 100644
--- a/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Master_MSP432_SlaveIRQ/main.c
+++ b/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Master_MSP432_SlaveIRQ/main.c
@@ -59,19 +59,15 @@ PIN_Config buttonPinTable[] = {
59 59
60void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) { 60void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) {
61 61
62 /* Wait IRQ from MSP432 line*/ 62 Semaphore_post(semHandle);
63 PIN_setOutputValue(ledPinHandle, Board_LED1,1); 63 PIN_setOutputValue(ledPinHandle, Board_LEDR,1);
64 CPUdelay(8000*100);
65 Semaphore_post(semHandle);
66 PIN_setOutputValue(ledPinHandle, Board_LED1,0);
67 64
68} 65}
69 66
70 67
71
72Void echoFxn(UArg arg0, UArg arg1) 68Void echoFxn(UArg arg0, UArg arg1)
73{ 69{
74 uint8_t i=0; 70
75 uint8_t txBufferPointer[4]; 71 uint8_t txBufferPointer[4];
76 uint8_t rxBufferPointer[4]; 72 uint8_t rxBufferPointer[4];
77 SPI_Handle spi; 73 SPI_Handle spi;
@@ -99,13 +95,11 @@ Void echoFxn(UArg arg0, UArg arg1)
99 95
100 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER); 96 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
101 97
102 //txBufferPointer[0]=i++;
103 //rxBufferPointer[0]=0;
104
105 txBufferPointer[0]=rxBufferPointer[0]; 98 txBufferPointer[0]=rxBufferPointer[0];
106 99
107 if (SPI_transfer(spi,&spiTransaction)) { 100 if (SPI_transfer(spi,&spiTransaction)) {
108 System_printf("RxData: %x TxData: %x\r\n",rxBufferPointer[0],txBufferPointer[0]); 101 //System_printf("RxData: %x TxData: %x\r\n",rxBufferPointer[0],txBufferPointer[0]);
102 PIN_setOutputValue(ledPinHandle, Board_LEDR,0);
109 } 103 }
110 } 104 }
111 105
@@ -119,10 +113,18 @@ Void echoFxn(UArg arg0, UArg arg1)
119 * Toggle the Board_LED0. The Task_sleep is determined by arg0 which 113 * Toggle the Board_LED0. The Task_sleep is determined by arg0 which
120 * is configured for the heartBeat Task instance. 114 * is configured for the heartBeat Task instance.
121 */ 115 */
116
122Void heartBeatFxn(UArg arg0, UArg arg1) 117Void heartBeatFxn(UArg arg0, UArg arg1)
123{ 118{
119
124 while (1) { 120 while (1) {
125 Task_sleep((UInt)arg0); 121
122 Task_sleep((UInt)arg0-5000/Clock_tickPeriod);
123 PIN_setOutputValue(ledPinHandle, Board_LEDG,1);
124 Task_sleep((UInt)5000/Clock_tickPeriod);
125 PIN_setOutputValue(ledPinHandle, Board_LEDG,0);
126
127 //Task_sleep((UInt)arg0);
126 //PIN_setOutputValue(ledPinHandle, Board_LED0,!PIN_getOutputValue(Board_LED0)); 128 //PIN_setOutputValue(ledPinHandle, Board_LED0,!PIN_getOutputValue(Board_LED0));
127 //PIN_setOutputValue(ledPinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1)); 129 //PIN_setOutputValue(ledPinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));
128 } 130 }
@@ -154,7 +156,7 @@ int main(void)
154 156
155 /* Construct heartBeat Task thread */ 157 /* Construct heartBeat Task thread */
156 Task_Params_init(&taskParams); 158 Task_Params_init(&taskParams);
157 taskParams.arg0 = 500000 / Clock_tickPeriod; 159 taskParams.arg0 = 2000000 / Clock_tickPeriod;
158 taskParams.stackSize = TASKSTACKSIZE; 160 taskParams.stackSize = TASKSTACKSIZE;
159 taskParams.stack = &task0Stack; 161 taskParams.stack = &task0Stack;
160 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL); 162 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
diff --git a/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Slave_MSP432_Master/main.c b/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Slave_MSP432_Master/main.c
index 9a6dadf..a8f2bee 100644
--- a/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Slave_MSP432_Master/main.c
+++ b/Basic-Test-Package/CC2650/Test_CC2650_3wSPI_Slave_MSP432_Master/main.c
@@ -65,20 +65,26 @@ Void echoFxn(UArg arg0, UArg arg1)
65 if(!spi){ 65 if(!spi){
66 System_printf("SPI did not open"); 66 System_printf("SPI did not open");
67 } 67 }
68 System_printf("SPI-Slave Open\r\n"); 68 System_printf("SPI Slave Mode Open\r\n");
69 69
70 rxBufferPointer[0]='*'; 70 rxBufferPointer[0]='*';
71
71 while(1) { 72 while(1) {
72 73
73 spiTransaction.rxBuf= rxBufferPointer; 74 spiTransaction.rxBuf= rxBufferPointer;
74 spiTransaction.txBuf = txBufferPointer; 75 spiTransaction.txBuf = txBufferPointer;
75 spiTransaction.count=1; 76 spiTransaction.count=1;
76 77
77 PIN_setOutputValue(ledPinHandle, Board_LEDG,!PIN_getOutputValue(Board_LEDG)); 78 PIN_setOutputValue(ledPinHandle, Board_LEDR,0);
79
78 if (SPI_transfer(spi,&spiTransaction)) { 80 if (SPI_transfer(spi,&spiTransaction)) {
79 81
82 PIN_setOutputValue(ledPinHandle, Board_LEDR,1);
83
84 System_printf("RxData: %x\r\n",rxBufferPointer[0]);
85
80 txBufferPointer[0]=rxBufferPointer[0]; 86 txBufferPointer[0]=rxBufferPointer[0];
81 System_printf("RxData: %x TxData: %x\r\n",rxBufferPointer[0],txBufferPointer[0]); 87 rxBufferPointer[0]=0x55;
82 88
83 } 89 }
84 90
@@ -98,7 +104,12 @@ Void echoFxn(UArg arg0, UArg arg1)
98Void heartBeatFxn(UArg arg0, UArg arg1) 104Void heartBeatFxn(UArg arg0, UArg arg1)
99{ 105{
100 while (1) { 106 while (1) {
101 Task_sleep((UInt)arg0); 107
108 Task_sleep((UInt)arg0-5000/Clock_tickPeriod);
109 PIN_setOutputValue(ledPinHandle, Board_LEDG,1);
110 Task_sleep((UInt)5000/Clock_tickPeriod);
111 PIN_setOutputValue(ledPinHandle, Board_LEDG,0);
112
102 //PIN_setOutputValue(ledPinHandle, Board_LEDG,!PIN_getOutputValue(Board_LEDG)); 113 //PIN_setOutputValue(ledPinHandle, Board_LEDG,!PIN_getOutputValue(Board_LEDG));
103 //PIN_setOutputValue(ledPinHandle, Board_LEDR,!PIN_getOutputValue(Board_LEDR)); 114 //PIN_setOutputValue(ledPinHandle, Board_LEDR,!PIN_getOutputValue(Board_LEDR));
104 } 115 }
@@ -127,7 +138,7 @@ int main(void)
127 138
128 /* Construct heartBeat Task thread */ 139 /* Construct heartBeat Task thread */
129 Task_Params_init(&taskParams); 140 Task_Params_init(&taskParams);
130 taskParams.arg0 = 200000 / Clock_tickPeriod; 141 taskParams.arg0 = 2000000 / Clock_tickPeriod;
131 taskParams.stackSize = TASKSTACKSIZE; 142 taskParams.stackSize = TASKSTACKSIZE;
132 taskParams.stack = &task0Stack; 143 taskParams.stack = &task0Stack;
133 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL); 144 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
diff --git a/Basic-Test-Package/CC2650/Test_CC2650_DebugUART_EchoPC/main.c b/Basic-Test-Package/CC2650/Test_CC2650_DebugUART_EchoPC/main.c
index 4d2d3f5..7f9f337 100644
--- a/Basic-Test-Package/CC2650/Test_CC2650_DebugUART_EchoPC/main.c
+++ b/Basic-Test-Package/CC2650/Test_CC2650_DebugUART_EchoPC/main.c
@@ -67,7 +67,8 @@ Void taskFxn(UArg arg0, UArg arg1)
67 while (1) { 67 while (1) {
68 /* Blocking Read */ 68 /* Blocking Read */
69 UART_read(uart, &input, 1); 69 UART_read(uart, &input, 1);
70 UART_write(uart, &input, 1); 70 /* Echo */
71 UART_write(uart, &input, 1);
71 } 72 }
72 73
73} 74}
@@ -81,8 +82,8 @@ Void heartBeatFxn(UArg arg0, UArg arg1)
81{ 82{
82 while (1) { 83 while (1) {
83 Task_sleep((UInt)arg0); 84 Task_sleep((UInt)arg0);
84 PIN_setOutputValue(ledPinHandle, Board_LED0,!PIN_getOutputValue(Board_LED0)); 85 //PIN_setOutputValue(ledPinHandle, Board_LEDR,!PIN_getOutputValue(Board_LED0));
85 //PIN_setOutputValue(ledPinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1)); 86 PIN_setOutputValue(ledPinHandle, Board_LEDG,!PIN_getOutputValue(Board_LED1));
86 } 87 }
87} 88}
88 89
@@ -102,7 +103,7 @@ int main(void)
102 103
103 /* Construct heartBeat Task thread */ 104 /* Construct heartBeat Task thread */
104 Task_Params_init(&taskParams); 105 Task_Params_init(&taskParams);
105 taskParams.arg0 = 2000000 / Clock_tickPeriod; 106 taskParams.arg0 = 1000000 / Clock_tickPeriod;
106 taskParams.stackSize = TASKSTACKSIZE; 107 taskParams.stackSize = TASKSTACKSIZE;
107 taskParams.stack = &task0Stack; 108 taskParams.stack = &task0Stack;
108 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL); 109 Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
diff --git a/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c b/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c
index afb520e..6908811 100644
--- a/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c
+++ b/Basic-Test-Package/CC2650/Test_CC2650_I2C_Sensors/main.c
@@ -79,11 +79,7 @@ PIN_Config buttonPinTable[] = {
79 79
80void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) { 80void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) {
81 81
82 PIN_setOutputValue(ledPinHandle, Board_LED0,0); 82 CPUdelay(8000*200);
83 PIN_setOutputValue(ledPinHandle, Board_LED1,0);
84 CPUdelay(8000*200);
85 PIN_setOutputValue(ledPinHandle, Board_LED0,1);
86 PIN_setOutputValue(ledPinHandle, Board_LED1,1);
87 83
88 //Event_post(myEvent,Event_Id_02); 84 //Event_post(myEvent,Event_Id_02);
89 Semaphore_post(semHandle); 85 Semaphore_post(semHandle);
@@ -126,12 +122,15 @@ Void taskFxn(UArg arg0, UArg arg1)
126 if (i2c == NULL) { 122 if (i2c == NULL) {
127 System_abort("Error Initializing I2C\r\n"); 123 System_abort("Error Initializing I2C\r\n");
128 } 124 }
129
130 System_printf("I2C Initialized\r\n"); 125 System_printf("I2C Initialized\r\n");
131 126
132 System_printf("Press button:\r\n"); 127 /* Wait Semaphore */
133 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER); 128 System_printf("Press Button:\r\n");
129
130 PIN_setOutputValue(ledPinHandle, Board_LED0,1);
131 PIN_setOutputValue(ledPinHandle, Board_LED1,1);
134 132
133 Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
135 134
136 /* Start test */ 135 /* Start test */
137 PIN_setOutputValue(ledPinHandle, Board_LED0,0); 136 PIN_setOutputValue(ledPinHandle, Board_LED0,0);
@@ -155,7 +154,7 @@ Void taskFxn(UArg arg0, UArg arg1)
155 Event_post(myEvent, Event_Id_00); 154 Event_post(myEvent, Event_Id_00);
156 flagerr=1; 155 flagerr=1;
157 } 156 }
158 System_printf("OPT3001 ID 0x5449: %x\r\n",data); 157 System_printf("OPT3001 Device ID [0x5449]: %x\r\n",data);
159 }else{ 158 }else{
160 System_printf("OPT3001 I2c Transaction Failed\r\n"); 159 System_printf("OPT3001 I2c Transaction Failed\r\n");
161 Event_post(myEvent, Event_Id_00); 160 Event_post(myEvent, Event_Id_00);
@@ -180,7 +179,7 @@ Void taskFxn(UArg arg0, UArg arg1)
180 flagerr=1; 179 flagerr=1;
181 } 180 }
182 //System_printf("HDC1080 Manufactured ID 0x5449: %x\n",data); 181 //System_printf("HDC1080 Manufactured ID 0x5449: %x\n",data);
183 System_printf("HDC1080 Device ID 0x1050: %x\r\n",data); 182 System_printf("HDC1080 Device ID [0x1050]: %x\r\n",data);
184 } 183 }
185 else{ 184 else{
186 System_printf("HDC1080 I2c Transaction Failed\r\n"); 185 System_printf("HDC1080 I2c Transaction Failed\r\n");
@@ -225,7 +224,7 @@ Void taskFxn(UArg arg0, UArg arg1)
225 Event_post(myEvent, Event_Id_00); 224 Event_post(myEvent, Event_Id_00);
226 flagerr=1; 225 flagerr=1;
227 } 226 }
228 System_printf("TMP007 Device ID 0x0078: %x\r\n",data); 227 System_printf("TMP007 Device ID [0x0078]: %x\r\n",data);
229 }else{ 228 }else{
230 System_printf("TMP007 I2c Transaction Failed\r\n"); 229 System_printf("TMP007 I2c Transaction Failed\r\n");
231 Event_post(myEvent, Event_Id_00); 230 Event_post(myEvent, Event_Id_00);
@@ -249,7 +248,7 @@ Void taskFxn(UArg arg0, UArg arg1)
249 Event_post(myEvent, Event_Id_00); 248 Event_post(myEvent, Event_Id_00);
250 flagerr=1; 249 flagerr=1;
251 } 250 }
252 System_printf("BMP280 ID 0x58: %x\r\n",data); 251 System_printf("BMP280 Device ID [0x58]: %x\r\n",data);
253 }else{ 252 }else{
254 System_printf("BMP280 I2c Transaction Failed\r\n"); 253 System_printf("BMP280 I2c Transaction Failed\r\n");
255 Event_post(myEvent, Event_Id_00); 254 Event_post(myEvent, Event_Id_00);
@@ -271,7 +270,7 @@ Void taskFxn(UArg arg0, UArg arg1)
271 Event_post(myEvent, Event_Id_00); 270 Event_post(myEvent, Event_Id_00);
272 flagerr=1; 271 flagerr=1;
273 } 272 }
274 System_printf("MPU9250 WHOIAM 0x71: %x\r\n",data); 273 System_printf("MPU9250 WHOIAM [0x71]: %x\r\n",data);
275 }else{ 274 }else{
276 System_printf("MPU9250 I2c Transaction Failed\r\n"); 275 System_printf("MPU9250 I2c Transaction Failed\r\n");
277 Event_post(myEvent, Event_Id_00); 276 Event_post(myEvent, Event_Id_00);
@@ -294,7 +293,7 @@ Void taskFxn(UArg arg0, UArg arg1)
294 Event_post(myEvent, Event_Id_00); 293 Event_post(myEvent, Event_Id_00);
295 flagerr=1; 294 flagerr=1;
296 } 295 }
297 System_printf("LISHH12 WHOIAM 0x41: %x\r\n",data); 296 System_printf("LISHH12 WHOIAM [0x41]: %x\r\n",data);
298 }else{ 297 }else{
299 System_printf("LISHH12 I2c Transaction Failed\r\n"); 298 System_printf("LISHH12 I2c Transaction Failed\r\n");
300 Event_post(myEvent, Event_Id_00); 299 Event_post(myEvent, Event_Id_00);