Tool/software: Code Composer Studio
I built the project in sensor controller studio and it passed the testing.
Then, I followed the example Sensor Controller- integrate with TI-RTOS application in simpleLink Academy1.11 with cc2650 lanuchpad project zero to build the bluetooth data transfer.
However, it seems not work,but without errors or warning.
How can I change so as to perform task at BLE?
Sensor controller code
Project name:dusk2dawn
CCS
The yehighline is what I changed.
-
Open the
project_zero.c
file. -
Add
#include "scif.h"
at the top. -
Add
APP_MSG_SC_CTRL_READY
andAPP_MSG_SC_TASK_ALERT
enum in theapp_msg_types_t
enum typedef. -
Add the following function declarations
// Dusk2Dawn functions
static void scCtrlReadyCallback(void);
static void scTaskAlertCallback(void);
static void processTaskAlert(void);
Dusk2Dawn Function Declarations
-
Copy and paste the SC Driver initialization into
ProjectZero_init()
. -
// Initialize the Sensor Controller scifOsalInit(); scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback); scifOsalRegisterTaskAlertCallback(scTaskAlertCallback); scifInit(&scifDriverSetup); // Set the Sensor Controller task tick interval to 1 second uint32_t rtc_Hz = 1; // 1Hz RTC scifStartRtcTicksNow(0x00010000 / rtc_Hz); //Change here // Configure Sensor Controller tasks scifTaskData.battery.cfg.alarmThr = 1500; scifTaskData.power.cfg.th1 = 50000; // Start Sensor Controller task scifStartTasksNbl(BV(SCIF_VOUT_TASK_ID)); scifStartTasksNbl(BV(SCIF_BATTERY_TASK_ID)); scifStartTasksNbl(BV(SCIF_POWER_TASK_ID));
-
In
user_processApplicationMessage()
, add the following case in the switch statement- Note that a case for
APP_MSG_SC_CTRL_READY
is not added because we are not processing it.
- Note that a case for
case APP_MSG_SC_TASK_ALERT:
processTaskAlert();
break;
Dusk2Dawn Switch Case
- Add the following functions
static void scCtrlReadyCallback(void)
{
// Notify application `Control READY` is active
user_enqueueRawAppMsg(APP_MSG_SC_CTRL_READY, NULL, 0);
} // scCtrlReadyCallback
static void scTaskAlertCallback(void)
{
// Notify application `Task ALERT` is active
user_enqueueRawAppMsg(APP_MSG_SC_TASK_ALERT, NULL, 0);
} // scTaskAlertCallback
static void processTaskAlert(void)
{
// Clear the ALERT interrupt source
scifClearAlertIntSource();
// Get 'state.dawn', and set dawnStr to appropriate string
//uint16_t dawn = scifTaskData.dusk2dawn.state.dawn;
//char *dawnStr = (dawn != 0) ? "dawn" : "dusk";
// Set the dawnStr to the String characteristic in Data Service
//DataService_SetParameter(DS_STRING_ID, strlen(dawnStr), dawnStr);
// Set red LED value
//PIN_setOutputValue(ledPinHandle, Board_LED0, dawn);
// Acknowledge the ALERT event
scifAckAlertEvents();
} // processTaskAlert