Hello there,
I am integrating LED Blinker project into simpleBLEPeripheral project, and have created task file by myself. Based on TI-RTOS enabled SCS code.
But somehow, scTaskAlertCallback() seems never be triggered by any button pressing actions on smartRF06. Not sure if I did it right, specially for the GPIO buttons code, since they are copied from main.c from SCS pre-existed code. Not sure if they are enough, or i still need to add PIN_open stuff? I will try to add those code to test, but it is better that somewhere I can find a guide or sample code.
Thanks!
Below is snap of my code:
void scTaskAlertCallback(void) {
// Wake up the OS task
Semaphore_post(Semaphore_handle(&semScTaskAlert));
} // scTaskAlertCallback
void taskFxn(UArg a0, UArg a1) {
// Enable power domains
PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
PRCMLoadSet();
while (PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH) != PRCM_DOMAIN_POWER_ON);
// Enable the GPIO module
PRCMPeripheralRunEnable(PRCM_PERIPH_GPIO);
PRCMPeripheralSleepEnable(PRCM_PERIPH_GPIO);
PRCMPeripheralDeepSleepEnable(PRCM_PERIPH_GPIO);
PRCMLoadSet();
while (!PRCMLoadGet());
// Setup GPIOs for LEDs and buttons
HWREG(GPIO_BASE + GPIO_O_DOE31_0) &= ~(BV(IOID_KEY_LEFT) | BV(IOID_KEY_RIGHT) | BV(IOID_KEY_UP) | BV(IOID_KEY_DOWN));
HWREG(GPIO_BASE + GPIO_O_DOE31_0) |= BV(IOID_LED_1) | BV(IOID_LED_2);
HWREG(IOC_BASE + IOC_O_IOCFG(IOID_LED_1)) = IOC_STD_OUTPUT | IOC_PORT_GPIO;
HWREG(IOC_BASE + IOC_O_IOCFG(IOID_LED_2)) = IOC_STD_OUTPUT | IOC_PORT_GPIO;
HWREG(IOC_BASE + IOC_O_IOCFG(IOID_KEY_LEFT)) = ((IOC_STD_INPUT & ~IOC_NO_IOPULL) | IOC_IOPULL_UP) | IOC_PORT_GPIO;
HWREG(IOC_BASE + IOC_O_IOCFG(IOID_KEY_RIGHT)) = ((IOC_STD_INPUT & ~IOC_NO_IOPULL) | IOC_IOPULL_UP) | IOC_PORT_GPIO;
HWREG(IOC_BASE + IOC_O_IOCFG(IOID_KEY_UP)) = ((IOC_STD_INPUT & ~IOC_NO_IOPULL) | IOC_IOPULL_UP) | IOC_PORT_GPIO;
HWREG(IOC_BASE + IOC_O_IOCFG(IOID_KEY_DOWN)) = ((IOC_STD_INPUT & ~IOC_NO_IOPULL) | IOC_IOPULL_UP) | IOC_PORT_GPIO;
// In this example, we keep the AUX domain access permanently enabled
//scifOsalEnableAuxDomainAccess();
// Initialize and start the Sensor Controller
scifOsalInit();
scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
scifInit(&scifDriverSetup);
scifStartRtcTicks(0x00000080, 0x00000200);
IntMasterEnable();
AONRTCEnable();