|
|
|
@ -121,6 +121,9 @@
|
|
|
|
|
#include "task.h"
|
|
|
|
|
#include "semphr.h"
|
|
|
|
|
|
|
|
|
|
/* TI includes. */
|
|
|
|
|
#include "gpio.h"
|
|
|
|
|
|
|
|
|
|
/* Priorities at which the tasks are created. */
|
|
|
|
|
#define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
|
|
|
|
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
|
|
|
@ -159,6 +162,13 @@ void main_blinky( void );
|
|
|
|
|
*/
|
|
|
|
|
static void prvConfigureClocks( void );
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Configure a button to generate interrupts (for test purposes). This is done
|
|
|
|
|
* to test waking on an interrupt other than the systick interrupt in tickless
|
|
|
|
|
* idle mode.
|
|
|
|
|
*/
|
|
|
|
|
static void prvConfigureButton( void );
|
|
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
/* The queue used by both tasks. */
|
|
|
|
@ -177,6 +187,9 @@ void main_blinky( void )
|
|
|
|
|
/* The full demo configures the clocks for maximum frequency, wheras this
|
|
|
|
|
blinky demo uses a slower clock as it also uses low power features. */
|
|
|
|
|
prvConfigureClocks();
|
|
|
|
|
|
|
|
|
|
/* Configure a button to generate interrupts (for test purposes). */
|
|
|
|
|
prvConfigureButton();
|
|
|
|
|
|
|
|
|
|
/* Create the queue. */
|
|
|
|
|
xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) );
|
|
|
|
@ -286,9 +299,37 @@ static void prvConfigureClocks( void )
|
|
|
|
|
}
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void vPreSleepProcessing( uint32_t ulExpectedIdleTime )
|
|
|
|
|
static void prvConfigureButton( void )
|
|
|
|
|
{
|
|
|
|
|
volatile uint8_t ucPin;
|
|
|
|
|
|
|
|
|
|
/* Configure button S1 to generate interrupts. This is done to test the
|
|
|
|
|
code path were low power mode is exited for a reason other than a tick
|
|
|
|
|
interrupt. */
|
|
|
|
|
GPIO_setAsInputPinWithPullUpResistor( GPIO_PORT_P1, GPIO_PIN1 );
|
|
|
|
|
GPIO_enableInterrupt( GPIO_PORT_P1, GPIO_PIN1 );
|
|
|
|
|
Interrupt_enableInterrupt( INT_PORT1 );
|
|
|
|
|
}
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void PORT1_IRQHandler( void )
|
|
|
|
|
{
|
|
|
|
|
static volatile uint32_t ux = 0;
|
|
|
|
|
|
|
|
|
|
/* This is the handler for interrupt generated by the button. The
|
|
|
|
|
interrupt is only used to bring the MCU out of low power mode. It
|
|
|
|
|
doesn't perform any other function. The ux increment is just to
|
|
|
|
|
have something to set breakpoints on and check the interrupt is
|
|
|
|
|
executing. */
|
|
|
|
|
ux++;
|
|
|
|
|
|
|
|
|
|
/* Clear the interrupt. */
|
|
|
|
|
( void ) P1->IV;
|
|
|
|
|
}
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void vPreSleepProcessing( uint32_t ulExpectedIdleTime )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|