summaryrefslogtreecommitdiff
path: root/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
committerYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
commita6163888f3c56123b1db313743c6147ba498732c (patch)
treeff7d15d991d1d09ba6cbc0cec80924f57445bfdd /third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3
parentc3e4c9a25c2910d2d66d52215b3406b13d5b23d5 (diff)
Add third_party libs
Diffstat (limited to 'third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3')
-rw-r--r--third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/FreeRTOSConfig.h115
-rw-r--r--third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/ParTest.c145
-rw-r--r--third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/main.c323
-rw-r--r--third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/vectors.s121
4 files changed, 704 insertions, 0 deletions
diff --git a/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/FreeRTOSConfig.h b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/FreeRTOSConfig.h
new file mode 100644
index 0000000..fbe50d5
--- /dev/null
+++ b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/FreeRTOSConfig.h
@@ -0,0 +1,115 @@
+/*
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
+ All rights reserved
+
+ VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
+
+ ***************************************************************************
+ * *
+ * FreeRTOS provides completely free yet professionally developed, *
+ * robust, strictly quality controlled, supported, and cross *
+ * platform software that has become a de facto standard. *
+ * *
+ * Help yourself get started quickly and support the FreeRTOS *
+ * project by purchasing a FreeRTOS tutorial book, reference *
+ * manual, or both from: http://www.FreeRTOS.org/Documentation *
+ * *
+ * Thank you! *
+ * *
+ ***************************************************************************
+
+ This file is part of the FreeRTOS distribution.
+
+ FreeRTOS is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License (version 2) as published by the
+ Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
+
+ >>! NOTE: The modification to the GPL is included to allow you to distribute
+ >>! a combined work that includes FreeRTOS without being obliged to provide
+ >>! the source code for proprietary components outside of the FreeRTOS
+ >>! kernel.
+
+ FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. Full license text is available from the following
+ link: http://www.freertos.org/a00114.html
+
+ 1 tab == 4 spaces!
+
+ ***************************************************************************
+ * *
+ * Having a problem? Start by reading the FAQ "My application does *
+ * not run, what could be wrong?" *
+ * *
+ * http://www.FreeRTOS.org/FAQHelp.html *
+ * *
+ ***************************************************************************
+
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,
+ license and Real Time Engineers Ltd. contact details.
+
+ http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
+ including FreeRTOS+Trace - an indispensable productivity tool, a DOS
+ compatible FAT file system, and our tiny thread aware UDP/IP stack.
+
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
+ Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
+ licenses offer ticketed support, indemnification and middleware.
+
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety
+ engineered and independently SIL3 certified version for use in safety and
+ mission critical applications that require provable dependability.
+
+ 1 tab == 4 spaces!
+*/
+
+#ifndef FREERTOS_CONFIG_H
+#define FREERTOS_CONFIG_H
+
+/*-----------------------------------------------------------
+ * Application specific definitions.
+ *
+ * These definitions should be adjusted for your particular hardware and
+ * application requirements.
+ *
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
+ *
+ * See http://www.freertos.org/a00110.html.
+ *----------------------------------------------------------*/
+
+#define configUSE_PREEMPTION 0
+#define configUSE_IDLE_HOOK 1
+#define configUSE_TICK_HOOK 0
+#define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 )
+#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
+#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 59 )
+#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 1240 ) )
+#define configMAX_TASK_NAME_LEN ( 3 )
+#define configUSE_TRACE_FACILITY 0
+#define configUSE_16_BIT_TICKS 0
+#define configIDLE_SHOULD_YIELD 0
+#define configUSE_CO_ROUTINES 1
+
+#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 2 )
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
+
+/* Set the following definitions to 1 to include the API function, or zero
+to exclude the API function. */
+
+#define INCLUDE_vTaskPrioritySet 0
+#define INCLUDE_uxTaskPriorityGet 0
+#define INCLUDE_vTaskDelete 0
+#define INCLUDE_vTaskCleanUpResources 0
+#define INCLUDE_vTaskSuspend 0
+#define INCLUDE_vTaskDelayUntil 0
+#define INCLUDE_vTaskDelay 0
+
+#define configKERNEL_INTERRUPT_PRIORITY 255
+/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
+See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
+#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xa0, or priority 5. */
+
+
+
+#endif /* FREERTOS_CONFIG_H */
diff --git a/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/ParTest.c b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/ParTest.c
new file mode 100644
index 0000000..cbd4a22
--- /dev/null
+++ b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/ParTest.c
@@ -0,0 +1,145 @@
+/*
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
+ All rights reserved
+
+ VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
+
+ ***************************************************************************
+ * *
+ * FreeRTOS provides completely free yet professionally developed, *
+ * robust, strictly quality controlled, supported, and cross *
+ * platform software that has become a de facto standard. *
+ * *
+ * Help yourself get started quickly and support the FreeRTOS *
+ * project by purchasing a FreeRTOS tutorial book, reference *
+ * manual, or both from: http://www.FreeRTOS.org/Documentation *
+ * *
+ * Thank you! *
+ * *
+ ***************************************************************************
+
+ This file is part of the FreeRTOS distribution.
+
+ FreeRTOS is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License (version 2) as published by the
+ Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
+
+ >>! NOTE: The modification to the GPL is included to allow you to distribute
+ >>! a combined work that includes FreeRTOS without being obliged to provide
+ >>! the source code for proprietary components outside of the FreeRTOS
+ >>! kernel.
+
+ FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. Full license text is available from the following
+ link: http://www.freertos.org/a00114.html
+
+ 1 tab == 4 spaces!
+
+ ***************************************************************************
+ * *
+ * Having a problem? Start by reading the FAQ "My application does *
+ * not run, what could be wrong?" *
+ * *
+ * http://www.FreeRTOS.org/FAQHelp.html *
+ * *
+ ***************************************************************************
+
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,
+ license and Real Time Engineers Ltd. contact details.
+
+ http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
+ including FreeRTOS+Trace - an indispensable productivity tool, a DOS
+ compatible FAT file system, and our tiny thread aware UDP/IP stack.
+
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
+ Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
+ licenses offer ticketed support, indemnification and middleware.
+
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety
+ engineered and independently SIL3 certified version for use in safety and
+ mission critical applications that require provable dependability.
+
+ 1 tab == 4 spaces!
+*/
+
+/*-----------------------------------------------------------
+ * Simple parallel port IO routines.
+ *-----------------------------------------------------------*/
+
+/*
+*/
+
+/* Kernel include files. */
+#include "FreeRTOS.h"
+#include "task.h"
+#include "partest.h"
+
+/* Hardware specific include files. */
+#include "DriverLib.h"
+
+static const unsigned long ulLEDs[] =
+{
+ GPIO_PIN_6, GPIO_PIN_1, GPIO_PIN_0
+};
+
+#define partstLED_PINS ( GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_6 )
+
+#define partstMAX_OUTPUT_LED ( ( unsigned char ) 3 )
+
+/*-----------------------------------------------------------*/
+void vParTestInitialise( void )
+{
+portBASE_TYPE xLED;
+
+ /* The LED's are on port B. */
+ GPIODirModeSet( GPIO_PORTB_BASE, partstLED_PINS, GPIO_DIR_MODE_OUT );
+
+ for( xLED = 0; xLED < partstMAX_OUTPUT_LED; xLED++ )
+ {
+ vParTestSetLED( xLED, pdFALSE );
+ }
+}
+/*-----------------------------------------------------------*/
+
+void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
+{
+ vTaskSuspendAll();
+ {
+ if( uxLED < partstMAX_OUTPUT_LED )
+ {
+ if( xValue == pdFALSE )
+ {
+ GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ulLEDs[ uxLED ] );
+ }
+ else
+ {
+ GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ~ulLEDs[ uxLED ] );
+ }
+ }
+ }
+ xTaskResumeAll();
+}
+/*-----------------------------------------------------------*/
+
+void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
+{
+portBASE_TYPE xCurrentValue;
+
+ vTaskSuspendAll();
+ {
+ if( uxLED < partstMAX_OUTPUT_LED )
+ {
+ xCurrentValue = GPIOPinRead( GPIO_PORTB_BASE, ulLEDs[ uxLED ] );
+ if( xCurrentValue )
+ {
+ GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ~ulLEDs[ uxLED ] );
+ }
+ else
+ {
+ GPIOPinWrite( GPIO_PORTB_BASE, ulLEDs[ uxLED ], ulLEDs[ uxLED ] );
+ }
+ }
+ }
+ xTaskResumeAll();
+}
diff --git a/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/main.c b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/main.c
new file mode 100644
index 0000000..db9bc08
--- /dev/null
+++ b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/main.c
@@ -0,0 +1,323 @@
+/*
+ FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
+ All rights reserved
+
+ VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
+
+ ***************************************************************************
+ * *
+ * FreeRTOS provides completely free yet professionally developed, *
+ * robust, strictly quality controlled, supported, and cross *
+ * platform software that has become a de facto standard. *
+ * *
+ * Help yourself get started quickly and support the FreeRTOS *
+ * project by purchasing a FreeRTOS tutorial book, reference *
+ * manual, or both from: http://www.FreeRTOS.org/Documentation *
+ * *
+ * Thank you! *
+ * *
+ ***************************************************************************
+
+ This file is part of the FreeRTOS distribution.
+
+ FreeRTOS is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License (version 2) as published by the
+ Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
+
+ >>! NOTE: The modification to the GPL is included to allow you to distribute
+ >>! a combined work that includes FreeRTOS without being obliged to provide
+ >>! the source code for proprietary components outside of the FreeRTOS
+ >>! kernel.
+
+ FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. Full license text is available from the following
+ link: http://www.freertos.org/a00114.html
+
+ 1 tab == 4 spaces!
+
+ ***************************************************************************
+ * *
+ * Having a problem? Start by reading the FAQ "My application does *
+ * not run, what could be wrong?" *
+ * *
+ * http://www.FreeRTOS.org/FAQHelp.html *
+ * *
+ ***************************************************************************
+
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,
+ license and Real Time Engineers Ltd. contact details.
+
+ http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
+ including FreeRTOS+Trace - an indispensable productivity tool, a DOS
+ compatible FAT file system, and our tiny thread aware UDP/IP stack.
+
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
+ Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
+ licenses offer ticketed support, indemnification and middleware.
+
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety
+ engineered and independently SIL3 certified version for use in safety and
+ mission critical applications that require provable dependability.
+
+ 1 tab == 4 spaces!
+*/
+
+
+/*
+ * This is a mini co-routine demo for the Rowley CrossFire LM3S102 development
+ * board. It makes use of the boards tri-colour LED and analogue input.
+ *
+ * Four co-routines are created - an 'I2C' co-routine and three 'flash'
+ * co-routines.
+ *
+ * The I2C co-routine triggers an ADC conversion then blocks on a queue to
+ * wait for the conversion result - which it receives on the queue directly
+ * from the I2C interrupt service routine. The conversion result is then
+ * scalled to a delay period. The I2C interrupt then wakes each of the
+ * flash co-routines before itself delaying for the calculated period and
+ * then repeating the whole process.
+ *
+ * When woken by the I2C co-routine the flash co-routines each block for
+ * a given period, illuminate an LED for a fixed period, then go back to
+ * sleep to wait for the next cycle. The uxIndex parameter of the flash
+ * co-routines is used to ensure that each flashes a different LED, and that
+ * the delay periods are such that the LED's get flashed in sequence.
+ */
+
+
+/* Scheduler include files. */
+#include "FreeRTOS.h"
+#include "task.h"
+#include "queue.h"
+#include "croutine.h"
+
+/* Demo application include files. */
+#include "partest.h"
+
+/* Library include files. */
+#include "DriverLib.h"
+
+/* States of the I2C master interface. */
+#define mainI2C_IDLE 0
+#define mainI2C_READ_1 1
+#define mainI2C_READ_2 2
+#define mainI2C_READ_DONE 3
+
+#define mainZERO_LENGTH 0
+
+/* Address of the A2D IC on the CrossFire board. */
+#define mainI2CAddress 0x4D
+
+/* The queue used to send data from the I2C ISR to the co-routine should never
+contain more than one item as the same co-routine is used to trigger the I2C
+activity. */
+#define mainQUEUE_LENGTH 1
+
+/* The CrossFire board contains a tri-colour LED. */
+#define mainNUM_LEDs 3
+
+/* The I2C co-routine has a higher priority than the flash co-routines. This
+is not really necessary as when the I2C co-routine is active the other
+co-routines are delaying. */
+#define mainI2c_CO_ROUTINE_PRIORITY 1
+
+
+/* The current state of the I2C master. */
+static volatile unsigned portBASE_TYPE uxState = mainI2C_IDLE;
+
+/* The delay period derived from the A2D value. */
+static volatile portBASE_TYPE uxDelay = 250;
+
+/* The queue used to communicate between the I2C interrupt and the I2C
+co-routine. */
+static xQueueHandle xADCQueue;
+
+/* The queue used to synchronise the flash co-routines. */
+static xQueueHandle xDelayQueue;
+
+/*
+ * Sets up the PLL, I2C and GPIO used by the demo.
+ */
+static void prvSetupHardware( void );
+
+/* The co-routines as described at the top of the file. */
+static void vI2CCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );
+static void vFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );
+
+/*-----------------------------------------------------------*/
+
+int main( void )
+{
+unsigned portBASE_TYPE uxCoRoutine;
+
+ /* Setup all the hardware used by this demo. */
+ prvSetupHardware();
+
+ /* Create the queue used to communicate between the ISR and I2C co-routine.
+ This can only ever contain one value. */
+ xADCQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( portTickType ) );
+
+ /* Create the queue used to synchronise the flash co-routines. The queue
+ is used to trigger three tasks, but is for synchronisation only and does
+ not pass any data. It therefore has three position each of zero length. */
+ xDelayQueue = xQueueCreate( mainNUM_LEDs, mainZERO_LENGTH );
+
+ /* Create the co-routine that initiates the i2c. */
+ xCoRoutineCreate( vI2CCoRoutine, mainI2c_CO_ROUTINE_PRIORITY, 0 );
+
+ /* Create the flash co-routines. */
+ for( uxCoRoutine = 0; uxCoRoutine < mainNUM_LEDs; uxCoRoutine++ )
+ {
+ xCoRoutineCreate( vFlashCoRoutine, tskIDLE_PRIORITY, uxCoRoutine );
+ }
+
+ /* Start the scheduler. From this point on the co-routines should
+ execute. */
+ vTaskStartScheduler();
+
+ /* Should not get here unless we did not have enough memory to start the
+ scheduler. */
+ for( ;; );
+ return 0;
+}
+/*-----------------------------------------------------------*/
+
+static void prvSetupHardware( void )
+{
+ /* Setup the PLL. */
+ SysCtlClockSet( SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ );
+
+ /* Enable the I2C used to read the pot. */
+ SysCtlPeripheralEnable( SYSCTL_PERIPH_I2C );
+ SysCtlPeripheralEnable( SYSCTL_PERIPH_GPIOB );
+ GPIOPinTypeI2C( GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3 );
+
+ /* Initialize the I2C master. */
+ I2CMasterInit( I2C_MASTER_BASE, pdFALSE );
+
+ /* Enable the I2C master interrupt. */
+ I2CMasterIntEnable( I2C_MASTER_BASE );
+ IntEnable( INT_I2C );
+
+ /* Initialise the hardware used to talk to the LED's. */
+ vParTestInitialise();
+}
+/*-----------------------------------------------------------*/
+
+static void vI2CCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
+{
+portTickType xADCResult;
+static portBASE_TYPE xResult = 0, xMilliSecs, xLED;
+
+ crSTART( xHandle );
+
+ for( ;; )
+ {
+ /* Start the I2C off to read the ADC. */
+ uxState = mainI2C_READ_1;
+ I2CMasterSlaveAddrSet( I2C_MASTER_BASE, mainI2CAddress, pdTRUE );
+ I2CMasterControl( I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START );
+
+ /* Wait to receive the conversion result. */
+ crQUEUE_RECEIVE( xHandle, xADCQueue, &xADCResult, portMAX_DELAY, &xResult );
+
+ /* Scale the result to give a useful range of values for a visual
+ demo. */
+ xADCResult >>= 2;
+ xMilliSecs = xADCResult / portTICK_RATE_MS;
+
+ /* The delay is split between the four co-routines so they remain in
+ synch. */
+ uxDelay = xMilliSecs / ( mainNUM_LEDs + 1 );
+
+ /* Trigger each of the flash co-routines. */
+ for( xLED = 0; xLED < mainNUM_LEDs; xLED++ )
+ {
+ crQUEUE_SEND( xHandle, xDelayQueue, &xLED, 0, &xResult );
+ }
+
+ /* Wait for the full delay time then start again. This delay is long
+ enough to ensure the flash co-routines have done their thing and gone
+ back to sleep. */
+ crDELAY( xHandle, xMilliSecs );
+ }
+
+ crEND();
+}
+/*-----------------------------------------------------------*/
+
+static void vFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
+{
+portBASE_TYPE xResult, xNothing;
+
+ crSTART( xHandle );
+
+ for( ;; )
+ {
+ /* Wait for start of next round. */
+ crQUEUE_RECEIVE( xHandle, xDelayQueue, &xNothing, portMAX_DELAY, &xResult );
+
+ /* Wait until it is this co-routines turn to flash. */
+ crDELAY( xHandle, uxDelay * uxIndex );
+
+ /* Turn on the LED for a fixed period. */
+ vParTestSetLED( uxIndex, pdTRUE );
+ crDELAY( xHandle, uxDelay );
+ vParTestSetLED( uxIndex, pdFALSE );
+
+ /* Go back and wait for the next round. */
+ }
+
+ crEND();
+}
+/*-----------------------------------------------------------*/
+
+void vI2C_ISR(void)
+{
+static portTickType xReading;
+
+ /* Clear the interrupt. */
+ I2CMasterIntClear( I2C_MASTER_BASE );
+
+ /* Determine what to do based on the current uxState. */
+ switch (uxState)
+ {
+ case mainI2C_IDLE: break;
+
+ case mainI2C_READ_1: /* Read ADC result high byte. */
+ xReading = I2CMasterDataGet( I2C_MASTER_BASE );
+ xReading <<= 8;
+
+ /* Continue the burst read. */
+ I2CMasterControl( I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_CONT );
+ uxState = mainI2C_READ_2;
+ break;
+
+ case mainI2C_READ_2: /* Read ADC result low byte. */
+ xReading |= I2CMasterDataGet( I2C_MASTER_BASE );
+
+ /* Finish the burst read. */
+ I2CMasterControl( I2C_MASTER_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH );
+ uxState = mainI2C_READ_DONE;
+ break;
+
+ case mainI2C_READ_DONE: /* Complete. */
+ I2CMasterDataGet( I2C_MASTER_BASE );
+ uxState = mainI2C_IDLE;
+
+ /* Send the result to the co-routine. */
+ crQUEUE_SEND_FROM_ISR( xADCQueue, &xReading, pdFALSE );
+ break;
+ }
+}
+/*-----------------------------------------------------------*/
+
+void vApplicationIdleHook( void )
+{
+ for( ;; )
+ {
+ vCoRoutineSchedule();
+ }
+}
+
diff --git a/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/vectors.s b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/vectors.s
new file mode 100644
index 0000000..2cc2608
--- /dev/null
+++ b/third_party/FreeRTOS/Demo/CORTEX_LM3S102_Rowley/Demo3/vectors.s
@@ -0,0 +1,121 @@
+/*****************************************************************************
+ * Copyright (c) 2006 Rowley Associates Limited. *
+ * *
+ * This file may be distributed under the terms of the License Agreement *
+ * provided with this software. *
+ * *
+ * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE *
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
+ *****************************************************************************/
+ .section .vectors, "ax"
+ .code 16
+ .align 0
+ .global _vectors
+
+ .extern xPortPendSVHandler
+ .extern xPortSysTickHandler
+ .extern vI2C_ISR
+ .extern faultisr
+ .extern vPortSVCHandler
+
+.macro DEFAULT_ISR_HANDLER name=
+ .thumb_func
+ .weak \name
+\name:
+1: b 1b /* endless loop */
+.endm
+
+_vectors:
+ .word __stack_end__
+#ifdef STARTUP_FROM_RESET
+ .word _start
+#else
+ .word reset_wait
+#endif /* STARTUP_FROM_RESET */
+ .word NmiISR
+ .word FaultISR
+ .word 0 // Populate if using MemManage (MPU)
+ .word 0 // Populate if using Bus fault
+ .word 0 // Populate if using Usage fault
+ .word 0 // Reserved
+ .word 0 // Reserved
+ .word 0 // Reserved
+ .word 0 // Reserved
+ .word vPortSVCHandler
+ .word 0 // Populate if using a debug monitor
+ .word 0 // Reserved
+ .word xPortPendSVHandler // Populate if using pendable service request
+ .word xPortSysTickHandler
+ // External interrupts start her
+ .word GPIO_Port_A_ISR
+ .word GPIO_Port_B_ISR
+ .word GPIO_Port_C_ISR
+ .word GPIO_Port_D_ISR
+ .word GPIO_Port_E_ISR
+ .word UART0_ISR
+ .word UART1_ISR
+ .word SSI_ISR
+ .word vI2C_ISR
+ .word PWM_Fault_ISR
+ .word PWM_Generator_0_ISR
+ .word PWM_Generator_1_ISR
+ .word PWM_Generator_2_ISR
+ .word QEI_ISR
+ .word ADC_Sequence_0_ISR
+ .word ADC_Sequence_1_ISR
+ .word ADC_Sequence_2_ISR
+ .word ADC_Sequence_3_ISR
+ .word Watchdog_timer_ISR
+ .word Timer0a_ISR
+ .word Timer0b_ISR
+ .word Timer1a_ISR
+ .word Timer1b_ISR
+ .word Timer2a_ISR
+ .word Timer2b_ISR
+ .word Analog_Comparator_0_ISR
+ .word Analog_Comparator_1_ISR
+ .word Analog_Comparator_2_ISR
+ .word System_Control_ISR
+ .word FLASH_Control_ISR
+
+ .section .init, "ax"
+ .thumb_func
+
+DEFAULT_ISR_HANDLER NmiISR
+DEFAULT_ISR_HANDLER FaultISR
+DEFAULT_ISR_HANDLER SVCallISR
+DEFAULT_ISR_HANDLER SysTickISR
+DEFAULT_ISR_HANDLER GPIO_Port_A_ISR
+DEFAULT_ISR_HANDLER GPIO_Port_B_ISR
+DEFAULT_ISR_HANDLER GPIO_Port_C_ISR
+DEFAULT_ISR_HANDLER GPIO_Port_D_ISR
+DEFAULT_ISR_HANDLER GPIO_Port_E_ISR
+DEFAULT_ISR_HANDLER UART0_ISR
+DEFAULT_ISR_HANDLER UART1_ISR
+DEFAULT_ISR_HANDLER SSI_ISR
+DEFAULT_ISR_HANDLER I2C_ISR
+DEFAULT_ISR_HANDLER PWM_Fault_ISR
+DEFAULT_ISR_HANDLER PWM_Generator_0_ISR
+DEFAULT_ISR_HANDLER PWM_Generator_1_ISR
+DEFAULT_ISR_HANDLER PWM_Generator_2_ISR
+DEFAULT_ISR_HANDLER QEI_ISR
+DEFAULT_ISR_HANDLER ADC_Sequence_0_ISR
+DEFAULT_ISR_HANDLER ADC_Sequence_1_ISR
+DEFAULT_ISR_HANDLER ADC_Sequence_2_ISR
+DEFAULT_ISR_HANDLER ADC_Sequence_3_ISR
+DEFAULT_ISR_HANDLER Watchdog_timer_ISR
+DEFAULT_ISR_HANDLER Timer0a_ISR
+DEFAULT_ISR_HANDLER Timer0b_ISR
+DEFAULT_ISR_HANDLER Timer1a_ISR
+DEFAULT_ISR_HANDLER Timer1b_ISR
+DEFAULT_ISR_HANDLER Timer2a_ISR
+DEFAULT_ISR_HANDLER Timer2b_ISR
+DEFAULT_ISR_HANDLER Analog_Comparator_0_ISR
+DEFAULT_ISR_HANDLER Analog_Comparator_1_ISR
+DEFAULT_ISR_HANDLER Analog_Comparator_2_ISR
+DEFAULT_ISR_HANDLER System_Control_ISR
+DEFAULT_ISR_HANDLER FLASH_Control_ISR
+
+#ifndef STARTUP_FROM_RESET
+DEFAULT_ISR_HANDLER reset_wait
+#endif /* STARTUP_FROM_RESET */