Compare commits

...

1461 Commits

Author SHA1 Message Date
Richard Barry
e7054e934f 2015-01-17 09:38:00 +00:00
Richard Barry
acfbb7dd14 Add the beginnings of a Microblaze project for the KC705. 2015-01-16 19:16:12 +00:00
Richard Barry
501a531d46 Update version number in preparation for official V8.2.0 release. 2015-01-16 13:20:28 +00:00
Richard Barry
c37b2ca39b Demo app changes:
Add a "query heap" command to the standard sample CLI commands.
Remove casting from configMAX_PRIORITIES setting in Win32 simulator demos as it was preventing a clean build. 

Source code changes.
General tidy up and addition of assert points.
2015-01-15 21:37:32 +00:00
Richard Barry
e4e6328300 Remove casting from configMAX_PRIORITIES setting in FAT SL / CLI demo as it was preventing a clean build. 2015-01-07 07:02:17 +00:00
Richard Barry
271393b7d9 Release candidate - this will be tagged as FreeRTOS V8.2.0rc1 and a zip file provided.
Minor lint changes.
2014-12-24 09:40:58 +00:00
Richard Barry
5dd77c7aeb Rename SAM4E demo directory to include the 'F' in 'M4F' - minor point for the sake of consistency. 2014-12-24 08:55:14 +00:00
Richard Barry
6741592026 Update version numbers in preparation for V8.2.0 release candidate 1. 2014-12-21 19:09:18 +00:00
Richard Barry
fd02010886 Kernel changes:
+ Made xTaskNotifyGiveFromISR() its own function, rather than a macro that calls xTaskNotifyFromISR() (minor performance improvement).
+ GCC and Keil Cortex-M4F ports now use vPortRaiseBASEPRI() in place of ulPortRaiseBASEPRI() where the return value is not required (minor performance improvement).

Demo changes:
Change the [very basic] FreeRTOS+UDP SAM4E driver to use task notifications rather than a semaphore (execution time now 55% what it was in FreeRTOS V8.1.2!).
Robustness improvements to IntQueue.c standard demo task.h.
Added the latest standard demo tasks, reg test tasks and int q  tasks to the SAM4E demo.
2014-12-21 10:26:36 +00:00
Richard Barry
2de32c0141 Kernel changes:
+ Do not attempt to free the stack of a deleted task if the stack was statically allocated.
+ Introduce configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES - which optionally writes known values into the list and list item data structures in order to assist with the detection of memory corruptions.

Microblase port:  
+Change occurrences of #if XPAR_MICROBLAZE_0_USE_FPU == 1 to 	#if XPAR_MICROBLAZE_0_USE_FPU != 0 as the value can also be 2 or 3.

Demo app modifications:
+ Update Zynq project to use the 2014.4 tools and add in tests for the new task notification feature.
+ Update SAM4S project to include tests for the new task notification feature.
2014-12-19 16:27:56 +00:00
Richard Barry
f407b70dcc + Update demos that use FreeRTOS+Trace to work with the latest trace recorder library.
+ Fix a few compiler warnings.
+ Add TickType_t specific critical sections so critical sections are not used when accessing the tick count in cases where the access is atomic (32-bit tick count, 32-bit architecture).
2014-12-18 11:02:15 +00:00
Richard Barry
85fb1cc024 + New feature added: Task notifications.
+ Optimise Cortex-M4F ports by inlining some critical section macros.
+ Original ports used a #define to set the path to portmacro.h - that method has been obsolete for years and now all the old definitions have been moved into a separate header files called deprecated_definitions.h.
+ Cortex-M port now check the active vector bits against 0xff when determining if a function is called from an interrupt - previously only a subset of the bits (0x1f) were checked.
+ Add in new standard demo/test files TaskNotify.c/h and include the files in the simulator demos.
+ Update trace recorder code, and some demos to use the new version (more to do).
+ Introduce uxTaskPriorityGetFromISR().
+ Minor typo corrections.
+ Update MingW simulator demo to match the MSVC simulator demo.
2014-12-15 14:13:03 +00:00
Richard Barry
ca22607d14 Core kernel code:
Allow the stats formatting functions to be built in without stdio.h being included inside tasks.c.

Kernel port code:
- Slight change to the Cortex-A GIC-less port to move all non portable code to the application level.

SAMA5D4 demo project:
- Update the Atmel provided library to V1.1.
- Create a DDR build configuration.
- Ensure interrupts are all edge sensitive.
- Update the regtest code to use all 32 flop registers.
2014-10-15 21:01:31 +00:00
Richard Barry
e3263bb9b3 Demo projects only:
+ Remove some #warnings messages from the Cycle 5 - which were left in the code as reminders of tests that were not yet completed but are now.
2014-10-09 15:42:43 +00:00
Richard Barry
9e66637bec Core kernel files:
+ Change how queues are allocated and deleted so only one pvPortMalloc() or vPortFree() is required in place of the previous 2.
+ Where the TCB is allocated in relation to the stack is now dependent on the stack growth direction.  The stack will not grow into the TCB.
+ Introduce the configAPPLICATION_ALLOCATED_HEAP constant to allow the application to provide the array used by heap_4.c as its heap.  This allows the application writer to use qualifiers on the array to, for example, force the memory into faster RAM.

Demo application:
+ Add demo for SAMA5D4 using IAR.
2014-10-08 20:31:14 +00:00
Richard Barry
ee541a347d MSP430 Demo projects only:
Update project format to new IAR version.
2014-10-05 20:43:12 +00:00
Richard Barry
e0d9a274e2 Demo project only:
Added comprehensive demo including FreeRTOS+CLI to the Cyclone V SoC project.
2014-10-01 17:28:42 +00:00
Richard Barry
d269f2027a Demo project only: Cyclone V SoC now running from external RAM. 2014-10-01 09:30:35 +00:00
Richard Barry
e2f2cfa816 Added project for Altera Cyclone V SoC, currently running from internal RAM. 2014-09-30 15:32:19 +00:00
Richard Barry
3b0854bf96 Core kernel code:
+ Introduce xSemaphoreGenericGiveFromISR() as an optimisation when giving semaphores and mutexes from an interrupt.

Demo applications:
+ Update IntSemTest.c to provide more code coverage in xSemaphoreGenericGiveFromISR().
+ Ensure the MMU is turned on in the RZ IAR demo.  It was already on in the RZ ARM demo.
2014-09-16 14:54:32 +00:00
Richard Barry
b3c040fc27 SAM4L tickless implementation: Bug fix and update the demo project to exercise the fix. 2014-09-16 12:24:14 +00:00
Richard Barry
4f03f7d1bb Demo project only:
Add the new IntSem test/demo code into the MSVC demo project.
2014-09-12 11:32:47 +00:00
Richard Barry
b6e4854f26 Demo tasks only, with the aim of improving test coverage:
+ Split out the code that uses a mutex from an interrupt from GenQTest.c and add to new common demo task IntSemTest.c.
2014-09-11 12:06:27 +00:00
Richard Barry
d55e7e77a2 Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISED_TASK_SELECTION into individual port layers so it does not affect ports that do not support the definition. 2014-09-02 22:39:54 +00:00
Richard Barry
33cc3a292b Demo code only:
Add the IntQ standard test to the SAM4S project.
2014-09-02 16:06:57 +00:00
Richard Barry
99229b597b Correct potential compiler warning when configUSE_MUTEXES is set to 0.
Add comments.
2014-08-30 20:18:18 +00:00
Richard Barry
a60ce58731 Update version number to 8.1.1 for patch release that re-enables mutexes to be given from an interrupt. 2014-08-29 19:14:23 +00:00
Richard Barry
ff5d3512b3 Core kernel code:
- Re-introduce the ability to give a mutex from an ISR.

Common demo code:
- Add additional tests into the GenQTest files for priority inheritance and using a mutex from an ISR.
2014-08-29 13:53:58 +00:00
Richard Barry
6507701fdf Lower the minimum stack size used by the ATSAMA5 demo. 2014-08-26 16:53:40 +00:00
Richard Barry
7d49c2190c Minor edits prior to tagging V8.1.0. 2014-08-26 16:23:09 +00:00
Richard Barry
d33a14b5fb ***IMMINENT RELEASE NOTICE***
Update version numbers ready for FreeRTOS V8.1.0 release in about 10 days.
2014-08-16 20:19:40 +00:00
Richard Barry
e491610725 Remove some irrelevant CyaSSL files. 2014-08-16 15:43:43 +00:00
Richard Barry
52e687086c Demo application related:
+ Update the RZ IAR project so it targets the RZ RSK rather than custom hardware.
+ Update the RZ ARM/DS-5 project so it targets the RZ RSK rather than custom hardware.
+ Updated RX64M demos to use the new iodefine.h naming.

Cortex-A9 port related:
+ Update IAR, ARM and GCC Cortex-A9 port layers to include a 'task exit error' function which is called if a task attempts to incorrectly exit its implementing function.
+ Moved the instruction which switches into system mode out of the restore context macro, as it is only needed when starting the first task.

Core kernel files related:
+ Ensure there are no references to the mutexes held count when mutexes are excluded from the build.
2014-08-16 14:29:39 +00:00
Richard Barry
162448f06b General maintenance - changing comments and correcting spellings only. 2014-08-04 07:57:18 +00:00
Richard Barry
60538c7480 Common demo tasks:
- Add additional tests to GenQTest.c to test the updated priority inheritance mechanism.
- Slightly increase some delays in recmutex.c to prevent it reporting false errors in high load test cases.

SAMA5D3 Xplained IAR demo:
- Remove space being allocated for stacks that are not used.
- Remove explicit enabling of interrupts in ISR handers as this is now done from the central ISR callback before the individual handers are invoked.
- Reduce both the allocated heap size and the stack allocated to each task.
- Enable I cache.
2014-08-04 07:53:20 +00:00
Richard Barry
47f895cb34 Cortex-A5 IAR port:
- Removed SAMA5 specifics from the port layer, and instead call a generic ISR callback as per Cortex-A9 ports.
2014-08-03 19:15:30 +00:00
Richard Barry
b2e739495a Cortex-A5 IAR port baseline prior to removing all SAMA5 specifics to make it generic.:
- Slight improvement to the save context macro.
- Remove some #warning remarks.
- Enable interrupts before calling the ISR handler rather than in the ISR handler.
2014-08-03 18:37:58 +00:00
Richard Barry
3a3d061cc5 Continue working on the GIC-less Cortex-A5 port for IAR:
- Add in the assert when a task attempts to exit its implementing function without deleting itself.
- Remove obsolete code from the context switch asm code (obsoleted by the fact that there is no mask register).
- Attempt to make code more generic by using definitions for additional register addresses.
2014-07-29 21:31:04 +00:00
Richard Barry
e9b5deb34a Carry on working on SAMA5D3 demo:
- Add full interrupt nesting tests.
- Add additional critical section/context switching tests.
- Set interrupt priorities so everything can run at once without any software watchdog errors.
- Re-enable interrupts in each IRQ handler.
- Add in run-time stats.
2014-07-29 21:28:22 +00:00
Richard Barry
146b46df87 SAMA5D3 demo: Add CDC driver code and use CDC to create a simple command console. 2014-07-23 21:07:03 +00:00
Richard Barry
3d007d0b4b Update CyaSSL to latest version. 2014-07-18 18:54:25 +00:00
Richard Barry
5fcd270398 Re-test Zynq demo now it is using the latest tools. 2014-07-14 14:01:07 +00:00
Richard Barry
bd9d37924d Add back Zynq demo - this time using SDK V14.2. 2014-07-14 13:00:18 +00:00
Richard Barry
96ceb9f537 Remove Zynq demo project ready to recreate the project using the 14.2 version of Xilinx's SDK. 2014-07-14 11:46:34 +00:00
Richard Barry
5b96cf6eea Add 'full' demo to the SAMA5 Xplained demo - but so far without interrupt nesting tests or CLI. 2014-07-12 20:40:33 +00:00
Richard Barry
8ad9b75810 Rename ARM_CAx_No_GIC ARM_CA5_No_GIC and add FreeRTOSConfig setting to specify the number of registers in the FPU unit. 2014-07-12 20:39:22 +00:00
Richard Barry
29336e35b5 SAMA5D3 Xplained demo blinky running. 2014-07-12 19:25:18 +00:00
Richard Barry
f4a1a7d577 Add new port layer for Cortex-A devices without the means to mask interrupt priorities. 2014-07-12 19:21:04 +00:00
Richard Barry
5b96c12e92 Start of SAMA5D3 XPlained demo. 2014-07-09 21:19:01 +00:00
Richard Barry
8aa5fa3459 Make the parameters to vPortDefineHeapRegions() const.
Add additional asserts to the Keil CM3 and CM4F ports (other CM3/4 ports already updated).
Add the additional yield necessitated by the mutex held count to the case when configUSE_QUEUE_SETS is 0.
2014-07-04 13:17:21 +00:00
Richard Barry
4fe2abc792 Update the MSVC simulator demo to demonstrate heap_5 allocator and pdTICKS_TO_MS macro being used. 2014-07-03 16:49:29 +00:00
Richard Barry
d96dc2adb0 Simply some of the alignment calculations in heap_4.c to match those used in heap_5.c.
Remove some apparently obsolete code from xTaskPriorityDisinherit() (a task cannot be both blocked and giving bac a mutex at the same time].
Update the new "mutex held count" increment and decrement functions to allow mutexes to be created before the scheduler is started.
2014-07-03 14:44:37 +00:00
Richard Barry
b0ba273489 Check in the portable.h version required to use heap_5.c. 2014-07-02 10:20:35 +00:00
Richard Barry
4b26dc0614 Check in the new memory allocator that allows the heap to span multiple blocks. 2014-07-02 10:19:49 +00:00
Richard Barry
5e47df8c01 Update FreeRTOS+ components and demos to use typedef names introduced in FreeRTOS V8. 2014-06-20 20:15:20 +00:00
Richard Barry
4ce4de750a Update timer demo in PIC32MZ demo to remove multiple extern definition created by adding in the macro that checks non ISR safe functions are not called from ISRs. 2014-06-16 13:07:01 +00:00
Richard Barry
42b1688a30 Implementation of mutex held counting in tasks.c - needs optimisation before release. 2014-06-16 12:55:50 +00:00
Richard Barry
583b144bc3 Default the definition of portASSERT_IF_IN_ISR() to nothing if it is not defined.
Helper updates to allow a count of the number of mutexes held to be added.
Updates to the CCS Cortex-R4 implementation necessitated by a change in compiler semantics.
Update PIC32MX and MZ ports to assert if a non ISR safe function is called from an ISR.
2014-06-16 12:51:35 +00:00
Richard Barry
b4659d8872 Add code to assert() if non ISR safe API function is called from ISR in Tasking CM4F ports - plus fix bug where the max syscall interrupt priority was used incorrectly in the Tasking CM4F port. 2014-06-15 09:24:08 +00:00
Richard Barry
113220628f Add code to assert() if non ISR safe API function is called from ISR in IAR and GCC CM3 and CM4F ports - Keil and tasking to follow. 2014-06-14 13:56:25 +00:00
Richard Barry
4723209074 Simplify the assert that checks if a non-ISR safe function is called from an ISR in the GCC Cortex-A9 port. 2014-06-13 14:08:28 +00:00
Richard Barry
d45f18cc8d Add additional comments to the Zynq lwIP demo. 2014-06-13 14:06:43 +00:00
Richard Barry
8426eba8e7 Added portASSERT_IF_IN_INTERRUPT() macro to the GCC Cortex A9 port layer. 2014-06-12 16:28:56 +00:00
Richard Barry
de7df3cfda Zynq demo: Fix Xilinx network driver by deferring the function that allocated memory from the interrupt into a task. Add DHCP option. 2014-06-12 16:27:35 +00:00
Richard Barry
f1a0534a56 Remove some of the lwip asserts to allow use with 64-bit alignment. 2014-06-10 16:29:32 +00:00
Richard Barry
7fa64efeeb Switch to using the private watchdog as the run time stats timer in the Zynq demo. 2014-06-10 16:25:46 +00:00
Richard Barry
2f6cb8a86c Reorganise Zynq project after spitting lwIP example into a separate configuration. 2014-06-09 20:20:23 +00:00
Richard Barry
e92795bcc8 Move the Zynq's lwIP example from the Full demo into its own configuration as having the lwIP tasks at a high priority made the self checking test tasks report failures, while having the lwIP tasks at a low priority slugged the throughput. 2014-06-09 19:35:08 +00:00
Richard Barry
be8b0ed21d Update lwIP byte alignment to make Zynq pings more reliable. 2014-06-09 12:43:18 +00:00
Richard Barry
16ff69e873 Update RL78 GCC demo application after testing with fixed compiler. 2014-06-05 12:44:38 +00:00
Richard Barry
9efb5c8b2f Check in RL78 GCC port layer now it has been verified with the fixed compiler. 2014-06-05 12:42:49 +00:00
Richard Barry
5cbab67186 Complete RX64M GCC demo. 2014-06-04 09:19:16 +00:00
Richard Barry
1130a53ec8 Reverse order of projdefs.h and FreeRTOSConfig.h includes in FreeRTOS.h to allow addition of pdMS_TO_TICKS() macro.
Update RXv2 GCC port to match RXv2 Renesas port.
2014-06-04 09:17:14 +00:00
Richard Barry
5cd0b1e5ef Add -nomessage command line option to RX64M demo to suppress warning about the yield function being defined when it is not called directly. 2014-05-29 13:56:16 +00:00
Richard Barry
f46070dc79 Ensure demo app files are using FreeRTOS V8 names - a few were missed previously. 2014-05-29 13:54:15 +00:00
Richard Barry
ef254df85f A few additional casts to keep the Renesas RX compiler happy. 2014-05-29 13:39:48 +00:00
Richard Barry
74ffdb0b89 Add lwIP driver into Zynq demo - not yet fully functional. 2014-05-23 16:38:18 +00:00
Richard Barry
09a89763ee Add brackets in lwIP assert statement to prevent compiler warnings. 2014-05-23 16:36:49 +00:00
Richard Barry
b215310e63 Add some missing volatiles to __asm statements in the CA9 GCC port. 2014-05-19 13:14:02 +00:00
Richard Barry
0bb794301a Update version number ready for release. 2014-04-24 14:26:36 +00:00
Richard Barry
911e82a909 Add xQueueGetMutexHolder() to MPU functions. 2014-04-24 12:29:40 +00:00
Richard Barry
f25503977e Event Groups: Convert the 'clear bits from ISR' function into a pended function to fix reentrancy issue.
Event Groups: Ensure the 'wait bits' and 'sync' functions don't return values that still contain some internal control bits.
2014-04-23 15:23:54 +00:00
Richard Barry
fa7222ab4a Update demos that use FreeRTOS+FAT SL to have correct version numbers after the update of FreeRTOS+FAT SL itself. 2014-04-23 14:34:49 +00:00
Richard Barry
03c95b5950 Update IAR XMC4200 project to fix link error that resulted from updating the IAR version to 7.x. 2014-04-23 13:59:56 +00:00
Richard Barry
a46f251d11 Update FreeRTOS+FAT SL to version 1.0.1. 2014-04-23 13:28:21 +00:00
Richard Barry
6af9b013eb Ensure xNewLib_reent is reclaimed when a task is deleted. 2014-04-09 09:07:19 +00:00
Richard Barry
82207ebffa Add test and correct code for the unusual case of a task using an event group to synchronise only with itself.
Add critical sections around call to prvResetNextTaskUnblockTime() that can occur from within a task.
2014-03-31 02:12:17 +00:00
Richard Barry
ef7f3c5320 Add the pcTimerGetTimerName() API function. 2014-03-28 14:41:15 +00:00
Richard Barry
887fcd04f4 Add interrupt nesting test code into RX64M demo. 2014-03-28 13:05:29 +00:00
Richard Barry
42cbd6a778 Add RSK definition and LED flash tasks into RX64M demo. 2014-03-28 11:47:40 +00:00
Richard Barry
29a08b5e24 Update Cortex-A port layers to ensure the ICCRPR and ICCPMR registers are always accessed as 32-bit values. 2014-03-25 17:12:31 +00:00
Richard Barry
d59bf60ff9 Started to create RX64M GCC project - building but not yet converted to new core. 2014-03-20 12:04:49 +00:00
Richard Barry
6fe7e7ef67 Delete old RL78 launch configurations. 2014-03-19 16:45:53 +00:00
Richard Barry
7f7ad3d081 Add RL78/L1C configuration into e2studio demo. 2014-03-19 16:44:58 +00:00
Richard Barry
2283bfb0ae RL78/L1C configuration added to the IAR RL78 demo projects. 2014-03-19 13:29:11 +00:00
Richard Barry
a5f00caf16 Working but incomplete RXv2 demo. 2014-03-07 17:13:05 +00:00
Richard Barry
05a0e4379e First pass at RXv2 port layer. 2014-03-07 17:12:06 +00:00
Richard Barry
3788026636 RXv1 tests running before updating to RXv2. 2014-03-06 12:46:16 +00:00
Richard Barry
b17ab311af Start to create an RX64M demo. 2014-03-03 16:39:41 +00:00
Richard Barry
9bd5e5cf03 Cast away a few unused return types to ensure lint/compilers don't generate warnings when the warning level is high. 2014-02-23 20:01:07 +00:00
Richard Barry
c8953a68cd Add extra #error message as a configuration sanity check. 2014-02-19 13:08:34 +00:00
Richard Barry
ba6d285ea8 Minor updates to ensure all kernel aware debuggers are happy with V8. 2014-02-19 11:58:52 +00:00
Richard Barry
e101e7e437 Update version number to V8.0.0 (without the release candidate number). 2014-02-18 14:01:57 +00:00
Richard Barry
38ae9b76bc Add logic to determine the tick timer source and vector installation into the PIC32MZ port assembly file to allow more efficient interrupt entry. 2014-02-18 10:10:32 +00:00
Richard Barry
c3dd6f6593 Add event group code to the PIC32MZ demo. 2014-02-18 10:08:33 +00:00
Richard Barry
0f6b699eef Linting. 2014-02-17 19:41:29 +00:00
Richard Barry
a2089bbcf6 Add #define INCLUDE_eTaskGetState 1 to the demos that use the int queue test. 2014-02-17 19:32:20 +00:00
Richard Barry
2346014918 Update final demos that use the trace recorder code to use the new version. 2014-02-17 15:11:16 +00:00
Richard Barry
33e11c72c3 Update LPC1830 example to use the latest trace recorder code. 2014-02-17 14:18:00 +00:00
Richard Barry
d6da7b1231 Remove test of trace functions from the Win32/GCC build as it messes up the trace recorder. 2014-02-17 12:56:05 +00:00
Richard Barry
0ccfdd1021 Remove test of trace functions from the Win32 build as it messes up the trace recorder. 2014-02-17 12:48:18 +00:00
Richard Barry
04ae37ef12 Update trace recorder to include heap tracing and new v8 features. 2014-02-17 12:45:56 +00:00
Richard Barry
853696a991 Add event groups demo to SAM4E demo. 2014-02-16 22:03:39 +00:00
Richard Barry
b7eb76904a Add event group tests to IAR LM3S demo. 2014-02-16 21:47:07 +00:00
Richard Barry
e4dbc6b770 Make xEventGroupSetBitsFromISR() a function when configUSE_TRACE_FACILITY is enabled to allow the inclusion of a trace macro. 2014-02-14 11:07:25 +00:00
Richard Barry
b96016e234 Follow instructions on http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx to manually prevent MSVC from incorrectly reporting the MSVC demo project as being out of date. 2014-02-11 15:15:36 +00:00
Richard Barry
5a2a8fc319 Update the demo directory to use the version 8 type naming conventions. 2014-02-11 12:04:59 +00:00
Richard Barry
c6d8892b0d Replace xTaskIsTaskSuspended() call with eTaskGetState() call in IntQueue.c as the former is now a private function. 2014-02-11 11:38:33 +00:00
Richard Barry
4f01401c00 Add a small amount of randomisation into the Zynq demo. 2014-02-11 11:37:42 +00:00
Richard Barry
0cc51d99a7 Add event groups demo to Zynq demo.
Add C implementations of some standard library functions to the Zynq demo to prevent the GCC libraries (which use floating point registers as scratch registers) being linked in.
2014-02-11 09:24:33 +00:00
Richard Barry
3eb212f454 Update IAR RL78 demo regtest tasks to make use of SKZ instructions as the latest IAR linker didn't seem to like the previous version. 2014-02-10 19:13:49 +00:00
Richard Barry
84f4ae9aa0 Make xTaskIsTaskSuspended() a private function as it should only be called from within critical sections.
Fix issue in and simplify the xTaskRemoveFromUnorderedEventList() function.  The function is new to the V8 release candidates so does not effect official released code.
2014-02-10 17:02:37 +00:00
Richard Barry
eea669240b Remove inclusion of now removed header file from the RZ/IAR LowLevelInitialise.c file. 2014-02-10 14:22:19 +00:00
Richard Barry
d4ca65f22f Third attempt: Improve how TimerDemo.c manages differences between the tick count and its own internal tick count, which can temporarily differ when the tick hook is called while the scheduler is suspended. 2014-02-10 14:21:17 +00:00
Richard Barry
660162a5b8 Update the Win32/MingW demo to match the latest Win32/MSVC demo. 2014-02-10 14:16:39 +00:00
Richard Barry
d12ec14160 Add configCLEAR_TICK_INTERRUPT() to the IAR and RVDS Cortex-A9 ports.
Replace LDMFD with POP instructions in IAR and RVDS Cortex-A9 ports.
Replace branch to address with indirect branch and exchange to address in register in the IAR and RVDS Cortex-A9 ports.
2014-02-04 17:02:52 +00:00
Richard Barry
9a8da3ff38 Second attempt: Improve how TimerDemo.c manages differences between the tick count and its own internal tick count, which can temporarily differ when the tick hook is called while the scheduler is suspended. 2014-02-04 15:51:48 +00:00
Richard Barry
03f9bbda52 Improve how TimerDemo.c manages differences between the tick count and its own internal tick count, which can temporarily differ when the tick hook is called while the scheduler is suspended. 2014-02-04 14:55:53 +00:00
Richard Barry
481db56078 Related to Zynq demo: Remove compiler warnings when configASSERT() is not defined and set the type of the assembly functions to allow them to be called when the C code is compiled to THUMB instructions. 2014-02-04 14:53:17 +00:00
Richard Barry
f843888e60 Complete GCC/Cortex-A9 port. 2014-02-04 14:49:48 +00:00
Richard Barry
c83414ccc4 Finish the Zynq demo. 2014-02-03 17:39:45 +00:00
Richard Barry
2fc4e89b98 Add in interrupt nesting test. 2014-01-30 14:45:48 +00:00
Richard Barry
d898d16c44 Check in working IntQueueTimer.c for Zynq before overhauling to ensure it conforms to the FreeRTOS style and coding standard. 2014-01-30 12:09:32 +00:00
Richard Barry
6c72f470ac Update Zynq serial.c to be interrupt driven. 2014-01-29 15:20:34 +00:00
Richard Barry
d310ac4552 Add very basic serial CLI to the Zynq demo - needs a lot of tidy up yet! 2014-01-28 17:41:28 +00:00
Richard Barry
51ea2639a9 vQueueAddToRegistry() now takes a const char * instead of a char *.
tmrCOMMAND_CHANGE_PERIOD_FROM_ISR constant added for the "FromISR" version of the software timer change period API function.
2014-01-28 12:32:03 +00:00
Richard Barry
0bf2e615b2 Uncheck the "Do not search standard system directories for header files" compiler option in two RX600 project to ensure stdint.h can be found correctly. 2014-01-27 10:33:57 +00:00
Richard Barry
6130fec60e Introduce xTimerPendFunctionCall().
Change INCLUDE_xTimerPendFunctionCallFromISR to INCLUDE_xTimerPendFunctionCall
Update event group trace macros to match the new trace recorder code.
Ensure parameter name consistency by renaming any occurrences of xBlockTime and xBlockTimeTicks to xTicksToWait.
Continue work on GCC/RL78 port - still a work in progress.
Adjust how the critical section was used in xQueueAddToSet.
2014-01-25 17:01:41 +00:00
Richard Barry
e4f495012f Fixes to FreeRTOS+UDP trace macro parameters and placements. 2014-01-25 09:50:28 +00:00
Richard Barry
888733ef79 Add main_full.c to Zynq demo. Still a work in progress. 2014-01-24 17:11:22 +00:00
Richard Barry
b352be2e23 Tidy up GCC Cortex-A port layer - still a work in progress. 2014-01-24 17:09:31 +00:00
Richard Barry
14f895478d Continue work on GCC/Cortex-A port layer. 2014-01-24 13:27:56 +00:00
Richard Barry
4c9b5d88ae Continue Zynq demo - ParTest.c now working (with single LED), but still very much a work in progress. 2014-01-24 13:27:01 +00:00
Richard Barry
1e26b1875f Remove #error that attempted to catch stdint.h not being included.
Split the previously overloaded trmCOMMAND_nnn definitions into individual definitions to enable better logging.
2014-01-23 14:51:53 +00:00
Richard Barry
d0323e67ae Continue working on GCC/CA_9 port layer - tick interrupt now working but needs tidy up. 2014-01-23 11:51:57 +00:00
Richard Barry
8cb6a4f032 Continue working on Zynq demo - tick interrupt now working but needs tidy up. 2014-01-23 11:50:48 +00:00
Richard Barry
371f6f359a Carry on working on the Zynq demo - still a work in progress. 2014-01-22 15:43:27 +00:00
Richard Barry
3e430b3801 Carry on working on the Cortex-A/GCC port layer - still a work in progress. 2014-01-22 15:39:58 +00:00
Richard Barry
33351b02c9 Beginnings of a project to build the GCC Cortex-A port targeting a Zynq. 2014-01-20 17:55:16 +00:00
Richard Barry
86023aa5a6 Beginnings of GCC Cortex-A port - not yet completely converted from IAR version. 2014-01-20 17:53:30 +00:00
Richard Barry
d8c135e2dc Add extern 'C' to FreeRTOS.h.
Remove obsolete extern declaration of vTaskSwitchContext() from the MPX430X IAR portmacro.h (other older portmacro.h header files contain the same declaration).
2014-01-17 09:45:02 +00:00
Richard Barry
a1b8079df1 Introduce configENABLE_BACKWARD_COMPATIBILITY to allow the #defines that provide backward compatibility with FreeRTOS version prior to V8 to be optionally omitted. 2014-01-13 20:26:47 +00:00
Richard Barry
f01bf9fdc3 Add additional NOP after EINT instruction in MSP430 ports. 2014-01-10 10:38:02 +00:00
Richard Barry
a20e75082e Remove obsolete OpenOCD driver. 2014-01-05 20:41:34 +00:00
Richard Barry
1aaa80fba6 Map portTICK_RATE_MS to portTICK_PERIOD_MS. 2014-01-05 20:40:55 +00:00
Richard Barry
a56d4b998c Minor tidy ups that don't effect code generation, plus:
When a task is unblocked the need for a context switch is only signalled if the unblocked task has a priority higher than the currently running task, instead of higher than or equal to the priority of the currently running task.
2014-01-05 20:12:20 +00:00
Richard Barry
723682f1dd Minor comment corrections prior to tagging. 2013-12-31 21:30:30 +00:00
Richard Barry
a8836b5c43 Change version numbers ready for V8.0.0 release candidate 1 tag. 2013-12-31 20:10:09 +00:00
Richard Barry
a44a6fbaeb Add link to upgrading information. 2013-12-31 19:15:00 +00:00
Richard Barry
3705435417 Add the event group interrupt tests to the Win32 demo projects. 2013-12-31 19:10:11 +00:00
Richard Barry
8ae3d489fe Comment the event groups standard demo files. 2013-12-31 19:07:31 +00:00
Richard Barry
2aa19f1a14 Add xEventGroupClearBitsFromISR() and xEventGroupGetBitsFromISR() functions.
Move some types defines out of generic kernel headers into feature specific headers.
Convert the function prototype dypedefs to the new _t naming.
2013-12-31 16:45:49 +00:00
Richard Barry
38e7554138 Update FreeRTOS+ more demos that use FreeRTOS+CLI to remove casting to int8_t * from strings. 2013-12-30 19:32:29 +00:00
Richard Barry
31609c7c3e Update FreeRTOS+ demos that use FreeRTOS+CLI to remove casting to int8_t * from strings. 2013-12-30 16:07:34 +00:00
Richard Barry
42a2338f1c Update demos that use FreeRTOS+CLI to remove casting to int8_t * from strings. 2013-12-30 14:06:57 +00:00
Richard Barry
e95b482f56 Minor updates to demo projects to ensure correct building with V8 rc1. 2013-12-30 11:24:34 +00:00
Richard Barry
f9072e7bac Remove casting from definition of configMAX_PRIORITIES to allow its use in pre-processor defined conditional compilation. 2013-12-30 08:02:11 +00:00
Richard Barry
e4965ca03c Minor updates to demo projects to ensure correct building with V8 rc1. 2013-12-30 07:54:46 +00:00
Richard Barry
2b6eb1c5ab Revert some library files back to using standard types as they are not FreeRTOS files. 2013-12-29 14:55:55 +00:00
Richard Barry
b54158d1dc Replace use of legacy portTYPE macros from old demos and standard demo files. 2013-12-29 14:49:03 +00:00
Richard Barry
3e20aa7d60 Replace standard types with stdint.h types.
Replace #define types with typedefs.
Rename all typedefs to have a _t extension.
Add #defines to automatically convert old FreeRTOS specific types to their new names (with the _t).
2013-12-29 14:06:04 +00:00
Richard Barry
f292243dcf Change 'signed char *pcTaskName) to 'char *pcTaskName' in vApplicationStackOverflowHook(). 2013-12-27 16:30:19 +00:00
Richard Barry
3517bbdcce Remove unnecessary 'signed char *' casts from strings that are now just plain char * types in the FreeRTOS-Plus directory. 2013-12-27 16:23:07 +00:00
Richard Barry
653fdb81d5 Continue to remove unnecessary 'signed char *' casts from strings that are now just plain char * types. 2013-12-27 15:49:59 +00:00
Richard Barry
da93f1fc4b Start to remove unnecessary 'signed char *' casts from strings that are now just plain char * types. 2013-12-27 14:43:48 +00:00
Richard Barry
b4116a7c7d Change the type used for strings and single characters from signed char to just char. 2013-12-27 12:10:23 +00:00
Richard Barry
b3aa1e90ad Add additional const qualifiers. 2013-12-24 11:55:38 +00:00
Richard Barry
6179690dc9 Don't free xQueue->ucHead if it is NULL. 2013-12-24 10:47:52 +00:00
Richard Barry
a3c2f45116 Move the event groups single tasks test out of the common demo file (they are now part of the module tests). 2013-12-23 18:13:29 +00:00
Richard Barry
c861e3883d Add coverage test markers. 2013-12-23 18:11:15 +00:00
Richard Barry
64ad1c00b5 In process of module testing event_groups.c.
Introduce xPortRunning variable into Win32 simulator port layer.
Add port optimised task selection macro for the GCC Win32 port layer (the MSVC version has had one for a while).
Ensure the event list item value does not get modified by code in tasks.c (priority inheritance, or priority change) when it is in use by the event group implementation.
2013-12-23 16:02:03 +00:00
Richard Barry
0147415c40 Change some task priorities in the MingW simulator demo. 2013-12-20 11:35:16 +00:00
Richard Barry
39b2d049a6 Update GCC/Eclipse Win32 simulator port to make better use of Eclipse resource filters and match the functionality of the MSVC equivalent. 2013-12-19 13:40:37 +00:00
Richard Barry
4b2f9dad42 Force the SysTick clock bit to be set in Cortex-M3 and Cortex-M4F bits if configSYSTICK_CLOCK_HZ is not defined, otherwise leave the bit as it is found as the SysTick may use a divided clock. 2013-12-15 10:27:37 +00:00
Richard Barry
040a7c02df Change the configCPU_CLOCK_HZ setting in the SAM4E demo to use the SystemCoreClock variable. 2013-12-15 10:17:02 +00:00
Richard Barry
a320d6dffd Update the ucQueueNumber member of the queue structure (used with FreeRTOS+Trace to be an unsigned portBASE_TYPE instead of an unsigned char. 2013-12-14 13:16:05 +00:00
Richard Barry
c17c65fc09 Introduce prvResetNextTaskUnblockTime() to encapsulate functionality from various places in the code into a single function. 2013-12-13 10:35:11 +00:00
Richard Barry
acad916453 Change the way one thread deletes another in the Windows simulator port (the way one thread deleted itself was already changed in a previous check-in).
Reset the expected block time variable when a task is suspended or deleted in case the value held in the variables was associated with the task just suspended or deleted.
2013-12-12 16:07:24 +00:00
Richard Barry
0d1e12522b Update Cortex-M3 and Cortex-M4F ports to allow the SysTick to be clocked at a different speed than the system clock (as is done in the recent STM32L demo. ).
Add additional asserts and isb instructions into the Cortex-M3 and Cortex-M4F ports.
2013-12-12 14:07:20 +00:00
Richard Barry
6b3393b4b6 Add trace macros into the event groups implementation.
Add a task pre-delete hook to allow the insertion of any port specific clean up when a task is deleted.
Increase use of 'const' qualifiers.
Add vPortCloseRunningThread() into the Win32 port layer to attempt to allow Windows threads to be closed more gracefully when a task deletes itself.
2013-12-12 10:19:07 +00:00
Richard Barry
0416289066 Comment typo correction only. 2013-12-11 17:56:07 +00:00
Richard Barry
ed54bc497d Complete STM32L low power demo. 2013-12-11 11:35:03 +00:00
Richard Barry
4b655ac3bb Remove [unused] touch library files from the STM32L discovery demo. 2013-12-11 10:46:17 +00:00
Richard Barry
0028cc48c1 Remove unused files from STM32L discovery board demo directory structure and build. 2013-12-10 17:16:45 +00:00
Richard Barry
751103d848 Tidy up STM32L low power demo and add 'comprehensive demo' option. 2013-12-10 16:20:43 +00:00
Richard Barry
5638fe28a2 Remove duplication of comments at the top of the file. 2013-12-10 11:24:41 +00:00
Richard Barry
3d00d47239 STM32L discovery demo is now demonstrating three low power modes - still needs clean up. 2013-12-10 10:07:53 +00:00
Richard Barry
9001b7b77a Minor change to SAM4L_low_power_tick_management.c to ensure the alarm value cannot be set to zero. 2013-12-08 06:32:38 +00:00
Richard Barry
e682aec507 Spelling corrections in comments only. 2013-11-28 13:24:05 +00:00
Richard Barry
00ad1a0200 Multiple tidy up, documentation corrections and typo corrections highlighted by Tamas Kleiber's diligent review. 2013-11-28 10:48:33 +00:00
Richard Barry
2e42d7690a Continue work on new event groups functionality - fixups required by test results. 2013-11-27 20:29:33 +00:00
Richard Barry
d2c2e3ca68 Add additional asserts() to ensure certain operations are not performed when the scheduler is suspended.
Change the xBlockTime variables in event_groups.c/h to xTicksToWait to match the naming in other core FreeRTOS files.
2013-11-24 10:11:16 +00:00
Richard Barry
5037ecdc5c Checked in header file missed form previous checkin. 2013-11-22 11:05:24 +00:00
Richard Barry
9dc39ee2a7 Add additional event group tests - and update implementation as required by test results. 2013-11-22 10:58:25 +00:00
Richard Barry
a22d5ff5a5 Add event groups test/demo tasks. 2013-11-21 22:08:06 +00:00
Richard Barry
f54f21b8f6 Add event_groups.c and associated functions in other core files.
Added xTimerPendCallbackFromISR() to provide a centralised deferred interrupt handling mechanism.
Add xPortGetLowestEverFreeHeapSize() to heap_4.c.
2013-11-21 21:46:08 +00:00
Richard Barry
faed443e82 Continue work on STM32L demo. 2013-11-21 16:08:11 +00:00
Richard Barry
b89fd7c1e3 Add STM32L Discovery board project as a starting point to adapt to an RTOS demo. 2013-11-20 13:33:30 +00:00
Richard Barry
417c3d1054 Change backslashes to forward slashes for all PIC projects. 2013-11-18 16:00:27 +00:00
Richard Barry
ad67be1577 Tidy up SAM4E NetworkInterface.c. 2013-11-17 22:19:54 +00:00
Richard Barry
c6020ae8b4 Change conf_eth.h to provide additional Rx buffers in SAM4E demo. 2013-11-17 22:15:45 +00:00
Richard Barry
fa002f7fdd Final tidy up before V7.6.0 zip file creation. 2013-11-17 15:46:08 +00:00
Richard Barry
8cd71348be Make SAM4E network driver a little more robust. 2013-11-17 15:42:08 +00:00
Richard Barry
c2bfac68b3 Add link to documentation page inside main_full() of the SAM4E demo. 2013-11-17 15:40:56 +00:00
Richard Barry
0cbd5182a3 Add additional comments to SAM4E demo. 2013-11-17 14:14:22 +00:00
Richard Barry
6be1ffccfb Update version numbers in FreeRTOS-Plus demo files. 2013-11-17 14:12:41 +00:00
Richard Barry
cbb14d30c5 Add basic SAM4E driver.
Add ipconfigETHERNET_DRIVER_ADDS_UDP_CHECKSUM, ipconfigETHERNET_DRIVER_ADDS_IP_CHECKSUM, ipconfigETHERNET_DRIVER_CHECKS_IP_CHECKSUM and ipconfigETHERNET_DRIVER_CHECKS_UDP_CHECKSUM definitions.
2013-11-17 14:09:17 +00:00
Richard Barry
0865907f3f Add graphics to the SAM4E demo. 2013-11-16 22:33:51 +00:00
Richard Barry
9e9f9f30b1 Add UDP related commands to SAM4E demo. 2013-11-16 19:19:18 +00:00
Richard Barry
b690b26861 Add standard demo tasks to SAM4E demo. 2013-11-16 18:06:57 +00:00
Richard Barry
dc2e20bb0a Add SAM4E-EK demo with UDP and CLI. Not yet complete. 2013-11-16 13:27:44 +00:00
Richard Barry
a37b947615 Reorder the license text wording so the exception text is at the top rather than the bottom. 2013-11-12 17:26:08 +00:00
Richard Barry
a2cfaa7cd9 Correct build of helper function for ports where the stack grows up. 2013-11-12 13:06:18 +00:00
Richard Barry
8320dfb885 Update the SAM4L low power demo to use the ASF enable/disable interrupts functions rather than manipulating the PIRMASK directly - and in so doing allow other ASF functions to be called with the interrupt enable bit nesting. 2013-11-11 14:49:36 +00:00
Richard Barry
0cd79ad81d Change version numbers in preparation for V7.6.0 release. 2013-11-08 11:47:35 +00:00
Richard Barry
c44d12dadb Ensure the Win32 demo runs in co-operative mode. 2013-11-08 10:11:46 +00:00
Richard Barry
b1b4b15353 Add configASSERT()s to ensure counting semaphores are not created with a max count of zero or an initial count greater than the max count. 2013-11-07 16:45:30 +00:00
Richard Barry
b181a3af99 Ensure the definition of prvTaskExitError()does not result in a compiler warning in ports where its use can be overridden (GCC Cortex-M ports).
Remove duplicate save/restore of r14 in Cortex-M4F ports.
2013-11-07 16:43:54 +00:00
Richard Barry
20eb03ed7d Change behaviour when configUSE_PREEMPTION is 0 (preemption is turned off). See the change history in the next release for details.
Remove an erroneous const in the prototype of queue receive/peek functions.
2013-11-07 14:58:14 +00:00
Richard Barry
30bc6c01a9 Add ehb instructions back into PIC32 port layer (upon advice).
Add configCLEAR_TICK_TIMER_INTERRUPT into PIC32 port layer to allow the timer configuration to be changed without any edits to the port layer being required.
Add prvTaskExitError() into the PIC32 port layer to trap tasks that attempt to exit from their implementing function.
Provide the ability to trap interrupt stack overflows in the PIC32 port.
Radically improve the timing in the Win32 simulator port layer.
2013-11-07 14:16:32 +00:00
Richard Barry
40d2e74417 Update some standard demo task implementations so they can be used with the cooperative scheduler. 2013-11-07 14:04:05 +00:00
Richard Barry
5aabe4f8fb Update semtest.c to use xSemaphoreCreateBinary() in place of vSemaphoreCreateBinary. 2013-11-07 11:11:18 +00:00
Richard Barry
dcf261a3e6 Add xSemaphoreCreateBinary() so vSemaphoreCreate() can be deprecated. 2013-11-07 10:53:23 +00:00
Richard Barry
ca2191c6ee Ensure PIC32MX MPLAB 8 project builds with XC. 2013-11-07 10:16:15 +00:00
Richard Barry
9a0f2bda55 Update PIC32 MPLAB8 project so it builds with the new partest file names. 2013-11-07 10:11:06 +00:00
Richard Barry
1b7a2e40a3 Update PIC32MX demo:
Change configCHECK_FOR_STACK_OVERFLOW to 3 to also check the interrupt stack.
Add a build configuration to allow use on the PIC32 USBII starter kit.
Increase some delays when talking to the LCD to ensure it always displays correctly.
Rewrite the register test tasks.
2013-11-07 09:54:13 +00:00
Richard Barry
2ee43fbc64 Set the MSVC Win32 demo back to create the simply blinky demo by default.
Set the MingW Wind32 demo back to include the #error to remind people to run the CreateProjectDirectoryStructure batch file.
2013-10-29 12:40:12 +00:00
Richard Barry
73df0ffdff Update the Eclipse/MingW project to account for the new Win32 simulator port layer (which has better timing). 2013-10-29 12:32:04 +00:00
Richard Barry
6642926d43 Update the FreeRTOS+ Win32 MSVC demos to account for the changes to the Win32 port layer (more accurate timing). 2013-10-29 11:43:41 +00:00
Richard Barry
15d10ce094 Update the main Win32 MSVC demo to account for the changes to the Win32 port layer (more accurate timing). 2013-10-29 11:14:54 +00:00
Richard Barry
aa9ec31ba9 Add missing header file to the UDP BufferAllocation_1.c scheme. 2013-10-26 13:34:50 +00:00
Richard Barry
e46fe7c049 Second attempt - Ensure the private port number wrap check is inside the critical section in prvGetPrivatePortNumber() (UDP). 2013-10-23 13:59:51 +00:00
Richard Barry
818abc468d Ensure the private port number wrap check is inside the critical section in prvGetPrivatePortNumber() (UDP).
Add missing default values for some of the trace macros.
2013-10-23 10:28:17 +00:00
Richard Barry
63bd3ebbef Remove the SVC handler from the XMC1000 demo as it is no longer used by the Cortex-M0 port layer. 2013-10-22 11:27:43 +00:00
Richard Barry
dcd261bb8b Update the Keil and IAR CM0 port layers to match the changes made to the GCC version. 2013-10-22 11:26:16 +00:00
Richard Barry
7bcbef721b Remove the SVC handler from the SAMD20 FreeRTOSConfig.h as the GCC Cortex-M0 port no longer uses it. 2013-10-22 10:58:23 +00:00
Richard Barry
41fe693968 Improve how the scheduler is started in the GCC Cortex-M0 port. 2013-10-22 09:50:20 +00:00
Richard Barry
f64acd6a48 Added an additional configASSERT() to test the new eTaskGetState() behaviour (see previous checking comment). 2013-10-22 09:33:49 +00:00
Richard Barry
25bab250b6 Added a little intelligence to eTaskGetState() so it can distinguish between a suspended task and a task that is indefinitely blocked on an event. 2013-10-22 09:30:58 +00:00
Richard Barry
bafda11518 Remove maths library dependency form SAMD20 project. 2013-10-14 20:12:48 +00:00
Richard Barry
a12ea2d212 Update FreeRTOS version number to V7.5.3
Update FreeRTOS+CLI version number to V1.0.2
Update FreeRTOS+UDP version number to V1.0.1
2013-10-14 19:56:47 +00:00
Richard Barry
6280324778 Add a configASSERT() that checks the gateway address is on the same subnet as the device in FreeRTOS+UDP. 2013-10-14 14:35:53 +00:00
Richard Barry
94607d83f9 Add workaround to XMC4000 silicon bug to Tasking Cortex-M4F port layer. 2013-10-14 14:03:05 +00:00
Richard Barry
c1353bb12d Complete XMC4000 Tasking project. 2013-10-14 13:46:47 +00:00
Richard Barry
b887737c34 Fix broken link in Atmel Studio SAMD20 project. 2013-10-12 10:09:10 +00:00
Richard Barry
c09f6e6a9b Increase minimal stack size for the SAMD20 demo. 2013-10-09 18:46:08 +00:00
Richard Barry
dcea05a81c Complete tidy up of SAMD20 demo. 2013-10-09 13:26:34 +00:00
Richard Barry
41a1dc62b7 Complete SAMD20 demo - still needs tidy up.
Add comments to the XMC1000 reg test files.
2013-10-08 15:56:06 +00:00
Richard Barry
0c56f5018d Add some defensive programming in the default tickless mode in case the application supplied post tick hook takes a long time to complete. 2013-10-08 12:33:46 +00:00
Richard Barry
aedf7824cb Introduce the prvTaskExitError() function for all ARM_CMn ports.
Introduce the configTASK_RETURN_ADDRESS macro for the GCC ARM_CMn ports.
Improve time slippage penalty when entering tickless mode is abandoned.
2013-10-08 11:30:40 +00:00
Richard Barry
81e141ad86 Ensure the statically configured gateway address is on the same subnet. 2013-10-08 09:08:29 +00:00
Richard Barry
e2afb24747 Take out nonsensical #if configMAC_INTERRUPT_PRIORITY > configMAC_INTERRUPT_PRIORITY check from the LPC18xx Ethernet driver. 2013-10-07 20:17:28 +00:00
Richard Barry
0c849fa597 Update FreeRTOS_FD_SET() to check there is enough space in the queue before adding the socket to the socket set. 2013-10-07 20:13:02 +00:00
Richard Barry
10fa546e60 Make corrections to the interrupt priority configuration in the LPC1800 UDP demo that resulted from an incorrect NVIC_PRIOR_BITS setting in the LPC18xx.h header file. 2013-10-07 16:49:31 +00:00
Richard Barry
eaacbb099a Clear up a few compiler warnings.
Correct header comments in the UARTCommandConsole.c file used in the SmartFusion2 demo.
Exercise the new xQueueSpacesAvailable() function in the MSVC demo.
Add defaults for the new traceMALLOC and traceFREE trace macros.
Catch tasks trying to exit their functions in the Cortex-M0 ports.
Add additional comments to timers.c in response to a support forum question.
Initialise _impure_ptr prior to the first task being started.
Prior to V7.5.0 a yield pended in the tick hook would have occurred during the same tick interrupt.  Return pdTRUE from xTaskIncrementTick() if a yield is pending to revert to that behaviour.
2013-10-07 12:06:17 +00:00
Richard Barry
be44f8aaa7 Improve DCHP handling by removing the yiaddr field from outgoing DHCP packets and adding the broadcast bit in the flags field.
Correct the check to ensure the application network event hook is not called when the first network down event is sent.
Add in defaults for the Nabto task stack and priority.
2013-10-07 11:49:17 +00:00
Richard Barry
7ec4773131 Add traceMALLOC() and traceFREE() macros. 2013-10-04 20:56:45 +00:00
Richard Barry
23fa077241 Complete CLI demo on SAMD20. 2013-10-03 15:41:33 +00:00
Richard Barry
8ffa1b1736 Get CLI functioning in SAMD20 demo. 2013-10-02 14:24:38 +00:00
Richard Barry
013a3ef944 Starting point for the SAMD20 demo. 2013-10-02 10:41:40 +00:00
Richard Barry
111283a9b2 Finalise XMC4000 GCC demos. 2013-10-01 12:47:27 +00:00
Richard Barry
0185643b39 Finalise XMC4000 IAR demos. 2013-10-01 10:10:15 +00:00
Richard Barry
1e248417bc Finalise XMC4000 Keil demos. 2013-10-01 09:53:12 +00:00
Richard Barry
db1a5f1553 Add the configUSE_STATS_FORMATTING_FUNCTIONS parameter to a couple of FreeRTOSConfig.h header files that got missed out when the parameter was introduced. 2013-09-17 09:48:51 +00:00
Richard Barry
988b0c1678 Remove the math library as a build dependency in the SAM4L demo. 2013-09-17 09:05:31 +00:00
Richard Barry
e3b5f36c3a Move the #error message about running the CreateProjectDirectoryStructure batch file from FreeRTOSConfig.h to main.c so it shows when the batch file has not been executed (XMC4000 Dave and Tasking projects). 2013-09-10 13:58:09 +00:00
Richard Barry
1902d2b64a Add the uxQueueSpacesAvailable() API function.
Move a configASSERT() call in timers.c to prevent a "condition is always true" compiler warning.
2013-09-10 13:19:12 +00:00
Richard Barry
dd3fdfa9ff Make self monitoring in QueueSet.c more robust to prevent false positives. 2013-09-10 13:09:14 +00:00
Richard Barry
c63a81af99 Enable RX62N_RDK project to build with the blink configuration. 2013-09-10 13:05:00 +00:00
Richard Barry
49c602f3df Add #error into Tasking project to remind users that they need to run the CreateProjectDirectoryStructure batch file. 2013-09-10 13:03:35 +00:00
Richard Barry
ae402434f8 Update Keil XMC1000 to later version. 2013-09-10 13:01:48 +00:00
Richard Barry
0e28ee90b6 Finalise XMC1000 GCC demos. 2013-09-10 12:54:15 +00:00
Richard Barry
42c0ae6bc8 Finalise XMC1000 IAR demos. 2013-09-10 12:24:55 +00:00
Richard Barry
a3095b89af Finalise XMC1000 Keil demos. 2013-09-10 11:35:31 +00:00
Richard Barry
8282cc0491 Finalise XMC4000 Dave/GCC demos. 2013-09-09 16:51:19 +00:00
Richard Barry
577ff0741d Finalise XMC4000 Keil demos. 2013-09-09 16:21:46 +00:00
Richard Barry
a0a96e52f2 Finalise XMC4000 IAR demos. 2013-09-09 15:55:14 +00:00
Richard Barry
41f92ced65 Add build configurations for the XMC4400 and XMC4200 to the Tasking demo project. 2013-09-05 12:00:04 +00:00
Richard Barry
77d817ffaa Update XMC4000 tasking project to use latest system files. 2013-09-05 11:37:44 +00:00
Richard Barry
7d92a29d2d Rename directories with XMC4500 in their name that now contain XMC4200 and XMC4000 build configurations to instead say XMC4000. 2013-09-04 16:06:23 +00:00
Richard Barry
117235c08a Rename directories with XMC4500 in their name that now contain XMC4200 and XMC4000 build configurations to instead say XMC4000. 2013-09-04 16:03:31 +00:00
Richard Barry
d8963209c2 Reworked XMC4500 IAR project to use latest system files and include build configurations for the XMC4200 and XMC4400 parts. 2013-09-04 15:44:48 +00:00
Richard Barry
aaf2d32011 Add XMC4200 and XMC4400 build configurations to the XMC4000 Dave project. 2013-09-04 14:22:45 +00:00
Richard Barry
6acac72ff1 Add Dave project for the XMC4500. 2013-09-04 10:43:31 +00:00
Richard Barry
d1d925ab36 Update the Keil XMC4500 demo project to include build configurations for the XMC4200 and XMC4400 application boards. 2013-09-03 15:26:05 +00:00
Richard Barry
18c4f8e622 Make the QueueSet.c standard demo task a little friendlier to lower priority tasks.
Allow the priority of the controlling task in the recmutex.c standard demo tasks to be overridden by a setting in FreeRTOSConfig.h.
2013-09-02 16:37:56 +00:00
Richard Barry
a8c2c6b3b6 Add a build configuration for the XMC1100 boot kit. 2013-09-02 16:35:54 +00:00
Richard Barry
05e0c59da8 Update RX600/Renesas compiler build configurations to use the latest compiler version. 2013-09-02 16:06:07 +00:00
Richard Barry
316b731fe9 Update RX600 blinky build configuration to include missing linker section. 2013-09-02 15:50:44 +00:00
Richard Barry
b79d3de952 Continue work on XMC1000 demos. 2013-09-01 20:06:31 +00:00
Richard Barry
73606369c4 Make Cortex-M0 set/clear interrupt flag from ISR functions nestable.
Don't reset the stack location when starting the scheduler in Cortex-M0 ports as the vector offset register is not implemented and XMC1000 devices have their application vector address somewhere other than 0x00.
2013-09-01 19:53:24 +00:00
Richard Barry
ed399e801e Add additional configASSERTS() to some standard demo tasks.
Use own rand() function in QueueSet.c to prevent library versions being referenced.
2013-09-01 19:45:06 +00:00
Richard Barry
33bd63e287 Rename CORTEX_M)_Infineion_Boot_Kits_IAR_Keil to CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC as it now contains projects for all three compilers. 2013-08-31 16:03:11 +00:00
Richard Barry
245ff12be8 Add a GCC project to the the XMC1000 demo directory. 2013-08-31 15:57:31 +00:00
Richard Barry
f9e024d7ea Move files common to IAR and Keil projects from compiler specific directories under the XMC demo directory into the XMC demo directory itself. 2013-08-31 14:36:32 +00:00
Richard Barry
9ad0c17281 Continue work on Get clock settings in Keil and IAR XMC1000 demo working. 2013-08-31 12:43:52 +00:00
Richard Barry
710a652daf Continue work on XCM1200 Keil demo. 2013-08-30 18:05:16 +00:00
Richard Barry
f0a2688200 Create full Keil project for XMC boot kit (not yet tested). 2013-08-25 17:07:56 +00:00
Richard Barry
3fe6974bf9 Starting point for XMC1000 Keil demo. 2013-08-25 01:03:56 +00:00
Richard Barry
574f5044a6 Starting point for Keil Cortex-M0 port. 2013-08-25 01:01:18 +00:00
Richard Barry
747a0e15fa Convert double quotes in a command help string to single quotes to allow the string to be processed by Javascript. 2013-08-16 13:34:28 +00:00
Richard Barry
c40370e96a Fix a few typos and remove the "register" keyword. 2013-08-16 13:31:54 +00:00
Richard Barry
63e8044d33 Allow compilation when portALT_GET_RUN_TIME_COUNTER_VALUE() is defined. 2013-08-14 08:35:40 +00:00
Richard Barry
dac40d1677 Update version numbers. 2013-07-24 10:02:19 +00:00
Richard Barry
2f754d9b0c Add additional critical section to the default tickless implementations.
Update version number for maintenance release.
2013-07-24 09:45:17 +00:00
Richard Barry
3cbe0a724d Update version number. 2013-07-23 10:51:45 +00:00
Richard Barry
8ceb665994 Void a few unused return values and make casting more C++ friendly. 2013-07-23 09:53:24 +00:00
Richard Barry
bb2093cf5d Update the header file included in the PIC32 port_asm.S file to use the header for the latest compiler version. 2013-07-23 09:50:06 +00:00
Richard Barry
679a3c670c Update the Cortex-M vPortValidateInterruptPriority() implementation to ensure compatibility with the STM32 standard peripheral library. 2013-07-23 09:44:00 +00:00
Richard Barry
f522d6a2da Remove duplicate definition from FreeRTOSConfig.h. 2013-07-23 09:36:30 +00:00
Richard Barry
9054485f1a Tidy up pre-processor as final act before tagging as V7.5.0 2013-07-19 10:22:47 +00:00
Richard Barry
08057fa77f Changes to comments only. 2013-07-19 09:16:36 +00:00
Richard Barry
203ae64600 Rename xTaskGetSystemState() uxTaskGetSystemState(). 2013-07-18 14:41:15 +00:00
Richard Barry
92fae7d262 For consistency change the name of configINCLUDE_STATS_FORMATTING_FUNCTIONS to configUSE_STATS_FORMATTING_FUNCTIONS. 2013-07-18 11:40:32 +00:00
Richard Barry
7d6758ee1a Minor updates and change version number for V7.5.0 release. 2013-07-17 18:32:57 +00:00
Richard Barry
d04c2fa753 Correct compiler warnings in trace recorder code. 2013-07-16 12:23:25 +00:00
Richard Barry
4578154959 Remove large and unnecessary .docx files. 2013-07-16 12:01:11 +00:00
Richard Barry
0fd81d6d8e Update FreeRTOS+Trace recorder code. 2013-07-16 11:55:14 +00:00
Richard Barry
7d1292ced2 Linting and MISRA checking 2013-07-15 14:27:15 +00:00
Richard Barry
e83b93f5fc Tidy up comments only. 2013-07-14 13:09:18 +00:00
Richard Barry
ce9c3b7413 Variable name change in the PIC32 port layer only. 2013-07-14 13:06:17 +00:00
Richard Barry
14a190e79e Update PIC32 serial.c slightly to add volatile qualifier and update to coding standard. 2013-07-14 08:46:15 +00:00
Richard Barry
1e17924fa8 Update doxygen comments. 2013-07-13 19:58:42 +00:00
Richard Barry
a6db135add Fix compiler warning. 2013-07-13 19:39:07 +00:00
Richard Barry
da0fff63c9 Update Cortex-M MPU version to include new API functions. 2013-07-13 19:37:35 +00:00
Richard Barry
e5d9640863 Update RX ports to only include additional check on the existing IPL (so it is not lowered) if configASSERT() is defined. 2013-07-13 11:31:35 +00:00
Richard Barry
4b964814de Implement portASSERT_IF_INTERRUPT_PRIORITY_INVALID() for PIC32. 2013-07-12 19:25:21 +00:00
Richard Barry
25310a6796 Update compiler version and add configASSERT() to PIC32 MPLAB X project. 2013-07-12 19:21:10 +00:00
Richard Barry
ad8fa53043 Kernel optimisations. 2013-07-12 11:11:19 +00:00
Richard Barry
c9d9bddc3c Add comments to the portASSERT_IF_INTERRUPT_PRIORITY_INVALID() calls in the core queue.c and tasks.c files. 2013-07-11 10:52:43 +00:00
Richard Barry
5d902f2b9c Complete additions of portASSERT_IF_INTERRUPT_PRIORITY_INVALID() for all RX compiler ports. 2013-07-11 10:05:06 +00:00
Richard Barry
18caebf1d1 Remove commented out code. 2013-07-10 13:26:00 +00:00
Richard Barry
65704174c9 Add portASSERT_IF_INTERRUPT_PRIORITY_INVALID() implementation to the RX ports that use the Renesas compiler.
Add portASSERT_IF_INTERRUPT_PRIORITY_INVALID() implementation to the Cortex-A9 ports.
2013-07-09 17:57:59 +00:00
Richard Barry
0f6b0d3a59 Enhance heap_4.c to prevent blocks accidentally being freed twice, or blocks that don't have a valid block link descriptor being freed.
Update the Cortex-A9 port to include asserts if an ISR safe FreeRTOS function is called from an interrupt that has a higher logical priority than configMAX_SYSCALL_INTERRUPT_PRIORITY (or whatever the CA9 equivalent is called), and also assert if the binary point is not set correctly.
2013-07-09 12:49:49 +00:00
Richard Barry
4894955a08 Correct comment only. 2013-07-04 16:05:27 +00:00
Richard Barry
c4eef61d39 Added portASSERT_IF_INTERRUPT_PRIORITY_INVALID() implementation to Cortex-M3 and Cortex-M4F ports. 2013-07-04 11:20:28 +00:00
Richard Barry
b521d70e7e Remove compiler warnings. 2013-07-02 12:39:16 +00:00
Richard Barry
019c6417d7 Remove compiler warnings. 2013-07-02 12:36:24 +00:00
Richard Barry
5ad3b59783 Add the new configINCLUDE_STATS_FORMATTING_FUNCTIONS configuration parameter to FreeRTOS+ demo applications that make use of vTaskStats() or vTaskGetRunTimeStats(). 2013-07-02 12:17:26 +00:00
Richard Barry
2c242cdf78 Add the new configINCLUDE_STATS_FORMATTING_FUNCTIONS configuration parameter to FreeRTOS demo application that make use of vTaskStats() or vTaskGetRunTimeStats(). 2013-07-02 12:14:49 +00:00
Richard Barry
c1b4fc58d2 Add new xTaskGetSystemState() API function to return raw data on each task in the system.
Relegate the vTaskList() and vTaskGetRunTimeStats() functions to "sample" functions demonstrating how to use xTaskGetSystemState() to generate human readable status information.
Introduce and default configINCLUDE_STATS_FORMATTING_FUNCTIONS which must now be defined to use vTaskList() and vTaskGetRunTimeStats().
2013-07-02 12:10:16 +00:00
Richard Barry
877ce218a4 Add additional comment only. 2013-07-01 09:05:15 +00:00
Richard Barry
625b1a7159 Add the queue overwrite demo to the RZ demo. 2013-07-01 08:49:20 +00:00
Richard Barry
0c0b54c175 Refine the default tickless idle implementation in the Cortex-M3 port layers. 2013-06-30 10:38:31 +00:00
Richard Barry
08ca5dead5 Update Win32 MSVC demo to include a simple blinky build option. The demo as it was is now the "full/comprehensive" build option. 2013-06-28 10:46:29 +00:00
Richard Barry
b8a219b30c Update QueueOverwrite.c to include a call to xQueuePeekFromISR().
Default new QueuePeekFromISR() trace macros.
2013-06-28 09:21:39 +00:00
Richard Barry
3b02b4c8f8 Add xQueueOverwriteFromISR() and update the QueueOverwrite.c to demonstrate its use. 2013-06-27 14:25:17 +00:00
Richard Barry
671949ad78 Add xQueueOverwrite() and a common demo task to demonstrate its use.
Update MSVC Win32 demo to include the xQueueOverwrite() common demo tasks.
2013-06-27 09:21:43 +00:00
Richard Barry
59f75a12f6 Add Newlib reent support. 2013-06-26 11:37:08 +00:00
Richard Barry
4444b4ee68 Improve efficiency and behaviour of vListInsertEnd(). 2013-06-26 08:58:01 +00:00
Richard Barry
f11635ed91 Remove reliance on strncpy() function. 2013-06-25 14:03:02 +00:00
Richard Barry
a7c47131fa Remove portALIGNMENT_ASSERT_pxCurrentTCB() macro, which serves no purpose. 2013-06-25 13:39:50 +00:00
Richard Barry
6cbbfd2eb5 Slight correction to coding standard in heap_2.c and heap_4.c. 2013-06-25 13:25:08 +00:00
Richard Barry
fb47260e80 Improve efficiency of memory allocation when the memory block is already aligned correctly. 2013-06-25 12:20:29 +00:00
Richard Barry
87049ac37c Re-implement the LPC18xx and SmartFusion2 run time stats implementation to use the free running Cortex-M cycle counter in place of the systick.
Correct the run-time stats counter implementation in the RZ demo.
Guard against run time counters going backwards in tasks.c.
2013-06-25 10:44:44 +00:00
Richard Barry
cdae14a8cb Replace the #define that maps the uxRecursiveCallCount to the pcReadFrom pointer with a union - although this is against the coding standard it seemed the best way of ensuring complete adherence to the C standard and allow correct builds with LLVM when the optimiser is on. 2013-06-24 12:20:00 +00:00
Richard Barry
00136d4b51 Update trace recorder code in the LPC18xx project. 2013-06-23 21:11:37 +00:00
Richard Barry
d8248c49fc Remove old trace recorder source from LPC18xx project. 2013-06-23 20:38:17 +00:00
Richard Barry
0ca2110982 Split the LPC18xx FreeRTOS+UDP drivers between those that use the LPCOpen library and those that use the older CMSIS library. 2013-06-23 20:33:43 +00:00
Richard Barry
a1145a1b78 Remove DemoIPTrace.h from LPC18xx demo as it should be copied from is standard location. 2013-06-23 19:00:14 +00:00
Richard Barry
34e7cfc2a2 Back out changes to LPC18xx UDP demo. 2013-06-23 08:00:39 +00:00
Richard Barry
e6903dac61 Add extra debug comment into list.c. 2013-06-23 07:27:46 +00:00
Richard Barry
1cfb7b77e5 Add retarget.c to RVDS project to ensure semihosting is not used. 2013-06-20 14:59:11 +00:00
Richard Barry
3a507bdc0c Add missing function prototype. 2013-06-20 14:57:44 +00:00
Richard Barry
c3f9e3c5ff Update RVDS port layer to match IAR port layer. 2013-06-20 14:56:40 +00:00
Richard Barry
018f0f602a RZ RVDS and IAR projects. 2013-06-20 12:49:53 +00:00
Richard Barry
5013baa2cd RVDS ARM Cortex-A port layer. 2013-06-20 12:47:21 +00:00
Richard Barry
04dafed839 IAR ARM Cortex-A port layer. 2013-06-20 12:20:40 +00:00
Richard Barry
2fd431e971 Modify the GCC/AVR port to make use of the xTaskIncrementTick return value.
Add pre-processor directives in the dsPIC and PIC24 port layers that allows both port files to be included in the same project.
2013-06-11 20:15:15 +00:00
Richard Barry
3aad6381e1 Update RX100 project to e2studio V2 format. 2013-06-11 20:11:29 +00:00
Richard Barry
f038fd6a86 Improve the error detection in some of the standard demo tasks. 2013-06-11 18:46:00 +00:00
Richard Barry
3b004f9900 Add the APPLICATION_DEFINED port type to the trcHardwarePort.h template. 2013-06-11 16:11:21 +00:00
Richard Barry
62c0ae0926 Update port layers to make better use of the xTaskIncrementTick() return value. 2013-06-08 18:36:25 +00:00
Richard Barry
c75c01ffdf Check in implementation of xTaskIncrementTick (replaced vTaskIncrementTick()). 2013-06-08 18:30:52 +00:00
Richard Barry
c9b30b9fe7 Add MPLAB X project for PIC24.
Remove PIC24 demo warnings when XC16 is used as the compiler.
2013-06-08 18:19:50 +00:00
Richard Barry
2089f31f18 Update include paths in Rowley MSP430 project file. 2013-06-07 19:24:10 +00:00
Richard Barry
a1ef5d6fa9 Add UV4 project to old RVDS LPC2129 UV2 directory. 2013-06-07 15:23:34 +00:00
Richard Barry
59a834eb86 Update ports that have their tick configuration in an application callback to use xTaskIncrementTick() in place of vTaskIncrementTick(). 2013-06-07 12:39:56 +00:00
Richard Barry
c04b074707 Convert the remaining ports to use xTaskIncrementTick() in place of vTaskIncremenTick(). 2013-06-07 12:16:58 +00:00
Richard Barry
2fc9d033c6 Update the PIC32 port to use xTaskIncrementTick() and change the macro used to detect if XC is being used. 2013-06-07 11:15:43 +00:00
Richard Barry
51d9ee0c1c Add configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS mechanism to the relevant port.c file to allow the user to define functions that will execute in privileged mode. 2013-06-07 09:45:34 +00:00
Richard Barry
29ca4f1b36 Ensure queue functions go into the privileged code section when the MPU version is in use.
Provide a default value for configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS.
Revert prvQueueUnregisterQueue() back to a public function.
2013-06-07 09:41:15 +00:00
Richard Barry
0f3ae55e5d Add configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS mechanism to allow the user to define functions that will execute in privileged mode.
Update the Rowley MPU demo to use a version of debug_printf that runs in privileged mode to get around the problem of the RAM it uses not being under the control of the kernel.
2013-06-07 09:37:18 +00:00
Richard Barry
f904d26957 Convert more ports to use xTaskIncrementTick() in place of vTaskIncrementTick(). 2013-06-06 16:31:15 +00:00
Richard Barry
15ec6c87f7 Convert mpre ports to use xTaskIncrementTick() in place of vTaskIncrementTick(). 2013-06-06 16:06:48 +00:00
Richard Barry
686d190798 Convert some ports to use xTaskIncrementTick() in place of vTaskIncrementTick().
Move DSB instructions to before WFI instructions in line with ARM recommendations.
2013-06-06 15:46:40 +00:00
Richard Barry
4e9374ad90 Add default value for configUSE_TIME_SLICING 2013-06-06 14:56:47 +00:00
Richard Barry
06953169ba Update RM48/TMS570 port to use xTaskIncrementTick in place of vTaskIncrementTick. 2013-06-06 13:06:24 +00:00
Richard Barry
0673f63e8d Ensure RM48 demo compiles in co-operative mode. 2013-06-06 12:54:00 +00:00
Richard Barry
66734268f5 Update SAM4L_low_power_tick_management.c to use xTaskIncrementTick() in place of vTaskIncrementTick(). 2013-06-06 11:26:15 +00:00
Richard Barry
2e5d812022 Tidy up the comments and use of static function prototypes in the SAM4L_low_power_tick_management.c implementation. 2013-06-06 11:19:32 +00:00
Richard Barry
3fbee4f0a8 Place DSB instruction before WFI instruction in EFMG890F128 demo. 2013-06-06 11:15:08 +00:00
Richard Barry
64bd0689c7 Update the standard Win32 demo to use the latest version of the trace recorder code. 2013-06-05 16:26:04 +00:00
Richard Barry
6330e06975 Remove compiler warnings from the trace recorder code. 2013-06-05 15:25:26 +00:00
Richard Barry
6438027bb9 Update the FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator demo to use the latest version of the trace recorder code. 2013-06-05 15:24:12 +00:00
Richard Barry
f928b0e296 Update to latest FreeRTOS+Trace recorder code. 2013-06-05 13:38:56 +00:00
Richard Barry
f9d0a153b4 Update the FreeRTOS+UDP LPC18xx MAC driver to use the LPCOpen drivers. 2013-06-03 20:27:46 +00:00
Richard Barry
54c62d429f Update LPC18xx FreeRTOS+UDP demo to use LPCOpen USB and Ethernet drivers.
Update LPC18xx FreeRTOS+UDP eclipse project to use linked resources rather than a CreateProjectDirectoryStructure.bat batch file.
2013-06-03 20:21:38 +00:00
Richard Barry
0158039f99 Slight modification to license blub text in header comments. 2013-05-21 14:14:03 +00:00
Richard Barry
fda145278e Remove the Chan FATfs code as FreeRTOS now ships with a proprietary file system. 2013-05-19 10:36:04 +00:00
Richard Barry
2c562bd3d7 Ensure a queue or semaphore that is not empty cannot be added to a queue set. 2013-05-19 10:11:10 +00:00
Richard Barry
bb7b711ca9 Update the code that generates the run time stats strings so the pcStatsString[] array is not required. 2013-05-19 09:56:47 +00:00
Richard Barry
a03b171992 Fix compiler warning in psp_test.c when compiled with ARM compiler.
Add portYIELD_FROM_ISR() macros to Cortex-M ports.  The new macro just calls the exiting portEND_SWITCHING_ISR() macro.
Remove code from the MSVC port layer that was left over from a previous implementation and become obsolete.
2013-05-19 09:43:00 +00:00
Richard Barry
9b153b3e06 Ensure the SmartFusion2 interrupt driven UART drivers are not passed a zero length buffer. 2013-05-14 13:22:37 +00:00
Richard Barry
94f178c8d1 Move SmartFusion configuration options into FreeRTOSConfig.h. 2013-05-13 10:51:31 +00:00
Richard Barry
5c5c1c406d Rename the SmartFusion2 demo directory. 2013-05-13 09:26:39 +00:00
Richard Barry
961928b0f9 Combine the SmartFusion2 starter kit and development kits demos into a single directory. 2013-05-13 09:06:50 +00:00
Richard Barry
82995fd4fd Update SmartFustion2 starter kit partest.c. 2013-05-12 20:24:42 +00:00
Richard Barry
4d966adc8b Add SmartFusion2 demo for the SmartFustion2 development kit. 2013-05-12 20:07:49 +00:00
Richard Barry
063c05ccad Convert SmartFusion2 CLI to use the interrupt UART driver functions instead of the polled UART driver functions. 2013-05-12 13:02:16 +00:00
Richard Barry
5ff880fee8 SmartFusion2 CLI working with polled UART, about to convert to interrupt driven UART. 2013-05-10 18:47:43 +00:00
Richard Barry
8732e8efc5 Minor cosmetics to comments. 2013-05-09 10:15:52 +00:00
Richard Barry
fb9662009a Update comments in Atmel Studio CreateProjectDirectoryStructure.bat files to remove references to replace references to Eclipse with references to Atmel Studio.
Update the tickless idle implementations that use up counters for tick interrupt generate to ensure they remain in low power mode for the desired time instead of one tick less than the desired time.
2013-05-09 09:56:04 +00:00
Richard Barry
e08966c7e8 Update flop.c and FreeRTOS.h to include a macro (and a default null implementation of the macro) that enables the flop tasks to register their need for a floating point context with the kernel. 2013-05-09 09:52:34 +00:00
Richard Barry
b4efc0439f Update Win32 simulator so it references the FreeRTOS+Trace code from the updated FreeRTOS+ directory structure. 2013-05-09 09:50:40 +00:00
Richard Barry
410f5d45eb SmartFusion2: Change linker file to run from NVM. Add in FreeRTOS+CLI and FreeRTOS+FAT SL demo. 2013-05-07 08:46:24 +00:00
Richard Barry
e3a868ca58 Blinky and full demos working on SmartFusion2. 2013-05-06 09:18:00 +00:00
Richard Barry
b8d265f57f Starting point for SmartFustion2 starter kit demo. 2013-05-05 13:33:55 +00:00
Richard Barry
39147e83a0 Update version numbers in a couple of files that got left behind. 2013-05-01 09:19:09 +00:00
Richard Barry
96ceae8edd Update version number ready to release the FAT file system demo. 2013-04-30 21:42:41 +00:00
Richard Barry
a4a830c44d Add FAT SL code and demo project. 2013-04-30 20:37:52 +00:00
Richard Barry
bbe48d31a4 Clarify license blurb at the top of the FreeRTOS+UDP and FreeRTOS+CLI source files. 2013-04-30 20:23:06 +00:00
Richard Barry
fbadf8bee7 Add quick start guide. 2013-04-30 19:37:00 +00:00
Richard Barry
f9918345e1 Update version numbers to V7.4.1. 2013-04-18 12:58:17 +00:00
Richard Barry
c60973c34a Change version number in common files within the FreeRTOS-plus directory and check all demos still execute. 2013-04-18 10:08:04 +00:00
Richard Barry
64a3ab321a Add FreeRTOS-Plus directory with new directory structure so it matches the FreeRTOS directory. 2013-04-18 09:17:05 +00:00
Richard Barry
80f7e8cdd4 Remove subdirectories of FreeRTOS-Plus in preparation for changing the directory structure to match the FreeRTOS directory. 2013-04-18 08:39:10 +00:00
Richard Barry
2bd7d0c1f5 Commit 3 RX100 low power demos. 2013-04-17 10:04:38 +00:00
Richard Barry
2b41be4cb9 Update yield code in RX200/Renesas compiler port. 2013-04-17 08:55:16 +00:00
Richard Barry
352949af42 Update RX600 IAR RX62N demo to use latest IAR tools. 2013-04-17 08:47:27 +00:00
Richard Barry
0013028c7a Update yield code in RX600/IAR compiler port. 2013-04-17 08:46:10 +00:00
Richard Barry
4f5f527c73 Update yield code in RX600/Renesas compiler port. 2013-04-17 08:35:20 +00:00
Richard Barry
b7487b8dc2 Update yield code in RX600/GCC port. 2013-04-17 08:23:02 +00:00
Richard Barry
a69933782d Add RX100 Renesas compiler port layer. 2013-04-16 15:59:21 +00:00
Richard Barry
74290b4425 Add RX100 IAR port layer. 2013-04-16 15:58:46 +00:00
Richard Barry
a0056e8fd3 Add RX100 GCC port layer. 2013-04-16 15:58:14 +00:00
Richard Barry
9a15f50b00 Add memory barrier instructions to Tasking CM4F port. 2013-04-16 15:50:17 +00:00
Richard Barry
7132e88685 Add memory barrier instructions to the RVDS CM3 ports. 2013-04-16 15:30:43 +00:00
Richard Barry
895ee2bb3e Add barrier instructions to IAR CM3 ports. 2013-04-16 14:56:49 +00:00
Richard Barry
be7cae575d Ensure XMC demo builds with the latest IAR version. 2013-04-16 14:51:33 +00:00
Richard Barry
d135e45676 Replace the read back of the software interrupt register with barrier instructions (CCS/RM48/TMS570). 2013-04-16 14:17:35 +00:00
Richard Barry
0527099b51 Add barrier instructions to the GCC CM3 ports. 2013-04-16 14:16:30 +00:00
Richard Barry
67cc013ac3 Remove duplicate #error informing people to run the CreateProjectDirectoryStructure.bat. 2013-04-16 12:49:23 +00:00
Richard Barry
af023e8bf1 Remove infinite loop from task delete function. 2013-04-16 10:25:33 +00:00
Richard Barry
01202246da Add volatile keyword to GenQTest loop counter for consistency.
Remove obsolete definition from SAM4L demo.
2013-04-14 19:07:32 +00:00
Richard Barry
6d20e2b5cd Add barrier instructions to GCC CM3/4 code. 2013-04-07 19:43:52 +00:00
Richard Barry
a7fb62cb9c Prepare to package up SAM4L demo. 2013-04-07 19:41:45 +00:00
Richard Barry
af623460a6 Updated the sleep function to ensure it left interrupts disabled when returning. 2013-04-07 19:30:25 +00:00
Richard Barry
2cf9f1ac8c Add SAM4L demo. 2013-04-07 18:49:53 +00:00
Richard Barry
3762630f27 RL78/IAR port - Allow the end user to define their own tick interrupt configuration by defining configSETUP_TIMER_INTERRUPT(). 2013-03-25 17:00:13 +00:00
Richard Barry
a9b8f0ca69 Minor mods common files to fix warnings generated by Renesas compiler.
Correct the header comments in het.c and het.h (RM48/TMS570 demo) which were corrupt.
Correct version numbers in RX63N Renesas compiler demo.
Ensure stacks set up for tasks in the RX200 port layer end on 8 byte boundaries (was 4, which didn't matter but didn't match the definition).
Replaced unqualified (unsigned) in calls to standard functions with (size_t).
2013-03-25 16:30:42 +00:00
Richard Barry
236683d74d Update the GCC RL78 demo to include four separate build configurations, each of which targets different hardware. 2013-03-19 12:24:05 +00:00
Richard Barry
3a1a500950 Rename the Demo/RL78_RL78G13_Promot_Board_IAR directory to RL78_Multiple_IAR as it now targets several different devices. 2013-03-18 16:51:43 +00:00
Richard Barry
c08a0558c8 Add two additional targets to the RL78 IAR project. 2013-03-18 16:43:21 +00:00
Richard Barry
caf1fbc899 Ensure IAR RL port layer works on devices using two different naming conventions for the interval timer registers. 2013-03-18 16:40:47 +00:00
Richard Barry
8c66fdbb8c Updated IAR RL78 port layer. 2013-03-17 16:54:17 +00:00
Richard Barry
b78fa80fbe Update the IAR RL78 demo to include main_blinky.c and main_full.c. 2013-03-17 16:52:39 +00:00
Richard Barry
7fb22e27da Add an example ISR implementation into the RL78 GCC demo. 2013-03-17 15:38:23 +00:00
Richard Barry
c79a5fe50c Complete RL78/G14 demo. 2013-03-17 12:12:20 +00:00
Richard Barry
3b1ff85222 RL78 GCC: Save and restore all register banks. 2013-03-17 09:27:18 +00:00
Richard Barry
3b9d0819c9 RL78/GCC related:
+ Add RL78G14 specific linker script.
+ Move the call to the function that sets up the clocks to before the code that sets up the .data and .bss sections.
2013-03-06 10:56:03 +00:00
Richard Barry
08b959f143 For RL78GCC port/demo:
- Added YRDKRL78G14 build configuration.
- Runs provided the dynamic priority tasks are not started.
- Does not run with the debugger connected.
2013-03-04 20:04:02 +00:00
Richard Barry
fba04057ec All related to RL78 GCC demos (which are still a work in progress):
- Abstract out the IO port handling for the LED output so the same code can be used on multiple eval boards.
- Add in the RESTORE_CONTEXT macros.
- Swap to use heap_1.c instead of heap_4.c.
- Add data model macros to FreeRTOSConfig.h (may be removed if only one data model is supported by the compiler).
- Install interrupt handlers.
2013-03-04 13:23:48 +00:00
Richard Barry
37d302b8ee Abstract the IO port handling to toggle the LED into LED.h so the same code can work with multiple eval boards. 2013-03-04 13:18:19 +00:00
Richard Barry
83fa827935 Add RL78 E2Studio project. Code is building, but has not yet been executed. 2013-03-02 15:50:02 +00:00
Richard Barry
17bba16fa6 Added YRDKRL78G14 build configuration to the IAR RL78 demo. 2013-02-24 19:48:26 +00:00
Richard Barry
a5d0e3f0c1 Prepare for V7.4.0 release. 2013-02-19 18:36:58 +00:00
Richard Barry
902f9e1a58 Update PIC32 demo application to remove reliance on PLIB functions.
Update the default low power implementation in all the Cortex-M port layers to add a small critical section.
2013-02-18 16:41:11 +00:00
Richard Barry
c519ba094d Correct spelling of xSuspendedTaskList in eTaskConfirmSleepModeStatus(). 2013-02-18 11:28:56 +00:00
Richard Barry
dcc90bb6d9 Add default definition for configUSE_QUEUE_SETS.
Add eTaskConfirmSleepModeStatus() (not yet tested).
Only call prvQueueUnregisterQueue() when a queue or semaphore is deleted if configQUEUE_REGISTRY_SIZE > 0.
Back out change that checks the configUSE_PORT_OPTMISED_TASK_SELECTION value before uxPriorityUsedOnEntry is set in vTaskPrioritySet as it generated more warnings (with other compilers) than it fixed.
2013-02-18 11:20:29 +00:00
Richard Barry
2b835ccb48 Commit demos that have been updated for testing purposes before they are updated once more to test new low power features. 2013-02-18 11:15:35 +00:00
Richard Barry
b85c071a79 Update the LPC1768 project to only copy across one heap_x.c file as the addition of heap_4.c without it being excluded from the project was breaking the build. 2013-02-13 12:03:13 +00:00
Richard Barry
a7eae6bed3 Added more files to the Rowley and IAR LM3S demos to test building the newer files and queue sets.
Made queue function prototypes consistent so xQueueHandle parameters are always xQueue, and xQUEUE * parameters pxQueue.
Likewise make the task API using px for pointers to TCBs, and just x for task handles.
Heap_x functions now automatically align the start of the heap without using the portDOUBLE union member.
Queue.c now includes queue.h.
2013-02-12 17:35:43 +00:00
Richard Barry
9b26071eb8 Adjusted the wrap checks in the QueueSet test task.
Added the QueueSet test to the Rowlay Stellaris and SAM4S-EK Studio demos.
Updated the MSVC demo to use heap_4.c.
2013-02-12 14:30:12 +00:00
Richard Barry
0262f4a6cd Reduce RAM used by trace by updating trcConfig.h. 2013-02-12 10:59:58 +00:00
Richard Barry
b671bf368a Improve QueueSet.c test coverage by reading the queue set from an ISR to force paths through the queue locking and unlocking.
Add the FreeRTOS+Trace recorder into the Win32 MSVC demo.
Added more functions, including the queue set functions, to the MPU port.
2013-02-12 10:09:36 +00:00
Richard Barry
26152204a4 Update the FreeRTOS+Trace recorder and Win32 demo app. 2013-02-10 19:33:28 +00:00
Richard Barry
96218c34a1 Fix a few compiler warnings when compiling the QueueSet.c test code with GCC. 2013-02-08 17:05:42 +00:00
Richard Barry
d328ae3bfc Add the queue set test to the SAM4S-EK Atmel Studio code. 2013-02-08 16:10:13 +00:00
Richard Barry
232a5b3433 Continue working on queue set implementation and testing. 2013-02-08 15:50:14 +00:00
Richard Barry
4e5090e061 Next revision of queue set implementation.
Make conditional compilation syntax and commenting consistent.
Add common demo tasks to demonstrate queue sets.
2013-02-07 15:10:25 +00:00
Richard Barry
b5b518571e remove the additional line added to the MPU port.c as the original code was correct. Instead remove the alignment assert by adding #define portALIGNMENT_ASSERT_pxCurrentTCB ( void )
to the portmacor.h file.
2013-01-31 15:27:00 +00:00
Richard Barry
ac78adae4b Added INCLUDE_xSemaphoreGetMutexHolder() default.
Changed eTaskStateGet() to eTaskGetState() and added #define to ensure backward compatibility.
Added configEXPECTED_IDLE_TIME_BEFORE_SLEEP definition - was previously hard coded to 2.
Slight change to the default CM3 tickless sleep function to allow the idle time to be set to zero in the pre-sleep processing macro.
Changed stack alignment for the FreeRTOS-MPU port to ensure it didn't trigger the assert() in the generic create function.
2013-01-31 14:18:03 +00:00
Richard Barry
4e7b460eaf Replace the CLZ function with a CLZ intrinsic in the Cortex-R4 port layer.
Add EDS support in the PIC24 port layer.
Remove unnecessary EHB instructions from PIC32 port.
In the PIC32 port assembly code, replace the &= code with a single ins instruction.
2013-01-23 16:06:45 +00:00
Richard Barry
b5cf299df1 Make changes necessary to allow the latest StateViewer Eclipse plug-in obtain the run time stats information. 2012-12-31 11:09:14 +00:00
Richard Barry
2e24f1b789 Move the call that sets xTimeNow inside the loop that drains the timer queue to ensure higher priority tasks that pre-empt the timer daemon cannot post messages that appear to be in the future to the daemon task. 2012-11-18 09:13:39 +00:00
Richard Barry
0d421482d8 Default configUSE_TICKLESS_IDLE to 0 when it is not defined.
Move location of traceTASK_CREATE() macro call.
Remove obsolete handling of trmCOMMAND_PROCESS_TIMER_OVERFLOW as the command was never used in release versions.
2012-11-17 19:23:30 +00:00
Richard Barry
c4d078c29a Ensure #error messages in FreeRTOSConfig.h files are not commented out. 2012-10-31 13:46:17 +00:00
Richard Barry
96f93690ce Add warning suppression to IAR header. 2012-10-31 13:30:44 +00:00
Richard Barry
5512102f92 Slow configured clock in the RM48 and TMS570 demos to 50MHz. 2012-10-31 10:31:33 +00:00
Richard Barry
0023cb1f8e Make loop counters in flop_hercules.c 32-bit instead of 16-bit. 2012-10-30 14:56:21 +00:00
Richard Barry
01bca41038 Rename CORTEX_R4_RM48_CCS5 directory as it also includes the TMS570 code. 2012-10-29 16:18:20 +00:00
Richard Barry
2a47ddd1f5 Correct cut and paste error in partest.c file. 2012-10-29 16:17:05 +00:00
Richard Barry
ba686260ca Make CM3/4 tick configuration a weak function to allow application writers to use an alternative tick source. 2012-10-29 15:56:26 +00:00
Richard Barry
5e7c99d2aa Allow IAR language extensions so __weak attribute can be used. 2012-10-29 13:57:07 +00:00
Richard Barry
9fe5156b53 Work around compiler bug in CCS5 by replacing the _call_swi() function with a #pragma SWI_ALIAS. 2012-10-29 11:38:19 +00:00
Richard Barry
7fa0d887e8 Complete RM4x and TMS570 demo. 2012-10-29 11:34:41 +00:00
Richard Barry
f5c52bdb1d Re-jig some of the new functions to correctly assign them public or private linkage, and remove some functions that were added in but never used. 2012-10-22 16:40:45 +00:00
Richard Barry
f06a945444 Prepare for V7.3.0 release. 2012-10-16 12:17:47 +00:00
Richard Barry
f446f77fd4 Make the timer used for the PIC32 port layer user configurable. 2012-10-16 09:48:45 +00:00
Richard Barry
dbe0ae2bff Add tickless idle support in Cortex-M ports.
Change CCS R4 directory name.
2012-10-16 07:56:55 +00:00
Richard Barry
e03ab659f3 Add tickless idle support in Cortex-M ports.
Change CCS R4 directory name.
2012-10-16 07:55:40 +00:00
Richard Barry
6ec4c7cecb Set the RM48 directory structure to match the FreeRTOS convention. 2012-10-14 21:33:53 +00:00
Richard Barry
4410dd363e Update FreeRTOS version used in RM48 demo. 2012-10-14 21:11:01 +00:00
Richard Barry
9ff79da901 First pass at adding R4F floating point support. 2012-10-13 16:21:40 +00:00
Richard Barry
fe2163ede4 RM48 port layer without FPU saving completed. 2012-10-11 13:41:07 +00:00
Richard Barry
1112439c58 Get main_full.c working in the RM48 demo. 2012-10-10 13:40:36 +00:00
Richard Barry
05c17e7e6d Remove whitespace only. 2012-10-10 09:53:44 +00:00
Richard Barry
ecdca1311b RM48 simply blinky demo working. 2012-10-09 13:04:17 +00:00
Richard Barry
57fab18305 Added initial RM48 project files. These are not in the correct directory structure yet. 2012-10-04 19:47:41 +00:00
Richard Barry
c403e974ee Update PIC32 port to make use of configUSE_PORT_OPTIMISED_TASK_SELECTION.
Make small modification in GCC CM3 port when configUSE_PORT_OPTIMISED_TASK_SELECTION is set to 1 to remove compiler warning.
2012-09-25 18:18:37 +00:00
Richard Barry
87f663a461 Correct #if( configMAX_PRIORITIES >= 32 ) check performed when configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 to instead be #if( configMAX_PRIORITIES > 32 ). 2012-09-24 12:10:08 +00:00
Richard Barry
42a11edef8 Replace the need for taskCHECK_READY_LIST() by instead making vListRemove() return the number of items that remain in the list once the list item has been removed. 2012-09-24 12:05:35 +00:00
Richard Barry
18a4b00a18 Rename listLIST_ITEM_CONTAINED to listLIST_ITEM_CONTAINER. 2012-09-24 11:23:14 +00:00
Richard Barry
92f1699055 Added Cortex-M optimised code to the IAR, GCC and Keil Cortex-M port layers.
Tested and updated a few Cortex-M projects to use configUSE_PORT_OPTIMISED_TASK_SELECTION set to 1.
2012-09-24 11:01:17 +00:00
Richard Barry
670d172cfc Introduced configUSE_PORT_OPTIMISED_TASK_SELECTION, and updated the MSVC simulator port as the first implementation. 2012-09-23 14:35:12 +00:00
Richard Barry
8ef7f03536 Add eTaskStateGet() to FreeRTOS-MPU. 2012-09-23 09:35:53 +00:00
Richard Barry
eb1f7bc166 Added eTaskStateGet().
Added default value for INCLUDE_eTaskStateGet.
2012-09-22 20:59:27 +00:00
Richard Barry
48a307ff5f Allow mutex type semaphores to be given from an interrupt (not a normal thing to do - use a binary semaphore!).
Allow FreeRTOS+CLI commands to have spaces at the end without it being taken as a parameter.
2012-09-05 14:02:16 +00:00
Richard Barry
c0de8c984c Improve command input string handling in FreeRTOS+CLI to allow allow commands to be sub-strings of each other, and not to count trailing white space as a parameter. 2012-08-31 13:10:20 +00:00
Richard Barry
bf12aba59d Add demo for SAM3S-EK2. 2012-08-29 15:02:56 +00:00
Richard Barry
340b2d7872 Save the SAM4S FreeRTOSConfig.h with the #error about running the CreateProjectDirectoryStructure.bat batch file in the correct state (uncommented). 2012-08-29 09:57:25 +00:00
Richard Barry
6396f6fe9f Add SAM3X-EK demo. 2012-08-15 20:38:50 +00:00
Richard Barry
0c7af1c2d3 Put comments in the code that give a reference to people who think that setting BASE_PRI to zero is the wrong thing to to in an ISR. 2012-08-14 13:04:22 +00:00
Richard Barry
e0bab5981a Prepare for V7.2.0 release. 2012-08-14 12:14:48 +00:00
Richard Barry
73ad4387e2 Remove the remnants of the legacy trace functionality (since replaced with FreeRTOS+Trace).
Replaced the #error that traps configMAX_SYSCALL_INTERRUPT_PRIORITY being set to 0 with a configASSERT() for GCC Cortex-M3/4 ports as the #error does not work if configMAX_SYSCALL_INTERRUPT_PRIORITY includes any casting.  Not a problem for other compilers as they cannot have casting anyway as that would break the assembly code.
2012-08-12 17:05:23 +00:00
Richard Barry
02acfd2723 Add warning in Cortex-M3 and Cortex-M4 FreeRTOSConfig.h header files that configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. 2012-08-12 16:49:43 +00:00
Richard Barry
7d937f04d7 Add CreateProjectDirectoryStructure.bat to the SAM4 demo. 2012-08-12 04:25:38 +00:00
Richard Barry
99a4783b55 Remove the files from the SAM4S demo that are copied using the CreateProjectDirectoryStructure.bat batch file. 2012-08-12 04:14:58 +00:00
Richard Barry
4dbef6afe9 Add readme files to the various FreeRTOS+ directories. 2012-08-11 22:57:53 +00:00
Richard Barry
f508a5f653 Add FreeRTOS-Plus directory. 2012-08-11 21:34:11 +00:00
Richard Barry
7bd5f21ad5 Start to re-arrange files to include FreeRTOS+ in main download. 2012-08-11 21:06:27 +00:00
Richard Barry
95db6bdce7 Remove test code from heap_4.c. 2012-08-11 20:59:14 +00:00
Richard Barry
054b018d0e Update MPS430X ports so the sleep mode bits are cleared on exit from the tick interrupt.
Update heap_4.c.
2012-08-11 20:57:11 +00:00
Richard Barry
59c9044de1 Add heap_4.c. 2012-08-10 18:45:45 +00:00
Richard Barry
2967657a85 Add vQueueDelete() to the MPU port.
Added volatile key word to the queue xRxLock and xTxLock members.
Ensure the portPRIVILEGED_BIT bit is set when the timer task is being created by the kernel - as it was for the idle task.  Necessary for MPU port.
2012-08-03 15:21:21 +00:00
Richard Barry
e1a83402d6 Renamed the CORTEX_M4_ATSAM4S_AVR_Studio directory to the correct CORTEX_M4_ATSAM4S_Atmel_Studio. 2012-07-08 15:58:54 +00:00
Richard Barry
271b22eccc Remove the unused linker reference to the maths library. 2012-07-08 15:52:01 +00:00
Richard Barry
02c347d45d Complete first release candidate for the SAM4S-EK demo. 2012-07-08 14:11:37 +00:00
Richard Barry
c8c7c80116 In the SAM4S demo, moved FreeRTOS into the ASF/thirdparty directory.
Changed some of the compiler warning configuration.
2012-07-05 09:41:37 +00:00
Richard Barry
d67b0311cb Change the name of the SAM4 FreeRTOS-Source directory to just FreeRTOS in preparation of moving it to the ASF/Thirdparty directory. 2012-07-05 08:35:36 +00:00
Richard Barry
932d8b318e Create project for SAM4S. This is building but has not yet been tested on hardware. 2012-07-03 13:49:34 +00:00
Richard Barry
db44ca0c56 Add in a couple of extra list macros for use with FreeRTOS+UDP.
Allow the ISR safe queue send and receive functions to set the higher priority task woken pointer to NULL.
2012-07-03 11:16:52 +00:00
Richard Barry
c8c4ab298c Add the macro xSemaphoreTakeFromISR().
Add #error strings if configMAX_SYSCALL_INTERRUPT_PRIORITY is set to 0.
Corrected the prototype of vApplicationStackOverflowHook().
Changed the dimensioning of the buffer declared in prvListTaskWithinSingleList() to make use of the configMAX_TASK_NAME_LEN setting.
2012-07-03 09:38:09 +00:00
Richard Barry
26dbc85c7c Added INCLUDE_xQueueGetMutexHolder macro.
Removed the "-rc1" that was accidentally left on the version number of some Win32 port files.
Changed the behaviour of xQueueGenericReset() so queues can be reset when tasks are blocked on them.
2012-05-17 08:22:27 +00:00
Richard Barry
38d09c99eb Prepare for FreeRTOS V7.1.1 tag. 2012-05-08 17:35:44 +00:00
Richard Barry
ac66c45eb4 Prepare for FreeRTOS V7.1.1 tag. 2012-05-08 16:50:26 +00:00
Richard Barry
9f0069690c Prepare for FreeRTOS V7.1.1 tag. 2012-05-08 16:36:52 +00:00
Richard Barry
c5c064b74e Update the RX63N RDK project to use the correct PHY ID. 2012-05-01 12:28:06 +00:00
Richard Barry
bbbdd9c393 Change the Win32 port layer so it doesn't use the traceTASK_DELETE macro, but instead the new portCLEAN_UP_TCB macro. 2012-04-24 13:09:22 +00:00
Richard Barry
8baa0ac171 Update the RX63N RDK demo to use the latest (at the time of writing) Renesas RDK BSP.
Ethernet is still not included.
The configuration is still set for the ES chip.
2012-04-24 12:45:01 +00:00
Richard Barry
84ddb2abd6 Update the RX63N RSK demo to use the latest (at the time of writing) Renesas RSK BSP.
Ethernet is still not included.
The configuration is still set for the ES chip.
2012-04-24 10:00:06 +00:00
Richard Barry
1bd702777d Remove older Renesas BSP files from the RX63N RSK demo in preparation to add in the latest BSP files. 2012-04-23 13:39:14 +00:00
Richard Barry
88bff5d198 RX63N RDK Debug build configuration now building, but not yet tested. 2012-04-18 10:34:05 +00:00
Richard Barry
2f199771d5 Backup point only. YRDK RX63N building but not linking. 2012-04-18 09:40:10 +00:00
Richard Barry
aa85a68636 Update the Renesas provided BSP files in the RDK RX63N project. 2012-04-18 09:08:56 +00:00
Richard Barry
3bc093f562 Starting point for YRDK RX63N demo. 2012-04-18 08:40:34 +00:00
Richard Barry
0cf8643863 Update the TCP/IP update period from 500ms to the expected 50ms. 2012-04-18 08:16:15 +00:00
Richard Barry
d8d68e917c Set the last return address at the bottom of the stack to 0 in the RX600 ports to prevent E2Studio from attempting to dereference the 0xdeadbeef pointer. 2012-04-16 18:33:32 +00:00
Richard Barry
63369b2a97 Change the stack alignment when a task first starts in the CM4F GCC, Tasking and Keil ports. 2012-04-16 18:23:32 +00:00
Richard Barry
68289d136f Remove unused .txt file from the XMC4500 uVision project. 2012-04-16 18:21:11 +00:00
Richard Barry
7a0996f246 Removed unused function from IAR CM4F port.c.
Modified the stack alignment when a task first starts in the IAR CM4F port.
2012-04-16 17:04:42 +00:00
Richard Barry
6360632cca Added the FreeRTOS/WorkingCopy/Demo/CORTEX_M4F_Infineon_XMC4500_IAR/settings directory to ensure the files open up in the IDE in the correct place when the project is first opened. 2012-04-16 17:02:21 +00:00
Richard Barry
eff1636a94 Starting point for XMC4500 IAR demo application. 2012-04-15 21:04:53 +00:00
Richard Barry
4793063ee0 Add #error statements in FreeRTOSConfig.h header files where the CreateProjectDirectoryStructure.bat should be executed prior to the first build.
Added the CreateProjectDirectoryStructure.bat file for the XMC4500 Tasking demo.
2012-04-06 20:20:35 +00:00
Richard Barry
dfa0c20530 Copy Tasking CM4F files from the project directory into their correct location in the FreeRTOS/Source directory. 2012-04-06 20:05:43 +00:00
Richard Barry
248abca109 Update include paths to be workspace relative.
Minimise the amount of heap space allocated.
Reduce the main() stack from 4K to 2K.
2012-04-06 20:02:44 +00:00
Richard Barry
a3b4008eae Created and tested optimised build configuration for the XMC4500 demo. 2012-04-06 19:47:30 +00:00
Richard Barry
6aa07ed919 Tasking XMC4500 demo now running. 2012-04-06 18:33:50 +00:00
Richard Barry
f9a9535ee9 Turn on long branch veneer generation in Tasking XMC4500 project - not sure why it is needed. 2012-04-06 17:45:24 +00:00
Richard Barry
1ccb58d56d Starting point for Tasking XMC4500 demo. Compiling only, not executed yet. 2012-04-06 16:36:52 +00:00
Richard Barry
1312fada7c Added traceMOVED_TASK_TO_READY_STATE and portSETUP_TCB macros.
Changed uxTCBNumber back to uxTaskNumber in tasks.c to fix IAR plug-in.
2012-04-02 20:06:52 +00:00
Richard Barry
c0339c2c86 Checking current RX62N Renesas project which now links with the latest Renesas compiler. 2012-04-02 18:40:56 +00:00
Richard Barry
83d5097ed2 Update the CM3 MPU port so it builds with the changes made to enable the FreeRTOS+Trace tool. 2012-04-02 18:33:46 +00:00
Richard Barry
892d28f2c4 Check in current RX63N session file. 2012-04-02 18:31:13 +00:00
Richard Barry
06d47d4012 Checking current RX600 Renesas project which now links with the latest Renesas compiler. 2012-04-02 18:30:26 +00:00
Richard Barry
82fb90c416 Update Rowley LPC2368 project to remove the multiple defined symbol warnings. 2012-04-02 17:38:58 +00:00
Richard Barry
020ddcbd90 Update Rowley STM32F107 project to remove multiple defined symbol warning. 2012-04-02 17:36:42 +00:00
Richard Barry
73287e108b Update MPU projects to build with V7.1.0 - NOTE - these now build but do not necessarily execute correct from the Rowley IDE. 2012-04-02 17:35:03 +00:00
Richard Barry
7b340a1f9c Update Rowley LPC1768 project to remove the multiple defined symbol warning. 2012-04-02 17:33:04 +00:00
Richard Barry
ea5027da67 Rename Demo/MPS430X_MSP430F5438_CCS4 Demo/MPS430X_MSP430F5438_CCS. 2012-04-02 09:40:00 +00:00
Richard Barry
4d1e3042dd Rename the Source/Portable/CCS4 directory to Source/Portable/CCS. 2012-04-02 09:37:17 +00:00
Richard Barry
2a9b42cbc3 Remove the Demo/Common/Utils directory as the CLI code is currently provided separately. 2012-04-02 09:24:11 +00:00
Richard Barry
bb708957a9 Test the CCS4 demo project to CCS5 and make a minor change to ensure the power supplied is adequate for the CPU speed. 2012-04-02 09:20:45 +00:00
Richard Barry
ab1aa67b08 Remove compiler warning in CCS MSP430X port. 2012-04-01 18:24:08 +00:00
Richard Barry
3b4771e1a9 Update MSP430X IAR port to ensure the power settings are correct for the clock speed. 2012-04-01 17:54:07 +00:00
Richard Barry
f16af5d27e Correct #endif statement in new flash_tiemr.h header file. 2012-03-17 17:22:52 +00:00
Richard Barry
c80818c7d8 Update version number in a couple of files in the RX63N/Renesas demo. 2012-03-17 17:21:49 +00:00
Richard Barry
3fa8beb176 Baseline the RX63N/Renesas demo - the Ethernet part of the demo is currently commented out as the Ethernet port is not configured using the RX63N register set. 2012-03-17 17:18:27 +00:00
Richard Barry
e69bce06de Add the sp_flop standard demo tasks to the RX63N RSK demo. 2012-03-17 15:11:13 +00:00
Richard Barry
eb38217496 Update demos to use timers for the check functionality, and the flash timers. Floating point and Ethernet is not yet included. 2012-03-17 15:02:32 +00:00
Richard Barry
785621ff22 Add the flash_timer standard demo timers (rather than tasks). These behave as the flash tasks, but use timers in place of tasks. 2012-03-17 14:59:46 +00:00
Richard Barry
05bc21e115 Update RX63N start-up to configure the high speed clock prior to initialising the C run time library. 2012-03-15 16:58:31 +00:00
Richard Barry
a3c45eb1da Starting point for RX63N demo added. 2012-03-15 15:56:05 +00:00
Richard Barry
9e926a4459 Update the Rx/Renesas projects to include an extra linker section "L" required by the latest compilers. 2012-03-12 15:29:56 +00:00
Richard Barry
5267ac07a4 Modified header comments only. 2012-03-12 14:37:27 +00:00
Richard Barry
14f2b70797 Convert mov instructions to movs instructions in the GCC Cortex-M0 demo.
Update GCC Cortex-M0 CMSISv2p00_LPC11xx/inc/LPC11xx.h.
2012-03-11 21:31:23 +00:00
Richard Barry
b86d821bc1 Convert mov instructions to movs instructions in the GCC Cortex-M0 port. 2012-03-11 21:28:06 +00:00
Richard Barry
7fa9bf25dc Fix issue in linker script generated by TrueStudio for STM32F0. 2012-03-11 20:22:18 +00:00
Richard Barry
b8be5d1db2 Arrange windows in the XMC4000/Keil demo so they appear neatly when the project is first opened. 2012-03-11 20:21:22 +00:00
Richard Barry
2c7ec3957d Correct linker script for ARM7_AT91SAM7X256_Eclipse demo. 2012-03-11 20:18:07 +00:00
Richard Barry
4c8e9edc8d Add static qualifier to the function that starts the first task in GCC/ARM_CM3/port.c.
Added a _nop() after the _disable_interrupt() in CCS4/MSP430X/portmacro.h.
Added a NOP() after the disabling of interrupts in IAR/MSP430X/portmacro.h.
2012-03-11 20:14:50 +00:00
Richard Barry
1478402899 Update IAR MSP430X project to latest IAR version. 2012-03-11 15:50:19 +00:00
Richard Barry
2658a3b6ef Added xSemaphoreGetMutexHolder() macro and equivalent function. 2012-03-11 15:23:51 +00:00
Richard Barry
6dc8b56cb6 Add batch file that creates the directory structure required by the XMC4500 GCC port. 2012-03-11 14:26:01 +00:00
Richard Barry
9718fbdcd4 Add GCC Cortex-M4F port layer. 2012-03-11 14:09:22 +00:00
Richard Barry
b22ee3c997 Add GCC project for Infineon XMC4500 Hexagon kit CPU board. 2012-03-11 14:07:48 +00:00
Richard Barry
c86abdb67c Arrange the windows in the Keil XMC4500 demo to be positioned correctly when first opened. 2012-03-05 15:23:43 +00:00
Richard Barry
2e07d3d665 Update comments in STM32F0 demo.
Update the Keil XMC4500 demo so there are simple blinky and comprehensive demo options.
2012-03-05 15:22:00 +00:00
Richard Barry
c77dab2c35 Update a comment only. 2012-03-04 20:59:23 +00:00
Richard Barry
45feba47c9 Add STM32F0 demo. 2012-03-04 15:11:54 +00:00
Richard Barry
a5b65b0066 Added IAR port layer for the Cortex-M0. 2012-02-24 12:05:01 +00:00
Richard Barry
0f7f97f3a3 Change FreeRTOSConfig.h for the LPCXpresso CM0 demo as there seem to be two forms of the CMSIS names. 2012-01-25 09:23:55 +00:00
Richard Barry
b3a894ca72 Revert the CM0 port layer exception handler names to the traditional FreeRTOS names as there seem to be two forms of the CMSIS names. 2012-01-25 09:19:58 +00:00
Richard Barry
ec18d06ab1 Remove the ( void ) prvSetupNestedFPUInterruptsTest; line from the LPC4300 M4 main.c file. It should not have been there. 2012-01-23 17:08:37 +00:00
Richard Barry
c820c390c4 Add XMC4500 project. 2012-01-23 12:02:57 +00:00
Richard Barry
f10b6ffdc5 Update comments in main-full.c of CM0 demo. 2012-01-22 21:26:47 +00:00
Richard Barry
ebc8ddd7da Remove duplicate definition of "#define vPortSVCHandler SVC_Handler" from FreeRTOSConfig.h included in CORTEX_STM32F100_Atollic demo. 2012-01-22 10:01:52 +00:00
Richard Barry
b4b4f306c2 In files added a few moments ago:
+ Correct version number in comments at top of file.
+ Correct path in batch file.
2012-01-21 19:01:04 +00:00
Richard Barry
7427c0eff2 Move the CM0 files to their correct location and remove from their temporary demo project home. 2012-01-21 18:46:08 +00:00
Richard Barry
de570548f0 Added batch file to create LPC11xx demo. Tidied up the M0 port layer files.
This is a baseline taken before moving the M0 port files to their proper location.
2012-01-21 18:38:21 +00:00
Richard Barry
7298ffd3f2 Correct one of the descriptions in the MicroBlaze FreeRTOS BSP mld file. 2012-01-21 16:42:03 +00:00
Richard Barry
71f36b8545 Tighten up IntQueue.c testing to have a count of the number of interrupts that post to the queue included in the error checks. 2012-01-21 16:39:14 +00:00
Richard Barry
f8d15bfaf5 Complete LPC11xx demo functionality. The batch file to copy the code over is not written yet. 2012-01-21 15:23:40 +00:00
Richard Barry
b0a6d939f4 Replace "Infinite loop" comment in main() with something sensible. 2012-01-19 22:17:10 +00:00
Richard Barry
8be818e771 Replace "Infinite loop" comment in main() with something sensible. 2012-01-19 22:16:13 +00:00
Richard Barry
e8c5f36b00 IntQ test in and working. Nesting depth not yet checked. Other tasks commented out of main(). 2012-01-17 10:34:00 +00:00
Richard Barry
29c9a63c41 Add a few lines to the RX ports that allow the vector to be installed when the FreeRTOS code is built as a library. 2012-01-13 16:41:42 +00:00
Richard Barry
3d48d67c14 LPC1114 demo added. Kernel source will be moved. 2012-01-12 15:02:01 +00:00
Richard Barry
637045468b Add xQueueReset() function. 2012-01-12 09:32:35 +00:00
Richard Barry
e3276fc282 Change version numbers to V7.1.0. 2011-12-13 16:24:24 +00:00
Richard Barry
8f3b797d29 Remove the incomplete MicroBlaze with full ethernet and tracecon facility ready for V7.1.0 update. 2011-12-13 15:41:55 +00:00
Richard Barry
1ec172e0e0 Add vQueueSetQueueNumber() and ucQueueGetQueueNumber() API functions. 2011-12-13 11:39:58 +00:00
Richard Barry
07c326fad3 Add a few extra standard demo tasks to the Win32 demo.
Make use of the new trace specific function calls from the Win32 demo - just to check the function as expected.
2011-12-13 11:38:58 +00:00
Richard Barry
cc06119b86 The LPC43xx fast start files are now included. 2011-12-13 11:36:38 +00:00
Richard Barry
a0eb27a69e Added fast book files to project - although fast boot is not integrated yet. 2011-12-13 09:22:57 +00:00
Richard Barry
e0a4cbab6f Changes necessary in the Win32/lwiP project to use the updated command console files. 2011-12-11 10:23:01 +00:00
Richard Barry
000b4ba783 Remove all printf() statements from Kinetis demo as they prevent the code running when the debugger is not attached. 2011-12-08 13:16:34 +00:00
Richard Barry
7db04b1820 Add two Cortex-M4F port layers. 2011-12-08 10:49:21 +00:00
Richard Barry
08ddd1d00d Add two Cortex-M4F demo applications. 2011-12-08 10:48:36 +00:00
Richard Barry
e7a1222c5f Command interpreter code updated to pass the command string into command hander functions. 2011-12-08 10:46:16 +00:00
Richard Barry
255dd683d2 Correct comment about mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY setting in TriCore main.c. 2011-12-05 17:00:14 +00:00
Richard Barry
93e72e5036 Correct the prototype of the function call vApplicationStackOverflowHook(). 2011-12-02 19:13:33 +00:00
Richard Barry
c92a2fe47e Add proper copyright notice in headers to files where is was mistakenly missing. 2011-12-02 08:05:14 +00:00
Richard Barry
94818b58e4 Add in a separate uxTaskNumber to the TCB structure for use by trace tools, leaving the uxTCBNumber for use by the state viewers. 2011-11-30 09:53:11 +00:00
Richard Barry
4d8e364c62 Add #define constant required to access the queue name get function. 2011-11-29 19:06:39 +00:00
Richard Barry
9b11b0c601 Remove the direct call to xQueueCreateMutex() and replace it with the xSemaphoreCreateMutex() macro. The result is the same, but the xQueue equivalent should not be used directly outside of the core files. 2011-11-29 19:05:21 +00:00
Richard Barry
7daebd9275 Update core files to remove legacy trace and make necessary modifications to facilitate use with other trace tools. 2011-11-29 19:02:58 +00:00
Richard Barry
022bc78961 Remove variable from the UDE perspective expressions window (TriCore demo project). 2011-11-24 11:54:42 +00:00
Richard Barry
7b23ebf63c Update TriCore model files so the .data section is initialised during startup. 2011-11-24 11:27:14 +00:00
Richard Barry
abb476db24 Formatting changes only in TriCore porttrap.c. 2011-11-22 13:35:26 +00:00
Richard Barry
63cab86cc7 Remove debug code from the TriCore port.c file. 2011-11-22 13:27:17 +00:00
Richard Barry
3780e672a8 Commit changes to the TriCore demo UDE project. 2011-11-22 13:25:18 +00:00
Richard Barry
eb8f02358e Fix compiler warning in timers.c/h that are only seen when the file is compiled on 8 bit devices.
Update example source code in timers.h so the parameter names match those in timers.c.
Fix "known issue" bug in xTaskResumeFromISR() (which was missing a critical section).
2011-11-22 13:24:32 +00:00
Richard Barry
562eedc434 All for the TriCore demo:
+ Comment serial.c
+ Improve the interaction between InterruptNetTest.c and main.c so both too short and too long periods are trapped.
+ Remove debug code from FreeRTOSConfig.h.
2011-11-22 13:21:37 +00:00
Richard Barry
5832e409d1 Fix compiler warning in TimerDemo.c that is only seen when the file is compiled on 8 bit devices. 2011-11-22 13:18:54 +00:00
Richard Barry
de4a548c07 Configure release configuration for the Win32 lwIP project. 2011-11-19 22:27:28 +00:00
Richard Barry
9d4616eb55 Wind up the baud rate on the TriCore UART to obtain an extra level of interrupt nesting.
Set the UART into loopback mode so a jumper is not required.
2011-11-18 11:25:19 +00:00
Richard Barry
b89f1a729a Latest TriCore port files - these still contain some debug code, and are not yet fully documented. 2011-11-17 11:16:21 +00:00
Richard Barry
93c4c48f78 Latest TriCore demo files - these still contain some debug code, and are not yet fully documented. 2011-11-17 11:11:15 +00:00
Richard Barry
b8c1195c40 Added: /* This is called from the context switch, so will be called from a
critical section.  xTaskGetTickCountFromISR() contains its own critical
	section, and the ISR safe critical sections are not designed to nest,
	so reset the critical section. */
	portSET_INTERRUPT_MASK_FROM_ISR();

in main.c.
2011-11-13 21:13:26 +00:00
Richard Barry
188128f788 Added the portALIGNMENT_ASSERT_pxCurrentTCB macro.
Updated the TriCore port layer so its compare match setup does not effect any other compare match bits.
2011-10-28 11:50:00 +00:00
Richard Barry
f354d6599e Add in interrupt nesting test - not yet complete. 2011-10-28 11:46:15 +00:00
Richard Barry
8d748af95c Updated TriCore demo application. 2011-10-27 10:45:27 +00:00
Richard Barry
41ef155824 Update TriCore GCC port layer. 2011-10-27 10:44:31 +00:00
Richard Barry
7f8a5ae148 Add timer demo to TriCore port. Add mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY into main.c. Finish commenting main.c. 2011-10-25 11:16:59 +00:00
Richard Barry
0997b286bc Add the death.c standard demo files to the TriCode demo. 2011-10-24 12:32:00 +00:00
Richard Barry
70cfbda2e8 Minor changes to the TriCore port made during test/validation. 2011-10-24 12:30:35 +00:00
Richard Barry
dd10b91fc4 TriCore demo: Add comments and modify the reg test tasks to give a better change of error detection. 2011-10-20 10:08:19 +00:00
Richard Barry
45fe448d73 First commit with TriCore port and demo - still a work in progress. 2011-10-17 13:17:58 +00:00
Richard Barry
75dc89826f First commit with TriCore port and demo - still a work in progress. 2011-10-17 13:17:14 +00:00
Richard Barry
0025e1ed9d Remove needs-lock SVN parameter from files in the CORTEX-LM3Sxxxx_IAR_KEIL directory. 2011-10-10 12:10:33 +00:00
Richard Barry
3f3e6ba246 Update RX630 to add in some timer demo code, and remove all mention of Ethernet.
Minor comment corrections in the RX200 demo.
2011-10-07 09:58:16 +00:00
Richard Barry
56eb9ebec3 Create RX630/Renesas project. 2011-10-07 08:30:23 +00:00
Richard Barry
317dc7ffd4 Change version numbers of files that are in SVN, but not included in the release yet. 2011-09-30 10:52:03 +00:00
Richard Barry
3eb4966af3 Add missing header file to the Windows lwIP demo project. 2011-09-30 10:32:50 +00:00
Richard Barry
9c25614cf4 Add an assert in the Win32 lwIP port layer to catch invalid adapter numbers being used. 2011-09-26 14:47:08 +00:00
Richard Barry
0e7c46fbd3 Update the version numbers in the demos that were not released in V7.0.2 to be V7.0.2. 2011-09-26 14:46:18 +00:00
Richard Barry
42fa20daec Add an optional global buffer to the command interpreter that can be used for command interpreter output. This removes the need for multiple output buffers to be allocated when more than one command interpreter is implemented. 2011-09-26 14:27:03 +00:00
Richard Barry
cc61126025 Update headers for the FreeRTOS V7.0.2 release. 2011-09-20 18:22:39 +00:00
Richard Barry
6031a62f72 Second phase of renaming RegisterTestTasks.s to RegisterTestTasks.S. 2011-09-20 16:52:17 +00:00
Richard Barry
d4476b0746 First phase of renaming RegisterTestTasks.s to RegisterTestTasks.S. 2011-09-20 16:51:28 +00:00
Richard Barry
35f7dba909 Update Win32 lwipopts.h for better efficiency. 2011-09-20 13:38:45 +00:00
Richard Barry
2cd1a46001 Minor changes to prepare the RX210 demo for release. 2011-09-20 13:37:35 +00:00
Richard Barry
9f72fe22d5 Remove disabling of nagle algorithm as the updated lwipopts.h in the MicroBlaze port makes it unnecessary. 2011-09-20 13:35:56 +00:00
Richard Barry
d150ed9baf Update Microblaze Ethernet Lite lwipopts.h for better efficiency. 2011-09-20 13:34:49 +00:00
Richard Barry
d28bd0ff46 Complete RX200 demo. 2011-09-18 15:45:52 +00:00
Richard Barry
83f0af8764 Lots of work on the RX200 demo. Blinky and Full/Debug build configurations are now tested, after adding the BussonAndLCD.c/h files. Full/Optimised is yet to be built or tested. 2011-09-17 16:41:46 +00:00
Richard Barry
025abf6f6a Moved some files into the include folder that were previously in the root. 2011-09-16 14:49:18 +00:00
Richard Barry
47455d6d1b Moved some files into the Renesas-Files folder that were previously in the root. 2011-09-16 14:47:36 +00:00
Richard Barry
93940b4717 Continue work on RX200 demo. Still a work in progress. 2011-09-16 14:38:36 +00:00
Richard Barry
5441cb959b Update demo projects for RX210, not yet complete, and not yet actually built. 2011-09-16 08:48:59 +00:00
Richard Barry
4883a72844 Update RL78 EWRL78 project settings so they can be used with the KickStart version of the IAR tools. 2011-09-13 15:12:56 +00:00
Richard Barry
2ae99f32f6 Delete the BasicSocketCommandServer task if the task exits, which can happen if the listening socket cannot be created. 2011-09-12 21:15:09 +00:00
Richard Barry
0d3d91fc51 Update sys_arch.c for Xilinx Ethernet Lite IP. 2011-09-12 21:13:25 +00:00
Richard Barry
03e2338deb Add warnings about mixing untested memory models in the RL78 port. 2011-09-09 20:37:50 +00:00
Richard Barry
d500594b8a Tidy up the RL78 port layer. 2011-09-09 18:52:30 +00:00
Richard Barry
1fe7f40fad Read the RL78 demo for release. 2011-09-09 18:51:09 +00:00
Richard Barry
573497fbe0 Tidy up the RL78 port layer. 2011-09-09 16:18:57 +00:00
Richard Barry
476a87dfdc Ready the RL78 port for release. 2011-09-09 12:37:07 +00:00
Richard Barry
e38ff18256 Read the RL78 demo for release. 2011-09-09 12:36:32 +00:00
Richard Barry
80341af3f5 Complete the RL78 demo. main.c still requires documentation in the comments at the top of the file. 2011-09-09 10:10:01 +00:00
Richard Barry
6ac7b7a9da Complete the RL78 demo. main.c still requires documentation in the comments at the top of the file. 2011-09-09 10:09:10 +00:00
Richard Barry
5e583219d6 Some updates to the fledgling RL78 demo application. Not yet complete. 2011-09-06 16:11:48 +00:00
Richard Barry
9290e3e71f Add use of portPOINTER_SIZE_TYPE to tasks.c to facilitate the removal of warnings when the pointer size is less than 32 bits. 2011-09-06 16:10:30 +00:00
Richard Barry
272cd59c26 Add use of portPOINTER_SIZE_TYPE to tasks.c to facilitate the removal of warnings when the pointer size is less than 32 bits. 2011-09-06 16:09:48 +00:00
Richard Barry
de3807389a Add RL78 port layer. Note yet complete. 2011-09-06 16:08:38 +00:00
Richard Barry
4ec258f31c Add an RX210 demo project. 2011-09-02 19:58:18 +00:00
Richard Barry
5182e65d0d Remove .dep file that should have have been included in the repository. 2011-09-02 18:48:12 +00:00
Richard Barry
11cd605be7 Added RX200 port layer. 2011-09-02 18:31:56 +00:00
Richard Barry
1abff5d5cd Start an RL78 demo project. 2011-09-02 10:49:16 +00:00
Richard Barry
e256bca3f9 MB9A314 Keil projects are now all fully functional. 2011-08-31 13:54:06 +00:00
Richard Barry
99c1322650 Keil MB9A310 project is now building, but not yet tested. 2011-08-31 10:38:44 +00:00
Richard Barry
9bfeb26579 Change Keil startup code to correct FM3 device. 2011-08-31 09:59:25 +00:00
Richard Barry
bcbd6c8a7d Added demo for the MB9A314 - the IAR project is working, the Keil one is not set up for the correct chip yet. 2011-08-30 20:32:41 +00:00
Richard Barry
9c92745440 Hardware and software for the MicroBlaze project that uses the full Ethernet IP is now building - but the MAC driver has not yet been written. 2011-08-28 18:38:32 +00:00
Richard Barry
d14eb96aeb Remove platform studio project as it is about to be replaced. 2011-08-28 16:41:01 +00:00
Richard Barry
1baa62e424 Remove redundant bit being set in the status register of the PIC32. 2011-08-28 13:07:54 +00:00
Richard Barry
3a4d907c64 Modify the stack set up when ARM7/9 tasks are created to ensure the assert() calls in xTaskCreate() don't fail. In this case, the assert that would fail is actually redundant anyway, but should not be removed as it might not be redundant in all ports. 2011-08-28 13:06:11 +00:00
Richard Barry
98860dee6a Remove obsolete comment. 2011-08-27 19:12:45 +00:00
Richard Barry
a7f8a586f4 First version of the MicroBlaze demo with the full Ethernet IP. The Ethernet driver is not yet written. 2011-08-27 14:34:12 +00:00
Richard Barry
3104a7cf38 Remove directory that is not required. 2011-08-27 14:30:48 +00:00
Richard Barry
d6aba020b0 Remove some large files from the repository that don't need to be there. 2011-08-27 14:23:59 +00:00
Richard Barry
731a01f8f4 Remove some large files from the repository that don't need to be there. 2011-08-27 14:22:36 +00:00
Richard Barry
678396f61b 2011-08-27 14:20:58 +00:00
Richard Barry
df4feccb98 Rename the projects used in the Ethernet Lite MicroBlaze demo. 2011-08-27 13:44:31 +00:00
Richard Barry
c87a82bb7b Rename the directories used in the Ethernet Lite MicroBlaze demo. 2011-08-27 13:30:01 +00:00
Richard Barry
a16be7fb4e Update platform studio project for MicroBlaze with full Ethernet. 2011-08-27 11:55:55 +00:00
Richard Barry
dbb0c1d13a First MicroBlaze hardware build with full Ethernet. 2011-08-27 06:45:09 +00:00
Richard Barry
f4ae3c75bb Rename MicroBlaze project that uses the full Ethernet IP. 2011-08-26 17:49:13 +00:00
Richard Barry
ea4f399a88 Remove MicroBlaze with full Ethernet project, so it can be generated again. 2011-08-26 17:42:54 +00:00
Richard Barry
856b801d33 Remove MicroBlaze with full Ethernet project, so it can be generated again. 2011-08-26 17:40:50 +00:00
Richard Barry
940b9ce27e Remove MicroBlaze with full Ethernet project, so it can be generated again. 2011-08-26 17:40:25 +00:00
Richard Barry
471ddd3c39 Mark original MicroBlaze project as deprecated. 2011-08-26 16:46:54 +00:00
Richard Barry
ae4a38f5d8 Remove unused variable warning. 2011-08-26 16:44:02 +00:00
Richard Barry
e1c944ec65 Correct task names in BlockQ.c. 2011-08-26 16:43:16 +00:00
Richard Barry
d681d02acf Update the number of PCB buffers. 2011-08-26 15:40:45 +00:00
Richard Barry
6a561bb2e7 Add queue registry usage to the MicroBlaze demo so it can be used with the state viewer plug in. 2011-08-26 12:37:54 +00:00
Richard Barry
542a01f8bc Minor corrections in the comments punctuation. 2011-08-26 12:36:05 +00:00
Richard Barry
39f8526265 Changed the MicroBlaze demo back to using heap_3.c having updated the linker script generation. 2011-08-24 12:38:38 +00:00
Richard Barry
08d7c89175 Changed the MicroBlaze demo back to using heap_3.c having updated the linker script generation. 2011-08-24 11:59:06 +00:00
Richard Barry
c056029422 Added BSP generation files to MicroBlaze directory. 2011-08-24 11:08:01 +00:00
Richard Barry
0dc4153997 Update the MicroBlaze CreateProjectDirectoryStructure.bat file to also copy files into the BSP directory, and to use path variables for the relative paths. 2011-08-24 10:42:27 +00:00
Richard Barry
667b722bde Update the names of some of the newly introduced API functions so they are more consistent with the names of pre-existing API functions. 2011-08-07 10:37:24 +00:00
Richard Barry
40ce7c8b52 Update the real copy of the Ethernet driver for the MicroBlaze EmacLite IP. 2011-08-07 10:28:13 +00:00
Richard Barry
a6ce07a130 Commit existing xps project for the new MicroBlaze demo. 2011-08-07 10:25:24 +00:00
Richard Barry
3a25b5f33b Update the names of some of the newly introduced API functions so they are more consistent with the names of pre-existing API functions. 2011-08-07 10:22:57 +00:00
Richard Barry
28629a7ea6 Update the names of some of the newly introduced API functions so they are more consistent with the names of pre-existing API functions. 2011-08-07 10:22:20 +00:00
Richard Barry
405a2ca22c Add run time stats gathering to the MicroBlaze demo. 2011-08-07 10:08:04 +00:00
Richard Barry
1b762ec32d Update the pages served by the MicroBlaze web server. 2011-08-07 10:06:34 +00:00
Richard Barry
0d691b2095 Minor tidy up of the lwIP_Apps file and configuration in the new MicroBlaze demo. 2011-08-06 11:11:22 +00:00
Richard Barry
153a9f8ddb Add printf-stdarg.c to the new MicroBlaze demo. 2011-08-06 11:10:17 +00:00
Richard Barry
8c6dba2726 Add in necessary functionality to autonegotiate using the EthernetLite interface to the PHY. 2011-08-06 08:28:25 +00:00
Richard Barry
ff8a7626d0 Change command interpreter semantics. 2011-08-03 09:36:12 +00:00
Richard Barry
49f726cf25 Change command interpreter semantics. 2011-08-03 09:35:21 +00:00
Richard Barry
59fbe1da22 Fix a few compiler warnings in utils when compiled with GCC. 2011-08-02 09:45:12 +00:00
Richard Barry
815bde09b9 Comment the command line interpreter and lwIP sockets based server code. 2011-08-01 16:06:06 +00:00
Richard Barry
5ca1d4194d Comment the command line interpreter and lwIP sockets based server code. 2011-08-01 16:03:49 +00:00
Richard Barry
723bed71bf Move the MSVC/lwIP code into the main line - not yet tested since moved. 2011-08-01 10:58:22 +00:00
Richard Barry
d53ed61cab Move the MSVC/lwIP code into the main line. 2011-08-01 08:57:11 +00:00
Richard Barry
1aa52c2a7a Update a few util functions in the common demo area. 2011-08-01 08:34:05 +00:00
Richard Barry
a548ef34f8 Remove vTaskCleanUpResources() calls. 2011-08-01 08:07:44 +00:00
Richard Barry
31dc786620 A few updates for coding standard reasons. 2011-08-01 08:05:37 +00:00
Richard Barry
254b61871e A few updates for coding standard reasons. 2011-08-01 08:00:17 +00:00
Richard Barry
5063200c86 Remove vTaskCleanUpResources() from core header files. 2011-08-01 07:48:56 +00:00
Richard Barry
6cc59de148 Remove files that are not required from the MicroBlaze demo project directories. 2011-07-27 19:18:45 +00:00
Richard Barry
be7f88c78f Remove files that are not required from the MicroBlaze demo project directories. 2011-07-27 19:17:37 +00:00
Richard Barry
0d56e9a4a5 Delete directories that were added to the repository by mistake (those containing binaries) - woops. 2011-07-27 19:11:29 +00:00
Richard Barry
e9e8365c8f Create project directory structure for the MicroBlaze demo project that uses the full Ethernet IP (rather than the Ethernet Lite IP). 2011-07-27 19:09:17 +00:00
Richard Barry
74eedea5db Check in the MicroBlaze projects before copying them to create the version that uses the full Ethernet. 2011-07-27 16:54:57 +00:00
Richard Barry
f69b2efa66 Delete unused header file in the MicroBlaze Ethernet Lite port directory. 2011-07-27 16:53:32 +00:00
Richard Barry
2981d9f5c1 2011-07-27 16:52:32 +00:00
Richard Barry
eb69ddce43 Fix compiler warning in sockets.c of lwip-1.4.0. 2011-07-27 16:51:11 +00:00
Richard Barry
6e81135a0d Add comtest_strings.c and comtest_strings.h to the proper Demo/Common/Minimal directory. 2011-07-27 16:39:59 +00:00
Richard Barry
6e2aeed966 Remove all workspace local copies of files that should be copied across using the CreateProejctDirectoryStructure.bat batch file. 2011-07-27 16:19:52 +00:00
Richard Barry
42aed81857 Add test/demonstration calls to xTaskGetIdleTaskHandle(), xTimerGetTimerTaskHandle, pcTaskGetTaskName() and vQueueDelete() functions to the Win32 demo project. 2011-07-27 14:16:24 +00:00
Richard Barry
6fa8cd4302 Add in the vSemaphoreDelete() macro. 2011-07-27 14:12:35 +00:00
Richard Barry
fc99c14905 Add in the pcTaskGetTaskName(), xTaskGetIdleTaskHandle() and xTimerGetTimerTaskHandle() API functions. 2011-07-27 14:02:37 +00:00
Richard Barry
a2a309c263 Update the batch file that copies the MicroBlaze code to use the MicroBlaze8 directory in place of the standard MicroBlaze directory in the FreeRTOS Source directory tree. 2011-07-27 13:05:23 +00:00
Richard Barry
4154b31454 Move new MicroBlaze V8 port from the project directory into its correct location in the directory structure. 2011-07-27 13:03:14 +00:00
Richard Barry
fab6050ab8 Regenerate the EthernetLite hardware (MicroBlaze) in an attempt to get Rx working. 2011-07-27 12:08:38 +00:00
Richard Barry
1019db5850 Regenerate the EthernetLite hardware (MicroBlaze) in an attempt to get Rx working. 2011-07-27 12:06:38 +00:00
Richard Barry
a12c133956 Clear off a few compiler warnings generated when pedantic warnings are switched on. 2011-07-27 12:05:56 +00:00
Richard Barry
ff77d82ceb Update lwIP port layer for the Microblaze Ethernet Lite IP. 2011-07-27 12:04:15 +00:00
Richard Barry
5d3a35a1f3 Clear off a few compiler warnings generated when pedantic warnings are switched on. 2011-07-27 12:02:08 +00:00
Richard Barry
87b97f5510 Update PIC32 asm code ready for MPLAB compiler V2. 2011-07-25 15:38:19 +00:00
Richard Barry
fe6284e807 Update PIC32 asm code ready for MPLAB compiler V2. 2011-07-25 15:35:54 +00:00
Richard Barry
6c0fe51bf2 Update the demo directory (temporary) local copy of the MicroBlaze EthernetLite port layer. 2011-07-24 16:21:23 +00:00
Richard Barry
9d1c23f6da Add in starting point for the MicroBlaze EthernetLite lwIP port layer. 2011-07-24 16:19:52 +00:00
Richard Barry
a176b54de5 MicroBlaze demo now building with lwIP included - but will not link until the Ethernetif file is implemented. 2011-07-24 11:14:40 +00:00
Richard Barry
12a722bf36 Remove unnecessary files from the MicroBlaze http server file system creation directory. 2011-07-24 10:31:22 +00:00
Richard Barry
1052e6585f Update CreateProjectDirectoryStructure.bat to add in the lwIP source files, and add the source files themselves. The source files will be removed before release. 2011-07-24 09:53:54 +00:00
Richard Barry
c39170ef64 Add raw httpd web server to the MicroBlaze demo - not build yet - only a file copy exercise so far. 2011-07-23 21:32:32 +00:00
Richard Barry
98309c3f4d Add lwIP_Apps directory structure to the MicroBlaze demo. 2011-07-23 21:20:57 +00:00
Richard Barry
c023af9c39 Add a separate portMINUS_CONTEXT_SIZE definition, in place of the previously used -portCONTEXT_SIZE usage. 2011-07-23 21:14:43 +00:00
Richard Barry
9beca8b1b1 2011-07-23 21:12:53 +00:00
Richard Barry
ad57e919b5 Minor typo in comment corrected in the Kinetis main-full.c. 2011-07-23 21:11:24 +00:00
Richard Barry
adabfbe8b7 Add lwIP V1.4.0 source files. 2011-07-23 20:22:27 +00:00
Richard Barry
a089537b02 Comment K60 demo code, ready for release. 2011-07-11 12:06:57 +00:00
Richard Barry
dcb8df1fce Get web server and run time stats working in the Kinetis K60 demo. 2011-07-10 21:10:11 +00:00
Richard Barry
326b6a2c95 Ethernet working in the Kinetis K60 demo. 2011-07-10 12:16:13 +00:00
Richard Barry
9d181af847 Add Full build configuration to the Kinetis demo. Still a work in progress. 2011-07-08 21:02:03 +00:00
Richard Barry
862f99832d Start creating the K60 demo directory structure. 2011-07-08 09:55:18 +00:00
Richard Barry
d0e8c36aa2 Start creating the K60 demo directory structure. 2011-07-08 08:57:54 +00:00
Richard Barry
248123342b Prepare files for export (MicroBlaze project). 2011-07-05 13:52:52 +00:00
Richard Barry
6e30a6cb75 Comment the exception handling functions in the MicroBlaze portmacro.h file. 2011-07-04 20:18:29 +00:00
Richard Barry
b59d10c893 Change vTickISR() to vPortTickISR() in the new MicroBlaze demo. 2011-07-04 18:15:22 +00:00
Richard Barry
1f5e2a944c Add vSemaphoreDelete(), xTaskGetIdleTaskHandle(), xTimerGetTimerTaskHandle() API functions. Change vTickISR() to vPortTickISR(). Partially comment portmacro.h. All for the new MicroBlaze port. 2011-07-04 18:13:09 +00:00
Richard Barry
3d5656e37e Clean up some of the exception handling code in the new MicroBlaze port. 2011-07-02 18:51:18 +00:00
Richard Barry
f90794f05a Comment the new MicroBlaze port layer files. 2011-06-30 18:26:32 +00:00
Richard Barry
0e12cd0768 Comment the new standard demo files that were introduced for the new MicroBlaze demo project. 2011-06-30 15:14:46 +00:00
Richard Barry
9d6eabdcfb Comment the new standard demo files that were introduced for the new MicroBlaze demo project. 2011-06-30 15:12:42 +00:00
Richard Barry
77df4daee7 Comment the peripheral helper files for the new MicroBlaze demo application. 2011-06-30 14:42:07 +00:00
Richard Barry
07e3174ad7 Complete first pass commenting of the new MicroBlaze demo main-blinky.c and main-full.c files. 2011-06-30 09:30:14 +00:00
Richard Barry
e46b2a304f Continue commenting the new MicroBlaze demo. 2011-06-29 19:03:59 +00:00
Richard Barry
0e02cc56b1 Add the standard demo/test timers task to the MicroBlaze demo. 2011-06-29 19:02:33 +00:00
Richard Barry
5fdee187d4 Comment the new MicroBlaze blinky demo ready for release. The full demo still requires work. 2011-06-29 15:02:10 +00:00
Richard Barry
832bbd38e1 Extend the exception handling functionality in the new MicroBlaze port. 2011-06-29 08:50:13 +00:00
Richard Barry
71b359154b Implementing exception handling in the new MicroBlaze port - still a work in progress. 2011-06-26 20:56:49 +00:00
Richard Barry
8b0ccf1444 New MicroBlaze port: Added a FreeRTOS exception handler, and installed it in each position in the exception table. The handler itself does not do much yet. 2011-06-24 18:50:45 +00:00
Richard Barry
4108061316 Complete the new comtest_strings.c file.
Somewhat optimise the calling of vTaskSwitchContext() from interrupts in the new MicroBlaze port to ensure it does not get called multiple times when more than one peripheral is called from the same interrupt.
2011-06-20 19:40:50 +00:00
Richard Barry
a4de9fa8f6 Add in the comtest test tasks to the MicroBlaze demo. 2011-06-19 21:19:33 +00:00
Richard Barry
7b24b4c30c Add the comtest_strings.c and serial.c files - Tx is workings, but both files are still a work in progress. 2011-06-19 13:15:47 +00:00
Richard Barry
2874006c7b Rebuild MicroBlaze hardware to experiment with UART - then put hardware back to how it was originally. 2011-06-19 13:00:59 +00:00
Richard Barry
56875b34d6 Rebuild MicroBlaze hardware to experiment with UART - then put hardware back to how it was originally. 2011-06-17 21:31:39 +00:00
Richard Barry
0512d10a02 Re-arrange the temporary MicroBlaze directory structure slightly. 2011-06-16 20:05:19 +00:00
Richard Barry
be9b7e82c8 Add the common demo files to the MicroBlaze project - this directory will be removed prior to release. 2011-06-16 19:47:49 +00:00
Richard Barry
53d52c0cd3 Remove the needs-lock SVN attribute. 2011-06-16 14:59:47 +00:00
Richard Barry
5ddcf3d36a Update the Cortex-M3 IAR projects to compile with EWARM 6.20 where necessary. 2011-06-16 14:35:57 +00:00
Richard Barry
d873c2705d Introduce sp_flop.c. This is the same as the flop.c common demo file, but uses single precision numbers and variables in place of the double precision numbers and variables. 2011-06-15 16:44:08 +00:00
Richard Barry
c9b5f43d11 Add optional FPU support to the MicroBlaze code.
Rearrange the order in which registers are saved to the stack in an interrupt to make it more logical, and introduce #defines for the offset from the stack pointer for each variable.
2011-06-15 16:42:04 +00:00
Richard Barry
4d287dd1bf Small tidy up of the new MicroBlaze port layer. 2011-06-15 08:39:45 +00:00
Richard Barry
00bfe2f025 Small tidy up of the main-full.c file for the new MicroBlaze demo. 2011-06-15 08:38:01 +00:00
Richard Barry
587e7f0682 Update register test tasks to include a manual yield. Include the death tasks in main-full.c. Decrease the RAM allocated to the heap in FreeRTOSConfig.h. 2011-06-13 14:41:18 +00:00
Richard Barry
1cb4a1494f Remove the heap used with the new MicroBlaze demo. As heap_2.c is being used, the heap area set up in the linker script is not required. 2011-06-13 14:39:22 +00:00
Richard Barry
8d23799758 First pass changes to new MicroBlaze port layer done. No new functionality has yet been added. 2011-06-13 14:37:32 +00:00
Richard Barry
cdac2c4f82 MicroBlaze demo nearly working - death tasks not yet integrated - still a work in progress. 2011-06-12 15:55:45 +00:00
Richard Barry
57653ee0ea Work on the Full build configuration for the MicroBlaze. Still a work in progress - not all tasks are running yet. 2011-06-11 21:04:17 +00:00
Richard Barry
78953066af Delete again. 2011-06-11 19:26:03 +00:00
Richard Barry
7a6dacf296 2011-06-11 19:12:26 +00:00
Richard Barry
d487077d6e First phase of renaming portasm.s in the MicroBlaze port. 2011-06-11 18:31:04 +00:00
Richard Barry
4c80a9948e Tidy up the MicoBlaze port layer - still a work in progress. 2011-06-11 12:00:52 +00:00
Richard Barry
3e07dd4a03 Add a register test to the new MicroBlaze demo - still a work in progress. 2011-06-10 09:43:12 +00:00
Richard Barry
4cda2df265 MicroBlaze projects: Split build configurations into blinky and full. Implement partest.c. Everything still a work in progress. 2011-06-06 21:01:42 +00:00
Richard Barry
9f0bf057e6 Add LED output to the new MicroBlaze blinky demo - still a work in progress. 2011-06-05 16:39:49 +00:00
Richard Barry
ea5ec656f4 Continue work on MicroBlaze port - still very much a work in progress. 2011-06-03 19:22:17 +00:00
Richard Barry
1e5830a157 Continue work on MicroBlaze port - still very much a work in progress. 2011-06-03 09:01:21 +00:00
Richard Barry
67039f6065 Updating MicroBlaze port - work in progress. 2011-06-01 15:01:08 +00:00
Richard Barry
328a8b586f Updating MicroBlaze port - work in progress. 2011-06-01 11:01:58 +00:00
Richard Barry
f5b2c790a0 Add framework for new MicrobBlaze blinky project. 2011-05-31 20:38:48 +00:00
Richard Barry
ee4659b678 Add autogenerated test source code to the new MicroBlaze project. 2011-05-31 18:14:58 +00:00
Richard Barry
d4670870fb Restart the Microblaze project (again). 2011-05-31 09:08:05 +00:00
Richard Barry
3c5b78631b Remove MicroBlaze directory. 2011-05-31 08:37:52 +00:00
Richard Barry
dbe65c9aaf Remove MicroBlaze directory. 2011-05-31 08:35:12 +00:00
Richard Barry
1438e844d9 Remove MicroBlaze directory. 2011-05-31 08:34:25 +00:00
Richard Barry
659be53a3e Remove MicroBlaze directory. 2011-05-31 08:33:47 +00:00
Richard Barry
52a9e4ecd8 Renamed MicroBlaze directory to MicroBlaze_Spartan-6_EthernetLite. 2011-05-31 08:27:43 +00:00
Richard Barry
04f17c5cee Renamed MicroBlaze directory to MicroBlaze_Spartan-6_EthernetLite. 2011-05-31 08:25:12 +00:00
Richard Barry
f4009da657 Create MicroBlaze hardware - work in progress. 2011-05-31 07:55:45 +00:00
Richard Barry
61f15c5c17 Create MicroBlaze hardware - work in progress. 2011-05-30 20:57:52 +00:00
Richard Barry
3d5b5ce834 Restart the new MicroBlaze hardware project. 2011-05-30 20:37:24 +00:00
Richard Barry
29f7b76be0 Create MicroBlaze hardware - work in progress. 2011-05-30 20:07:13 +00:00
Richard Barry
2aa3a13d32 Start MicroBlaze project for the Spartan-6. 2011-05-30 15:56:32 +00:00
Richard Barry
dedc9d8c46 Change some (xTIMER *) references in the documentation for the timer module to be instead xTimerHandle references (the two are in effect equivalent, but xTIMER is private to the timers source file). 2011-05-15 17:31:53 +00:00
Richard Barry
f5a6b610e1 Update version number to V7.0.1. 2011-05-13 18:31:12 +00:00
Richard Barry
4e39c05bb6 Update all the Rx demos to use timers in their uIP task implementation. 2011-05-13 17:32:30 +00:00
Richard Barry
9ad9969536 The Keil compiler insists on having the IP address structure packed, but doing so causes problems with warnings being generated on other compilers. uip.h was therefore updated to just use the pack attribute when the Keil compiler is used. 2011-05-13 17:28:46 +00:00
Richard Barry
4f08018fa8 Update the RSK and RDK RX600 demos that use the Renesas compiler to include the extra port layer file needed when using V1.0.2.0 of the Renesas tools. 2011-05-13 13:57:04 +00:00
Richard Barry
ef41907cab Update comment in the A2F main-full.c file for the SoftConsole demo. 2011-05-13 13:23:54 +00:00
Richard Barry
dbd0c5ff80 Update comment in the A2F main-full.c file for the IAR and Keil demos. 2011-05-13 13:21:48 +00:00
Richard Barry
1f452ffdc3 Move the ehb instruction in the PIC32/MPLAB port layer. 2011-05-13 10:42:16 +00:00
Richard Barry
f95c8efb63 Complete the Keil full FM3 demo. 2011-05-07 18:29:53 +00:00
Richard Barry
6cb1ea3ae4 Added Keil Blinky build configuration for the MB9B500 FM3. 2011-05-07 12:13:12 +00:00
Richard Barry
a67536618a Complete the IAR FM3 demo. 2011-05-06 19:25:12 +00:00
Richard Barry
b1727357b5 Added the digit counter timer to the FM3/IAR demo. 2011-05-06 11:13:11 +00:00
Richard Barry
f6bf081cdb Added first version of the "full" build configuration to the FM3/IAR demo. 2011-05-06 10:14:29 +00:00
Richard Barry
fdceeeb190 Complete FM3/IAR blinky build configuration. 2011-05-05 18:40:28 +00:00
Richard Barry
8c4c025c30 Add extra files to the MB9BF506N demo project. 2011-05-05 18:14:42 +00:00
Richard Barry
5d31ac594b Rename the Debug build configuration in the FM3 IAR demo to Blinky. 2011-05-04 20:27:39 +00:00
Richard Barry
6be0a39eea Correct the name of a variable in the A2F Blinky demos from xFreeStackSpace to xFreeHeapSpace. 2011-05-04 20:25:18 +00:00
Richard Barry
e8fe7aa08e Change the main_blinky for the FM3 demo to use falling edge interrupts on the button input. 2011-05-04 20:12:40 +00:00
Richard Barry
80db62e711 Add in an FM3/IAR 2011-05-04 19:05:31 +00:00
Richard Barry
4de76dbc82 Fix in tasks.c related to https://sourceforge.net/tracker/?func=detail&aid=3295065&group_id=111543&atid=659633 2011-04-29 19:33:07 +00:00
Richard Barry
6d9cd6ff47 RC 2 of the Microsemi demos. 2011-04-29 13:22:11 +00:00
Richard Barry
a204921cc5 Commit the new files required for the ACE driver in the SmartFusion demo. 2011-04-29 13:02:19 +00:00
Richard Barry
fca97d4834 Put back the #error statement in FreeRTOS config for the Eclipse SmartFusion demo - it should not have been checked in with it out. 2011-04-29 12:00:33 +00:00
Richard Barry
3463753afc RC 1 of the Microsemi demos. 2011-04-29 11:57:38 +00:00
Richard Barry
eadd0048c4 Update the SmartFusion SoftConsole source code to be the same as the IAR and Keil versions. 2011-04-29 10:31:01 +00:00
Richard Barry
2aef3e3cfe Complete Keil SmartFusion demo projects. 2011-04-29 09:28:13 +00:00
Richard Barry
96b1dc773f Update the FreeTCPIP files such that Keil is happy compiling them with the pack struct header file definitions. 2011-04-28 19:38:32 +00:00
Richard Barry
44fc593dfe Add the Keil project to the SmartFusion demo directory, and update the source code so it compiles with both IAR and Keil. 2011-04-28 19:37:30 +00:00
Richard Barry
f155921461 Tidy up the IAR SmartFusion demo reading for release. 2011-04-28 15:13:30 +00:00
Richard Barry
f6879be327 Put some belt and braces checks into the updated SmartFusion MAC driver. 2011-04-28 15:01:40 +00:00
Richard Barry
d23df3d0af Remove ACE files that are not necessary for the SmartFusion demo. 2011-04-28 14:59:31 +00:00
Richard Barry
65ceb00a1f Add in functions required to configure the ACE in the SmartFusion demo. 2011-04-28 14:56:15 +00:00
Richard Barry
5831485bdf Update the A2F SoftConsole project to match the current A2F IAR project. 2011-04-27 16:05:36 +00:00
Richard Barry
9b6bd9e419 Update the IO page served by the A2F web server to use the correct LED for the A2F-EVAL-KIT hardware. 2011-04-27 15:11:42 +00:00
Richard Barry
72400ce72a 2011-04-25 15:00:34 +00:00
Richard Barry
2e2ab0b4dd Continue work on the IAR Microsemi Smartfusion demo. Still a work in progress. 2011-04-25 14:48:15 +00:00
Richard Barry
11254c9da4 Add in the Microsemi timer driver to provide a time base for the run time stats. 2011-04-25 14:44:55 +00:00
Richard Barry
b84c870b54 Update the Microsemi I2C code to be event driver, rather than polling for Tx complete. 2011-04-25 14:43:34 +00:00
Richard Barry
1f2a287b7f Change Demo/Common/Minimal/death.c so it takes into account the timer daemon task in its calculation of the number of tasks that should be running. 2011-04-25 14:41:15 +00:00
Richard Barry
51f445fc67 SmartFusion A2F demo work in progress. 2011-04-24 19:37:10 +00:00
Richard Barry
f11836f206 Update the A2F uIP_Task definition for use with the updated (zero copy) A2F Ethernet driver. 2011-04-24 19:09:12 +00:00
Richard Barry
c1d000b654 Update MAC drivers so they use a uIP specific zero copy mechanism. 2011-04-24 18:45:58 +00:00
Richard Barry
5fbf3ab27e Change the RX62N port layer to allow it to be used with the V1.0.2 of the Renesas compiler. 2011-04-23 15:36:10 +00:00
Richard Barry
4a1716ac67 Add definitions for the different types of event that need processing by the TCP/IP stack. 2011-04-23 15:34:37 +00:00
Richard Barry
4950af89fb Update the RX62N/RDK/Renesas project files for use with V1.0.2 of the Reneasas compiler. 2011-04-23 15:31:17 +00:00
Richard Barry
d390ea696a Update the RX62N/RDK/Renesas project files for use with V1.0.2 of the Reneasas compiler. 2011-04-23 15:30:39 +00:00
Richard Barry
f109e90e15 Update FreeRTOSConfig.h for the RX62N/RDK/Renesas demo to include software timer and configASSERT() functionality. 2011-04-23 15:28:45 +00:00
Richard Barry
753ba20386 Update the uIP_Task.c implementation for the RX62N/RDK/Renesas demo to use FreeRTOS software timers in place of the uIP timers. 2011-04-23 15:27:34 +00:00
Richard Barry
968aa1b199 Change interface between the MAC and uIP task in the RX62N/RDK/Renesas demo to use a queue in place of the binary semaphore. This is so the queue can be used to indicate the type of event that has occurred. 2011-04-23 15:21:59 +00:00
Richard Barry
290e7bd222 Add pack_struct_start and pack_struct_end definitions for ICCARM. 2011-04-22 14:13:51 +00:00
Richard Barry
218c59e058 2011-04-20 20:04:32 +00:00
Richard Barry
d6290b8e48 Change the CMSIS_IAR directory back to just say CMSIS. 2011-04-20 18:37:58 +00:00
Richard Barry
983e91b440 2011-04-20 18:30:43 +00:00
Richard Barry
2d7a71d379 2011-04-20 18:29:28 +00:00
Richard Barry
f53955df4a 2011-04-20 18:24:00 +00:00
Richard Barry
139708e063 Create directory structure to hold the (not yet created) Keil and IAR demo projects for the SmartFusion. 2011-04-20 15:09:58 +00:00
Richard Barry
779e2bf80f 2011-04-20 15:03:42 +00:00
Richard Barry
fb0d9d3c93 Complete the commenting for main-full.c in the A2F demo project, and update the main-full.c and main-blinky.c header comments to be correct for FreeRTOS V7.0.0. 2011-04-20 11:17:06 +00:00
Richard Barry
75e2399319 Complete the commenting for main-blinky.c in the A2F demo project. 2011-04-20 09:09:25 +00:00
Richard Barry
9a76675d1d Update the A2F SoftConsole project files to remove the strange unused/invalid include paths. 2011-04-20 08:23:55 +00:00
Richard Barry
fd20ed4d17 Continue work on the SmartFusion web server demo. 2011-04-18 18:11:03 +00:00
Richard Barry
9ebdc099d1 Removed unused variable from SmartFusion PHY driver. 2011-04-18 08:44:08 +00:00
Richard Barry
9c6a0e4e69 Continue work on the SmartFusion demo web interface. The uIP task has been updated to use software timers, and the mac interface updated to use vTaskDelay() in place of busy waits. 2011-04-17 14:38:50 +00:00
Richard Barry
e659759671 Delete EMAC.c from the A2F demo. 2011-04-17 11:08:07 +00:00
Richard Barry
c0bf3cd7f9 Add in basic uIP files into the A2F demo. Ping is working, but nothing else has been tested yet. This check in includes some modifications to the MAC driver to make the Rx zero copy. 2011-04-17 10:32:09 +00:00
Richard Barry
521d995b9d Corrected a comment in the STM32 FreeRTOSConfig.h file. 2011-04-14 12:49:36 +00:00
Richard Barry
0feaad7183 Corrected a comment in the STM32 FreeRTOSConfig.h file. 2011-04-14 12:46:27 +00:00
Richard Barry
8e3e51e3a2 Add I2S driver to the StmartFusion demo. 2011-04-14 09:37:07 +00:00
Richard Barry
7915c348c3 Add OLED driver to the StmartFusion demo. 2011-04-14 09:31:18 +00:00
Richard Barry
b42d4da7db Continue work on the SmartFusion demo. 2011-04-13 21:07:25 +00:00
Richard Barry
505bee983c Ensure byte alignment is maintained in PIC32 port layer when 8 byte alignment is required (basically, when printing out 8 byte data types). 2011-04-13 15:59:17 +00:00
Richard Barry
3144ef3cc6 Continue work on SmartFusion demo. 2011-04-12 13:49:13 +00:00
Richard Barry
5725c4b305 Alter the default priorities in blocktim.c to prevent asserts being triggered when configMAX_PRIORITIES is set to a low number. 2011-04-12 13:47:09 +00:00
Richard Barry
9481ea480b Continue work on SmartFusion demo. 2011-04-11 19:59:12 +00:00
Richard Barry
ed24f0fdc1 Continue work on the SmartFusion demo. 2011-04-11 16:32:37 +00:00
Richard Barry
a70c881207 Remove shadowed variable name. 2011-04-08 19:40:44 +00:00
Richard Barry
89bf1cf24f Update headers for Version 7.0.0 release. 2011-04-08 18:30:58 +00:00
Richard Barry
7ca26d943a Prepare for V7.0.0 release. 2011-04-08 12:06:33 +00:00
Richard Barry
e5696339e7 Remove unused header files from the STM32 discovery board library configuration file. 2011-04-08 12:00:48 +00:00
Richard Barry
37de268af4 Cosmetic work towards MISRA compliance statement pre release of V7. 2011-04-05 20:19:54 +00:00
Richard Barry
a1842621eb Remove unused library files from the STM32F100 TrueStudio project. 2011-04-05 13:41:35 +00:00
Richard Barry
87b622e0e8 Just change some of the comments in the STM32F100RB TrueStudio main.c file. 2011-04-05 09:46:43 +00:00
Richard Barry
8fc0c27ea5 Ensure that the configMAX_SYSCALL_INTERRUPT_PRIORITY setting works with all possible values. 2011-04-05 09:45:42 +00:00
Richard Barry
9133ceb44d Added STM32 discovery board simple demo project. 2011-04-04 18:54:14 +00:00
Richard Barry
3baaba8800 Rename the SmartFusion Debug build configuration to be the Blinky debug configuration as so far it only includes the basic simple demo. 2011-04-03 20:50:19 +00:00
Richard Barry
19bc9c8a48 Update the SmartFusion SoftConsole directory structure to include the webserver files. 2011-04-03 20:45:09 +00:00
Richard Barry
f74e406997 Add SmartFusion/SoftConsole demo. At the moment only the blinky configuration is included. The full configuration will be added soon. 2011-04-03 19:02:58 +00:00
Richard Barry
0e62058edb Added some trace macros into the timers.c file. 2011-04-01 18:45:44 +00:00
Richard Barry
afe9c0face Minor updates to the PIC32 MPLAB project to prevent it dumping .o files everywhere. 2011-04-01 18:19:34 +00:00
Richard Barry
8bd2d2f682 Add a #if ( configUSE_TIMERS ) conditional compilation constant in to allow the software timers source file to be included in a build that is not configured to use timers without resulting in linker errors. 2011-03-31 14:09:21 +00:00
Richard Barry
876caa2967 Replace portLONG with long, portCHAR with char, and portSHORT with short. 2011-03-27 18:51:55 +00:00
Richard Barry
85096f6159 Replace portLONG with long, portCHAR with char, and portSHORT with short. 2011-03-27 18:50:11 +00:00
Richard Barry
eeeb001d86 Removed the needs-lock SVN attribute from the PIC32 demo project file and workspace file. 2011-03-27 08:13:59 +00:00
Richard Barry
d8bab825bc Add a portNOP() implementation and relax the stack alignment requirements in the IAR MSP430X port layer. 2011-03-26 19:07:38 +00:00
Richard Barry
ce3d65938d Change the priorities used by the RX/RSK/Renesas demo application to ensure they can be used when configASSERT() is defined. Previously the priorities meant assert would have been called because one of the priorities used was above ( configMAX_PRIORITIES - 1 ). 2011-03-26 18:44:42 +00:00
Richard Barry
5421388be5 Change the priorities used by the RX/RSK/GCC demo application to ensure they can be used when configASSERT() is defined. Previously the priorities meant assert would have been called because one of the priorities used was above ( configMAX_PRIORITIES - 1 ). 2011-03-26 15:48:35 +00:00
Richard Barry
fdac74427d Change the priorities used by the RX/RSK/IAR demo application to ensure they can be used when configASSERT() is defined. Previously the priorities meant assert would have been called because one of the priorities used was above ( configMAX_PRIORITIES - 1 ). 2011-03-26 13:41:10 +00:00
Richard Barry
04c5d88e9d Change the priorities used by the RX/RDK/IAR demo application to ensure they can be used when configASSERT() is defined. Previously the priorities meant assert would have been called because one of the priorities used was above ( configMAX_PRIORITIES - 1 ). 2011-03-26 12:19:18 +00:00
Richard Barry
53b611d97a Change the priorities used by the RX/RDK/Renesas demo application to ensure they can be used when configASSERT() is defined. Previously the priorities meant assert would have been called because one of the priorities used was above ( configMAX_PRIORITIES - 1 ). 2011-03-26 11:33:54 +00:00
Richard Barry
89f0b2c0be Change the priorities used by the RX/RDK/GCC demo application to ensure they can be used when configASSERT() is defined. Previously the priorities meant assert would have been called because one of the priorities used was above ( configMAX_PRIORITIES - 1 ). 2011-03-26 10:35:16 +00:00
Richard Barry
ead29065e0 Allow the intqHIGHER_PRIORITY definition to be modified outside of the IntQueue.c file. 2011-03-26 10:00:29 +00:00
Richard Barry
eb16629f11 Update comments only in the MSP430X IAR main.c and serial.c files. 2011-03-24 19:37:18 +00:00
Richard Barry
c85523f870 Finalise MSP430X CCS4 port and demo. 2011-03-14 07:26:50 +00:00
Richard Barry
329c36c6bc Update the MSP430X CCS4 port layer. 2011-03-12 14:59:44 +00:00
Richard Barry
15c46025ab Update TimerDemo.c so it can be used with the CCS4 compiler without generating errors or warnings. 2011-03-12 14:58:09 +00:00
Richard Barry
0ced5cc699 Update the CCS4 MSP430X demo files. 2011-03-12 14:56:14 +00:00
Richard Barry
d53e65ed82 Tidy up timers API documentation comments. 2011-03-10 11:02:31 +00:00
Richard Barry
8a3fa98a2f Continue work on timers module documentation. 2011-03-09 13:49:35 +00:00
Richard Barry
0e133bc0fc Minor comment addition to queue.h. 2011-03-05 17:47:53 +00:00
Richard Barry
553a8389cc Start the documentation of the timer API functions and macros. About 50% done so far. 2011-03-05 17:46:55 +00:00
Richard Barry
a9558864b7 Update PIC24 project for use with the latest Microchip tools. 2011-03-01 15:18:46 +00:00
Richard Barry
605155cbcd Set configUSE_16_BIT_TICKS back to is proper (not test) configuration. 2011-02-28 17:58:09 +00:00
Richard Barry
06899603f3 Add the timer module demo code to the MSVC Win32 simulator demo. 2011-02-28 17:52:14 +00:00
Richard Barry
7b0841b1e9 Check in the timer module test/demo task. 2011-02-28 16:14:49 +00:00
Richard Barry
3f10f92340 Correct the configUSE_16_BIT_TICKS usage in the Win32 simulator port layer. 2011-02-28 16:12:55 +00:00
Richard Barry
95b2901ba6 Correct the configUSE_16_BIT_TICKS usage in the GCC Coldfire port layer. 2011-02-28 16:11:26 +00:00
Richard Barry
cb238fc1fa Finish off timers implementation. 2011-02-28 16:10:08 +00:00
Richard Barry
3c6ae51faf Finish off timers implementation. 2011-02-28 16:09:19 +00:00
Richard Barry
0c95f33e9f Finilise timers testing. 2011-02-27 13:08:44 +00:00
Richard Barry
2c1a85c90c Add some assertion points to timers.c. 2011-02-22 20:43:17 +00:00
Richard Barry
8b5a004be1 Continue testing timers module. Still a work in progress. 2011-02-21 10:52:36 +00:00
Richard Barry
8a9fb9554d Continue testing timers module. Still a work in progress. 2011-02-21 09:38:33 +00:00
Richard Barry
5c98d0eb7c Updates to timers.c related to module testing. 2011-02-20 11:05:54 +00:00
Richard Barry
efc3ba9d73 Updates to timers.c related to module testing. 2011-02-20 10:59:58 +00:00
Richard Barry
50dcd0c682 Move one of the configASSERT() statements in tasks.c to be inside the if() that checks whether the stack should grow up or down. 2011-02-18 17:40:30 +00:00
Richard Barry
7759f7c973 Spell check comments in TimerDemo.c. 2011-02-18 15:59:02 +00:00
Richard Barry
58a700b8f7 WIN32 simulator port: Allow the configTICK_RATE_HZ to be increased without making the sleep time in the simulated timer peripheral too small. 2011-02-14 13:49:50 +00:00
Richard Barry
412c2cc9a7 Add some configASSERT() calls. 2011-02-14 13:47:50 +00:00
Richard Barry
38821bf732 Continue work on the new timer implementation test application. Nearly complete. 2011-02-14 10:54:00 +00:00
Richard Barry
7d76fd568f Continue work on the new timer implementation test application. Nearly complete. 2011-02-14 10:52:52 +00:00
Richard Barry
b4ff4820cb Continue work on the new timer implementation. Nearly complete. 2011-02-14 10:51:18 +00:00
Richard Barry
07a2021676 Add ISR safe timer API. 2011-02-12 13:53:25 +00:00
Richard Barry
3ba433ed39 Continue adding some tick interrupt overflow protection to the timers module. This is not tested yet and still a work in progress. 2011-02-11 16:17:37 +00:00
Richard Barry
7ee534e4c2 Add some tick interrupt overflow protection to the timers module. This is not tested yet and still a work in progress. 2011-02-10 19:09:35 +00:00
Richard Barry
671ca2724e A bit of modularisation performed on the TimerDemo.c file - still a work in progress. 2011-02-10 19:08:14 +00:00
Richard Barry
0552fc86bf Commit before update to include overflow list functionality. 2011-02-10 17:20:36 +00:00
Richard Barry
f9148de3cc Add the timer demo/test task creating to the WIN32-MSVC/main.c file. 2011-02-09 19:30:44 +00:00
Richard Barry
8c9d8bcf0d Add constants to required to use the new timers implementation and the timer demo task/test task to the Win32 MSVC demo FreeRTOSConfig.h file. 2011-02-09 19:29:46 +00:00
Richard Barry
aceb8db846 Start creating a demo task/test task for the new timer implementation. Still a work in progress. 2011-02-09 19:28:21 +00:00
Richard Barry
91f0fc9cdd Minor updates to the core header files required by the new timer implementation. 2011-02-09 19:26:33 +00:00
Richard Barry
559532329d Minor updates to the queue.c and tasks.c core files required to support the new timers implementation. 2011-02-09 19:21:58 +00:00
Richard Barry
9d9b00b669 Correction to the draft timers module. Still a work in progress. 2011-02-09 19:20:12 +00:00
Richard Barry
7b97fe26c7 Remove the needs lock property. 2011-02-09 15:30:23 +00:00
Richard Barry
1cfa8cd9d8 Remove the needs lock property. 2011-02-09 15:27:26 +00:00
Richard Barry
8db5ded4b3 Continue work on the timers module. 2011-02-09 10:47:23 +00:00
Richard Barry
896d8c5d94 Continue work on the timers module. 2011-02-09 10:46:45 +00:00
Richard Barry
4a5f1529d0 Continue work on timers module - work in progress. 2011-02-08 16:21:15 +00:00
Richard Barry
812632fd1c Start an optional timers module implementation. 2011-02-08 15:21:31 +00:00
Richard Barry
4d2adb720b Start an optional timers module implementation. 2011-02-08 15:20:29 +00:00
Richard Barry
f5e7f9957c Change clock_time_t from a fixed unsigned long to portTickType so it works ok when configUSE_16_BIT_TICKS is set to 1. 2011-02-07 11:58:19 +00:00
Richard Barry
a5820e2b2a Make changes required for MISRA 2004 compliance. 2011-02-06 18:47:57 +00:00
Richard Barry
c26b230d28 Some time and code size optimisations. 2011-02-06 15:44:56 +00:00
Richard Barry
1374a17f73 Change occurrences of "Cortex M3" to "Cortex-M3". 2011-02-05 16:49:17 +00:00
Richard Barry
a22c519f5d Change occurrences of "Cortex M3" to "Cortex-M3". 2011-02-05 16:47:27 +00:00
Richard Barry
80a942e964 Change the case of an include file and a file name in the makefile for the SAM7X Eclipse demo to ensure it can be built on Linux. 2011-01-30 17:55:50 +00:00
Richard Barry
46c4d33d28 Add some comments to the PIC32 demos that the IPL setting in an ISR prototype has no effect if the FreeRTOS assembly wrapper is being used. 2011-01-29 15:49:42 +00:00
Richard Barry
14472a9499 Set the software interrupt priority to use configKERNEL_INTERRUPT_PRIORITY rather than being hard coded to 1. 2011-01-29 15:42:51 +00:00
Richard Barry
fc56459b46 Update the dsPIC MPLAB demo for use with the latest 3.25 version of the compiler. 2011-01-25 16:30:24 +00:00
Richard Barry
381785b968 Update the PIC24 MPLAB demo for use with the latest 3.25 version of the compiler. 2011-01-25 16:24:22 +00:00
Richard Barry
27effd446c Update the dsPIC MPLAB demo for use with the latest 3.25 version of the compiler. 2011-01-25 15:56:09 +00:00
Richard Barry
d89c43c7aa Update the PIC32 project to better structure the files in the MPLAB project window, and test that it works with the latest V1.12 C32 compiler. 2011-01-25 15:26:53 +00:00
Richard Barry
0079d00fec Remove unreferenced variables from main.c for the PSoC 5 demos. 2011-01-25 10:16:20 +00:00
Richard Barry
063a1538c7 Remove the memory hole in the linker MSP430X/IAR linker script that was a left over from the TI User Experience demo (which required the hole). 2011-01-19 16:40:55 +00:00
Richard Barry
6bf111e94a Update the MSP430X/IAR demo project to support the medium data model. 2011-01-18 20:34:38 +00:00
Richard Barry
c679af3ba8 Update the MSP430X/IAR port layer to support the medium data model. 2011-01-18 20:33:35 +00:00
Richard Barry
bc87cc4cb7 Tidy up the IAR MSP430X demo serial.c file. 2011-01-18 19:55:13 +00:00
Richard Barry
334e0e2e70 Update to V6.1.1 2011-01-14 20:40:41 +00:00
Richard Barry
139b80f57e Update to V6.1.1 2011-01-14 20:31:45 +00:00
Richard Barry
6fac5cfd4c Update to V6.1.1 2011-01-14 20:25:54 +00:00
Richard Barry
96ab89d253 Update to V6.1.1 2011-01-14 20:22:24 +00:00
Richard Barry
399d8c47c7 Second phase of changing the directory that starts Cortex, with one that starts CORTEX. 2011-01-14 18:45:00 +00:00
Richard Barry
7004e0308a Second phase of changing the directory that starts Cortex, with one that starts CORTEX. 2011-01-14 18:44:23 +00:00
Richard Barry
a7b2373bcc First phase of changing the directory that starts Cortex, with one that starts CORTEX. 2011-01-14 18:42:44 +00:00
Richard Barry
5cc153cfb1 First phase of changing the directory that starts Cortex, with one that starts CORTEX. 2011-01-14 18:40:20 +00:00
Richard Barry
9e00460ce1 Update the RX600 HEW projects to use the new J-Link DLL. 2011-01-14 18:34:29 +00:00
Richard Barry
7a337142ff Increase the stack sizes in the IAR / MSP430X demo. 2011-01-13 19:08:36 +00:00
Richard Barry
fb18eeb96c Make the generation of run time stats percentages more efficient. 2011-01-13 19:04:57 +00:00
Richard Barry
411364dab6 Add the .align, .asmfunc and .endasmfunc directives to the CCS MSP430X port layer. 2011-01-13 10:36:42 +00:00
Richard Barry
749edf57e7 Make the tick ISR entry function use the __raw attribute in the IAR MSP430X port layer. 2011-01-13 10:28:40 +00:00
Richard Barry
6b661d03a5 Remove unnecessary calls to fflush() in MSP430X/IAR demo. 2011-01-13 10:27:06 +00:00
Richard Barry
01f4b87dba Increase the MCLK frequency to 25MHz in the IAR MSP430X demo. 2011-01-12 12:33:38 +00:00
Richard Barry
89669ae861 Increase the MCLK frequency to 25MHz in the CCS MSP430X demo. 2011-01-12 12:32:33 +00:00
Richard Barry
7676ec0b66 Make use of the .align assembler directive in the reg test asm file of the MSP430X/CCS demo. 2011-01-12 12:15:03 +00:00
Richard Barry
4b895698ca Rename the UART ISR in the MSP430X/CCS demo to match the UART actually being used. 2011-01-12 12:13:26 +00:00
Richard Barry
1b04552233 Make use of the EVEN assembler directive in the IAR MSP430X port layer. 2011-01-12 10:00:13 +00:00
Richard Barry
10bc087ef9 Make use of the EVEN assembler directive in the reg test asm file of the MSP430X/IAR demo. 2011-01-12 09:58:51 +00:00
Richard Barry
5a0782e3a8 Set the low power mode entered in the idle hook to 3 in the MSP430X/IAR demo. 2011-01-12 09:58:08 +00:00
Richard Barry
8d33f44809 Rename the UART ISR in the MSP430X/IAR demo to match the UART actually being used. 2011-01-12 09:56:56 +00:00
Richard Barry
dccbf6a271 Ensure the MSp430X IAR project only has main.c open when the workspace is opened. 2011-01-06 11:18:06 +00:00
Richard Barry
6f4805423f Set the STM32L152 compiler options to use the tiny printf formatter. 2011-01-06 11:11:43 +00:00
Richard Barry
e4f2ba1913 Introduce option that permits a smaller printf() library to be used when sizeof( int ) == sizeof( long ) in cases where formatted strings are used to present run time stats information. 2011-01-06 11:10:51 +00:00
Richard Barry
7a71523712 Replace the function that returns the current run time counter value with a macro for easier inlining. 2011-01-06 10:50:31 +00:00
Richard Barry
d493958052 Change the #error text in croutine.h only. 2011-01-06 10:49:20 +00:00
Richard Barry
95080a22f2 Introduce the portALT_GET_RUN_TIME_COUNTER_VALUE macro as an alternative to portGET_RUN_TIME_COUNTER_VALUE to make inlining of the run time stats functions easier. 2011-01-06 10:08:07 +00:00
Richard Barry
f57fa8bf72 Replace the function that returns the current run time counter value with a macro for easier inlining. 2011-01-06 10:06:09 +00:00
Richard Barry
12949b4507 Replace the function that returns the current run time counter value with a macro for easier inlining. 2011-01-06 09:55:05 +00:00
Richard Barry
25bc4acc6a Update the run time stats generation algorithm for the MSP430X IAR port. 2011-01-05 20:20:17 +00:00
Richard Barry
6331341d97 Minor formatting changes to the Keil and RVDS PSoC5 demos. 2011-01-05 14:16:28 +00:00
Richard Barry
ad3207a226 Minor formatting changes to the GCC PSoC demo. 2011-01-05 14:10:14 +00:00
Richard Barry
17e1e7dfd3 A little extra commenting added to the Cortex M3 port layers. 2011-01-05 13:36:35 +00:00
Richard Barry
3ff33205eb Added PSoC5 demo applications. 2011-01-04 17:40:27 +00:00
Richard Barry
b77d801de0 Remove the queue registry from the MSP430X CCS port as the state viewer plug in does not work in CCS. 2011-01-04 14:37:53 +00:00
Richard Barry
50cc4026db Allow the register test asm code in the CCS4 MSP430X demo to use any data model. 2011-01-04 14:36:35 +00:00
Richard Barry
20ddcce965 Allow the MSP430X IAR port layer to skip pre-loading all register values for created tasks. 2011-01-04 14:32:52 +00:00
Richard Barry
9a24d4a37f Convert the CCS4 MSP430X port layer to permit large and small data models, and large and small code models. 2011-01-03 16:48:59 +00:00
Richard Barry
2c894e0f55 Add build configurations for small data model and small code model tests to the MSP430X CCS4 demo project. 2011-01-03 16:41:42 +00:00
Richard Barry
16daa60de7 Tidy up the run time stats generation in the MSP430X IAR port. 2011-01-03 12:06:49 +00:00
Richard Barry
b41417d89b Add a small data model build configuration to the IAR MSP430X demo project. 2011-01-03 11:43:34 +00:00
Richard Barry
d195639bc1 Start to adjust to support both small and large memory models in the MSP430X IAR port layer. 2011-01-03 11:31:41 +00:00
Richard Barry
19fcd2d505 Start to adjust to support both small and large memory models in the MSP430X IAR demo. 2011-01-03 11:30:11 +00:00
Richard Barry
4059be7918 Minor updates to the MSP430X CCS4 and IAR port layers.
Change the sprintf() in prvGenerateRunTimeStatsForTasksInList() to accept unsigned long instead of unsigned int parameters so it works on 16bit devices too.
2011-01-02 18:35:52 +00:00
Richard Barry
1b96233cf1 Minor updates to the MSP430X CCS4 demo application. 2011-01-02 18:31:30 +00:00
Richard Barry
2b92b7a5d9 Minor updates to the MSP430X CCS4 demo application. 2011-01-02 18:19:12 +00:00
Richard Barry
947524522b Minor updates to the MSP430X IAR demo application. 2011-01-02 18:17:22 +00:00
Richard Barry
8d532ab4a7 Ensure that main() is always placed in low memory in the CCS4 MSP430X port. 2011-01-01 20:57:17 +00:00
Richard Barry
811413d95a Ensure that main() is always placed in low memory in the IAR MSP430X port. 2011-01-01 20:56:23 +00:00
Richard Barry
a9b61c4e00 Add warning line into the CCS4/MSP430X project to prompt the use of the CreateProjectDirectoryStructure.bat batch file. 2011-01-01 17:35:20 +00:00
Richard Barry
ab56e7ccbb Formatting only. 2011-01-01 17:24:46 +00:00
Richard Barry
304495350c Remove unnecessary ';' characters from a couple of macro definitions in the IAR MSP430X port layer. 2011-01-01 17:24:03 +00:00
Richard Barry
a6132cbbad Add MSP430X CCS4 port layer. 2011-01-01 17:23:00 +00:00
Richard Barry
2cf5546e11 Add MSP430X CCS4 demo project. 2011-01-01 17:22:05 +00:00
Richard Barry
34f15ddecd Prepare the MSP430X IAR demo for release. 2011-01-01 11:27:48 +00:00
Richard Barry
eb94f856a8 Add the debugger settings to the MSP430X IAR demo directory. 2011-01-01 09:32:55 +00:00
Richard Barry
0249ad47f4 Continue work on the MSP430X demo - still a work in progress. 2011-01-01 09:23:37 +00:00
Richard Barry
7bc73115a5 Add TI library files necessary to build MSP430X demo. Still a work in progress. 2010-12-31 18:56:23 +00:00
Richard Barry
b236356621 Continue development of the MSP430X port layer for IAR. Still a work in progress. 2010-12-31 17:55:52 +00:00
Richard Barry
b54a5232c6 Continue work on the MSP430X demo - still a work in progress. 2010-12-31 17:54:29 +00:00
Richard Barry
ae6380f70b Continue to develop the MSP430X IAR demo project - still a work in progress. 2010-12-31 14:51:15 +00:00
Richard Barry
df4e7ceba0 Continue to develop the MSP430X IAR demo project - still a work in progress. 2010-12-30 14:01:21 +00:00
Richard Barry
38055abf18 Change vTickISR() to vPortTickISR() in the MSP430X IAR port layer. 2010-12-30 14:00:30 +00:00
Richard Barry
98720fb72e Start to write the MSP430X demo. 2010-12-29 22:07:52 +00:00
Richard Barry
96e499775a Create directory to hold the MSP430X demo. 2010-12-29 22:06:46 +00:00
Richard Barry
a109f862a7 Rename a function in the STM32L demo to conform to the coding standard for private functions. 2010-12-29 22:05:28 +00:00
Richard Barry
c7a110a853 Tidy up the port layer for the MSP430X IAR port - still a work in progress. 2010-12-29 18:46:02 +00:00
Richard Barry
0a31276719 Continue development of MSP430X port. 2010-12-29 14:35:40 +00:00
Richard Barry
e7e623f853 Continue development of MSP430X port. 2010-12-28 18:40:12 +00:00
Richard Barry
b20be831b7 Start work on official MSP430X port layer for IAR. 2010-12-28 15:22:17 +00:00
Richard Barry
c83d421388 Finish the STM32L152 demo application. 2010-12-23 19:41:05 +00:00
Richard Barry
f6a1714b46 Added two missing STM32 peripheral drivers from the STM32L152 demo project. 2010-12-23 17:10:24 +00:00
Richard Barry
ecc01bdbe8 Comment and spell check the STM32L152 demo project. 2010-12-23 17:04:34 +00:00
Richard Barry
556fc15e99 Enter sleep mode in the idle task. 2010-12-23 11:24:14 +00:00
Richard Barry
52b4c95301 Complete the STM32L152 demo application functionality - it is still to be 'productionised'. 2010-12-23 11:03:07 +00:00
Richard Barry
7fd1d847fb Modify vTaskGetRunTimeStats() to ensure the current run time total is obtained from within a critical section. This allows greater flexibility in how the run time counter value is maintained. 2010-12-23 10:40:13 +00:00
Richard Barry
a67c624894 Add an cpsie i before the SVC call that starts the scheduler. This is just in case the C start up code leaves interrupts globally disabled. 2010-12-23 10:39:02 +00:00
Richard Barry
6046eea342 Allow RX YRDK demos to work with Rev1 and Rev3 boards, and with any web browser. 2010-12-22 15:18:30 +00:00
Richard Barry
7b9a3e0707 Added a few system files to the repository for the STM32L152 demo. 2010-12-21 16:34:38 +00:00
Richard Barry
9c507b93d7 Continued development on STM32L152 demo. 2010-12-21 16:09:34 +00:00
Richard Barry
7243d65797 Still updating the STM32L demo project - still a work in progress. 2010-12-20 12:14:45 +00:00
Richard Barry
d26c31e518 Still updating the STM32L demo project - still a work in progress. 2010-12-19 23:19:02 +00:00
Richard Barry
c015ea5cfe Developing STM32L152 demo - still a work in progress. 2010-12-19 20:31:41 +00:00
Richard Barry
69d1fc1a13 Starting point for the STM32L152 demo application added. Very much a work in progress. 2010-12-19 19:20:56 +00:00
Richard Barry
ed2a5c4ed0 Updated comments only on Demo/Common/Minimal/recmutex.c 2010-12-10 16:33:14 +00:00
Richard Barry
71fd1adbad Removed the nonsensical parameter from the traceTASK_CREATE_FAILED() macro in tasks.c. 2010-12-08 20:25:24 +00:00
Richard Barry
dc8f964534 Edited the #error message to remove the " marks from the middle of the string.
Used a conditional compilation around the task tag related functions to loosen the strict header file inclusion ordering.
2010-12-08 18:59:30 +00:00
Richard Barry
14dbfbb861 Removed the nonsensical parameter from the traceTASK_CREATE_FAILED() macro in tasks.c. 2010-12-08 18:58:01 +00:00
Richard Barry
5347d4fa8f Change the terminology from 'pseudo' to 'simulated' in the Win32 port layer. 2010-12-08 17:10:25 +00:00
Richard Barry
1677ec5c60 Update the Red Suite LPC1768 project and source to use the latest version of the tools. 2010-11-25 13:21:39 +00:00
Richard Barry
19cdcbd681 Delete the now obsolete syscalls.c file from the Red Suite LPC17xx demo. 2010-11-24 20:53:55 +00:00
Richard Barry
9fa197fa9c Update the CMSIS files included in the Red Suite LPC17xx demo. 2010-11-24 20:53:02 +00:00
Richard Barry
93b74b6f8d Remove the 'death' tasks from the demo as on Win2K and WinXP the behaviour of the TerminateThread() function is such that resources leak and eventually the 'death' tests will fail. 2010-11-22 16:11:16 +00:00
Richard Barry
97ce25072a Remove the 'death' tasks from the demo as on Win2K and WinXP the behaviour of the TerminateThread() function is such that resources leak and eventually the 'death' tests will fail. 2010-11-22 16:10:42 +00:00
Richard Barry
f3dbcaf725 Added in the 'death' tasks to the MingW Win32 demo. 2010-11-22 10:46:54 +00:00
Richard Barry
853250260c Added in the 'death' tasks to the Win32 MSVN demo. 2010-11-22 10:40:43 +00:00
Richard Barry
ab9bf58818 Win32 port:
Separate out the interrupt handlers into separate functions so they can be installed into the array of interrupt handlers.
Reverse the priorities of the pseudo interrupt handler and tick generate threads so the extra hand shaking event can be removed.
2010-11-22 10:38:43 +00:00
Richard Barry
0ecde20ab3 Lowered the thread priorities used by the Win32 port, and added in a method to delete tasks in the Win32 port. 2010-11-22 09:52:36 +00:00
Richard Barry
a3c26cad3d Update to MSVC Win32 demo project file. 2010-11-21 21:00:46 +00:00
Richard Barry
b09733cdfc Added the MingW/Eclipse project for the new Win32 port. 2010-11-21 20:59:57 +00:00
Richard Barry
ba18beae47 Greatly simplified the Win32 port by only allowing threads to run on a single CPU core. 2010-11-21 20:55:04 +00:00
Richard Barry
6b9379ee87 Greatly simplified the Win32 port by only allowing threads to run on a single CPU core. 2010-11-21 20:53:13 +00:00
Richard Barry
d50618f375 Remove unused definitions from the Win32 demo main.c file. 2010-11-21 14:50:43 +00:00
Richard Barry
bbcdcb0ba1 Just changed the comments only for the Win32 port.c file. 2010-11-21 14:36:36 +00:00
Richard Barry
abadea4557 Updated the Win32 MSVC demo files. 2010-11-21 14:35:36 +00:00
Richard Barry
37b6fb5773 Changed vPortCheckCorrectThreadIsRunning() in the Win32 port layer to use the Win32 thread ID rather than its handle. 2010-11-21 14:06:23 +00:00
Richard Barry
60bea08b22 Added the traceTAKE_MUTEX_RECURSIVE_FAILED() macro. 2010-11-21 11:35:48 +00:00
Richard Barry
2fc309624b Added vPortCheckCorrectThreadIsRunning() function to the Win32 port layer to trap when Windows is not running the correct thread and try and catch it. 2010-11-21 11:34:12 +00:00
Richard Barry
1ae93fbb63 Add in a missing initialisation to zero for a variable in recmutex.c. Should not really make any difference as the variable should be cleared to zero by the C start up code anyway. 2010-11-20 14:37:25 +00:00
Richard Barry
e867904a89 Remove the trace lines from the Win32 port.c. 2010-11-20 14:20:09 +00:00
Richard Barry
ab2eb016c1 Work on Win32 port layer - removing the need to store the critical section nesting count as part of the Win32 thread context. 2010-11-19 22:37:02 +00:00
Richard Barry
8133188eee Win32 port.c - working ok in co-operative mode, but pre-emptive thread scheduling still problematic. 2010-11-18 16:41:44 +00:00
Richard Barry
a49f0aa88a Spell check Win32 port.c only. 2010-11-16 10:33:50 +00:00
Richard Barry
0de50e377c Added in more demo apps to the Win32 demo. 2010-11-15 22:30:47 +00:00
Richard Barry
c30b4242bb Replace waitable timer with sleep function in Win32 port layer. 2010-11-15 22:29:28 +00:00
Richard Barry
93b07f3db7 Updated Win32 port layer so that end of interrupt events are only sent to threads that are actually waiting for them. 2010-11-15 20:23:08 +00:00
Richard Barry
9a0b608591 Start of new Win32 emulator project. Currently working but not well tested, and does not include a method for shutting down the generated processes. 2010-11-14 21:01:50 +00:00
Richard Barry
7a623479dd Start of new Win32 emulator project. Currently working but not well tested, and does not include a method for shutting down the generated processes. 2010-11-14 21:00:36 +00:00
Richard Barry
3b6ed5341f Update the IP address copy macro so it never relies on any byte alignment. 2010-11-08 21:59:23 +00:00
Richard Barry
86e6ede04c Update to FreeRTOS V6.1.0 release candidate. 2010-09-23 18:07:41 +00:00
Richard Barry
4778bd45e7 Update to FreeRTOS V6.1.0 release candidate. 2010-09-23 16:36:25 +00:00
Richard Barry
7ce7d21ca8 Allow tasks to be suspended immediately after creation - provided the scheduler is not running.
Add API function that allows the tick count to be queried from an interrupt.
2010-09-23 13:54:37 +00:00
Richard Barry
ad451e8b70 Remove the .dep file from the IAR RX project. The file should not have been included in the first place. 2010-09-23 13:41:47 +00:00
Richard Barry
fd5aeffadd Replace the hard coded interrupt priorities with the configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY definitions in the IAR RX port layer. 2010-09-23 13:39:45 +00:00
Richard Barry
bdef78d6a2 Prepare the RX GNU demo application for release. 2010-09-23 13:14:34 +00:00
Richard Barry
f352dc846b Replace the hard coded interrupt priorities with the configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY definitions in the IAR RX port layer. 2010-09-23 13:13:26 +00:00
Richard Barry
66c1a9b76d Replace asm wrappers to interrupt handlers with functions that use the interrupt attribute. 2010-09-22 22:03:40 +00:00
Richard Barry
c92128869d Replace asm wrappers to interrupt handlers with functions that use the interrupt attribute. 2010-09-22 22:02:54 +00:00
Richard Barry
eea2ab0385 Back only. 2010-09-22 21:31:33 +00:00
Richard Barry
8c8efdcc4e Back only. 2010-09-22 21:29:57 +00:00
Richard Barry
b4d26652b9 Start process of changing project name to include RDK in its title to place of RSK. 2010-09-22 13:00:51 +00:00
Richard Barry
f4aa3f61e1 Start process of changing project name to include RDK in its title to place of RSK. 2010-09-22 12:59:42 +00:00
Richard Barry
45fad778a4 Start to iron out the mods required in switching from the RX RSK hardware to the RDK hardware. 2010-09-22 12:57:57 +00:00
Richard Barry
17add98d2f Starting point for the RX RDK version of the demo app. 2010-09-22 12:48:21 +00:00
Richard Barry
07006b001e Prepare the RSK RX demo for conversion to run on the RDK. 2010-09-22 09:25:13 +00:00
Richard Barry
828d8df74e Start to change the GNURX project name to use RSK in place of MDK. 2010-09-22 09:16:08 +00:00
Richard Barry
270a06fb9a Start to change the GNURX project name to use RSK in place of MDK. 2010-09-22 09:14:55 +00:00
Richard Barry
edfeb212ae Change the RX/GCC memory map to move the stacks further away from the .data section. 2010-09-22 08:32:22 +00:00
Richard Barry
296c1eabfc Formatting only. 2010-09-21 21:11:42 +00:00
Richard Barry
f052e7c00f When creating a task - move where the task handle is assigned to the function parameter from after the critical section. This allows the handle to be assigned to a global variable, and the global variable to be access by the task being created should the task being created execute immediately that the critical section is exited. 2010-09-21 21:10:41 +00:00
Richard Barry
1ec24e1d46 Remove possibility of having multiple definitions of DEBUG in uip_arp.c. 2010-09-21 21:06:16 +00:00
Richard Barry
b2238eb8c0 Update the RX GCC port - optimised build is working, unoptimised not. 2010-09-21 21:04:39 +00:00
Richard Barry
1c56717a0f RX GCC port - Introduce macros that perform the interrupt entry and exit manually, then move the asm code back as naked functions within the port.c file. 2010-09-20 20:02:48 +00:00
Richard Barry
0ef04cd7bd RX GCC port - Introduce macros that perform the interrupt entry and exit manually, then move the asm code back as naked functions within the port.c file. 2010-09-20 20:01:00 +00:00
Richard Barry
c788ecec17 Rename MDK to RSK for the RX ports. 2010-09-20 11:20:51 +00:00
Richard Barry
0615862c9e Temporarily revert the AVR32 port back to the V6.0.5 files. Work will continue on the reverted files following the next release. 2010-09-20 11:16:19 +00:00
Richard Barry
ef35a4aab1 Temporarily revert the AVR32 port back to the V6.0.5 files. Work will continue on the reverted files following the next release. 2010-09-20 11:11:34 +00:00
Richard Barry
18f5af7195 Temporarily revert the AVR32 port back to the V6.0.5 files. Work will continue on the reverted files following the next release. 2010-09-20 11:08:39 +00:00
Richard Barry
8f6f5820aa 2010-09-20 10:44:40 +00:00
Richard Barry
d7d63dbe77 2010-09-20 10:43:23 +00:00
Richard Barry
47354eddcb Update SAM3U project to use new flash loader settings. 2010-09-18 14:05:49 +00:00
Richard Barry
55c6e20370 Update to build with C99. 2010-09-18 13:41:28 +00:00
Richard Barry
feecfc5319 Update the definition of __inline to build with C99. 2010-09-18 13:33:52 +00:00
Richard Barry
25f980aabe Update the definition of __inline to build with C99. 2010-09-18 13:24:26 +00:00
Richard Barry
d27e63a8ca Update the definition of __inline to build with C99. 2010-09-18 13:20:52 +00:00
Richard Barry
59204f7720 Commit the RX IAR projects ready for release. 2010-09-14 15:35:38 +00:00
Richard Barry
e77c5ca723 Commit the RX Renesas/HEW projects ready for release. 2010-09-14 15:35:00 +00:00
Richard Barry
84394bf0a9 Commit the RX IAR projects ready for release. 2010-09-14 13:57:49 +00:00
Richard Barry
2a44b5641d Commit the RX IAR projects ready for release. 2010-09-14 13:48:11 +00:00
Richard Barry
0723a674f2 First version of IAR project for RX RDK added. 2010-09-13 10:39:40 +00:00
Richard Barry
5f95494dff FreeTCPIP - remove compiler warnings. 2010-09-12 21:06:00 +00:00
Richard Barry
f43bd20a6d Tidy up the RDK/Renesas/RX port to get rid of compiler warnings, and correct some of the variable naming. 2010-09-12 21:02:55 +00:00
Richard Barry
2cf67be590 Tidy up the MDK/Renesas/RX port to get rid of compiler warnings, and correct some of the variable naming. 2010-09-12 21:01:29 +00:00
Richard Barry
9c3e8b0228 Add in web server to RX/IAR demo application. 2010-09-12 20:56:04 +00:00
Richard Barry
c7fbe1d601 Some re-formatting of uip.c. 2010-09-10 18:45:22 +00:00
Richard Barry
2641267c85 Some re-formatting of uip.c. 2010-09-10 18:40:31 +00:00
Richard Barry
904e22b667 Include pack struct macros for RX architecture. 2010-09-09 19:47:24 +00:00
Richard Barry
e4c8a7957f Prepare RX RDK project for release. 2010-09-09 19:43:56 +00:00
Richard Barry
3780491aeb Prepare RX MDK project for release. 2010-09-09 18:31:16 +00:00
Richard Barry
23ca0009e3 Update the RX MDK demo to include the web server. Minor tidy up to the RDK version too. 2010-09-09 16:26:42 +00:00
Richard Barry
2fca46e3e4 Changed buffer configuration in Ethernet driver for RX RDK port. 2010-09-09 09:54:18 +00:00
Richard Barry
ccf36aeed4 Removed the critical section that was left in by mistake. Also changed the delay period while waiting for the Ethernet semaphore. Both in the RX RDK demo. 2010-09-09 09:41:52 +00:00
Richard Barry
a91ec6efe7 Updated compiler version for RX RDK demo and completed initial web server demo. Still some tidying up to do. 2010-09-09 08:39:10 +00:00
Richard Barry
a4893aed60 Start to configure the uIP demo for the RX RDK hardware. ping is working, but thus far the web server is not. 2010-09-05 20:06:30 +00:00
Richard Barry
2e0af9b6e6 Add low level Ethernet driver files to the RX RDK project. 2010-09-04 18:29:56 +00:00
Richard Barry
f14011feb3 All relating to the RX600 RDK demo - which is still a work in progress:
Change LED numbers to match silk screen.
Include Ethernet port pin configuration in HardwareSetup().
Convert EMAC.c to be correct for the RX (was based on SH2A file).
Add uIP task creation into main.c.
2010-09-04 18:20:45 +00:00
Richard Barry
817859005a Removed files/directories that were accidentally added to the wrong base directory. 2010-09-02 09:14:39 +00:00
Richard Barry
ee077a6b9a Starting point for the RDK webserver files added. 2010-09-02 09:13:14 +00:00
Richard Barry
659a27800f Starting point for the RDK webserver files added. 2010-09-02 09:06:39 +00:00
Richard Barry
0363b47c66 Correct some of the LED usage in the RX demos - where apparently two wrongs did make a right. 2010-08-31 18:14:37 +00:00
Richard Barry
a47ead46e8 Start of project for the RDK board. Not yet complete. 2010-08-31 18:11:19 +00:00
Richard Barry
bb26ea557f Some changes to the RX/Renesas main-full.c file to tidy up a bit. 2010-08-29 18:05:06 +00:00
Richard Barry
c1dca1a069 Added a critical section around the call to vTaskIncrementTick() in all the RX ports. 2010-08-29 17:57:32 +00:00
Richard Barry
9f83e74cb1 Work on the RX62N IAR demo, which is now functional. 2010-08-29 17:15:14 +00:00
Richard Barry
50b4b6619d Minor tidying up of IntQueue.c to prevent compiler warnings. No functional difference. 2010-08-29 17:13:46 +00:00
Richard Barry
5c75dd907e Update the IAR RX62N port files, which are now functional. 2010-08-29 17:12:12 +00:00
Richard Barry
a418d78163 Start point for RX62N port layer for IAR - not necessarily complete yet. 2010-08-29 14:12:05 +00:00
Richard Barry
7768a4e02c Starting point for an IAR RX62N project - not yet a working project. 2010-08-29 14:10:58 +00:00
Richard Barry
9af437a3a9 Simply tidy up the bracketing of a couple of expressions in tasks.c. 2010-08-29 07:25:09 +00:00
Richard Barry
c4217432f2 Update RX GCC port - including extracting all inline asm into separate asm file. 2010-08-29 07:24:30 +00:00
Richard Barry
23b1023a7a Remove the Renesas RX project that had the old directory name. This has been updated so the board the project uses in the name of the demo directory. 2010-08-29 07:23:06 +00:00
Richard Barry
ddf4f4eb1e Check in the RX/GCC demo for backup purposes - this is not yet a working project. 2010-08-29 07:19:34 +00:00
Richard Barry
0fcac53cf8 Continued work on the RX62N GCC demo - just a work in progress currently. 2010-08-26 16:01:58 +00:00
Richard Barry
314b692440 Create starting point for RX62N GCC port. Just a work in progress at the moment. 2010-08-26 15:59:25 +00:00
Richard Barry
1ee62d835d Create starting point for GNURX RX62N HEW project. 2010-08-25 16:06:53 +00:00
Richard Barry
8c5b77635e Add a -1 to the calculation of the compare match value. 2010-08-23 15:59:07 +00:00
Richard Barry
ac19e40336 Just tidy up the RX port files. 2010-08-22 18:28:48 +00:00
Richard Barry
a33e3b3979 Corrected comment in SH2A demo project main.c. 2010-08-22 11:46:36 +00:00
Richard Barry
4b8e4c7520 Continue development, plus add Blinky build configuration. 2010-08-22 11:45:24 +00:00
Richard Barry
cfc3911721 Changed RX project directory structure and name. 2010-08-22 08:44:51 +00:00
Richard Barry
9391d8a186 Continue development on RX port - work in progress. 2010-08-22 08:32:09 +00:00
Richard Barry
68201d2f99 Added a lot more standard demo tasks to the RX demo. 2010-08-20 19:42:40 +00:00
Richard Barry
cc7c4acf02 Added IntQueue demo/test to the RX demo. 2010-08-20 19:11:56 +00:00
Richard Barry
27683e7360 Implemented portYIELD_FROM_ISR() for RX port. 2010-08-20 19:10:42 +00:00
Richard Barry
4b3cf6221b Continue work on RX600 port - work in progress. 2010-08-18 20:36:44 +00:00
Richard Barry
810f45a61c Continue work on RX600 port - work in progress - add the actual context switch function. 2010-08-18 20:36:00 +00:00
Richard Barry
64fc1907ec Continue work on RX600 port - work in progress. 2010-08-18 13:31:12 +00:00
Richard Barry
df410c7e27 Continue work on RX600 port - work in progress. 2010-08-18 13:29:12 +00:00
Richard Barry
49c5f327fc Add new file to RX demo. 2010-08-16 10:40:33 +00:00
Richard Barry
383f0b0f2f Continue work on RX600 port - work in progress. Added the SET/CLEAR from ISR macros. 2010-08-13 17:49:15 +00:00
Richard Barry
21898cc9d9 Continue work on RX600 port - work in progress. 2010-08-13 17:38:50 +00:00
Richard Barry
6052827afe Continue work on RX600 port - work in progress. 2010-08-13 17:37:36 +00:00
Richard Barry
3e4eb6e7ae Continue work on RX600 port - work in progress. 2010-08-13 10:21:54 +00:00
Richard Barry
fc050c4ab9 Continue work on RX600 port - work in progress. 2010-08-13 07:17:30 +00:00
Richard Barry
c8e98a097e Starting point for new port - a project that will build, but as yet no implementation. 2010-08-12 13:22:25 +00:00
Richard Barry
b2929dc036 Starting point for new port - a project that will build, but as yet no implementation. 2010-08-12 13:19:52 +00:00
Richard Barry
e854ebf1f5 Just tidy up indentation in SuperH port.c. 2010-08-11 17:56:33 +00:00
Richard Barry
8f6e5062d4 Changed how the calculation of xFreeBytesRemaining is performed in the case where a block of RAM is split before being returned to the callee. 2010-07-20 18:46:12 +00:00
Richard Barry
65d501d718 Continue development of STM32 Rowley demo. 2010-07-07 11:48:04 +00:00
Richard Barry
28b5ea32a4 Add in a basic USART driver and echo test task. 2010-07-06 21:12:01 +00:00
Richard Barry
4ab0313273 Continue work on new AVR32 port and demo. 2010-06-21 14:57:05 +00:00
Richard Barry
47cfc16aa0 Add batch file that generates the local directory structure to allow the new AVR32 UC3 demo to be build using an Eclipse managed make project. 2010-06-13 17:34:45 +00:00
Richard Barry
8405dbe3d5 Create an updated AVR32 UC3A project. 2010-06-13 14:10:42 +00:00
Richard Barry
d31b403659 Create an updated AVR32 UC3A project. 2010-06-13 14:05:36 +00:00
Richard Barry
52ceb8de51 Create an updated AVR32 UC3A project. 2010-06-13 14:02:53 +00:00
Richard Barry
025b08cddf Create an updated AVR32 UC3A project. 2010-06-13 14:01:59 +00:00
Richard Barry
7bee13dfdc Removed outdated AVR32 demo. 2010-06-13 13:57:47 +00:00
Richard Barry
357f7fe56a Removed outdated AVR32 demo. 2010-06-13 13:55:37 +00:00
Richard Barry
1b2d31eac4 Removed outdated AVR32 demo. 2010-06-13 13:54:06 +00:00
Richard Barry
d09fcd3abe Removed outdated AVR32 demo. 2010-06-13 13:53:05 +00:00
Richard Barry
61dc1e332a Removed outdated AVR32 demo. 2010-06-13 13:52:31 +00:00
Richard Barry
c63be7c451 Just updated the version string #define. 2010-06-13 13:41:18 +00:00
Richard Barry
e03f239692 Work in progress - checked in for backup only. 2010-06-07 15:24:50 +00:00
Richard Barry
02db572328 Renamed ParTest.c to ParTest_MSBSTM32.c so an alternative ParTest can also be included. 2010-06-07 14:31:13 +00:00
Richard Barry
5472e527b5 Added STM32 Rowley demo. 2010-06-04 14:45:49 +00:00
Richard Barry
fa73924b8d Add Cortus port to produce V6.0.5. 2010-05-17 18:16:17 +00:00
Richard Barry
f89b22f9d1 Add Cortus port to produce V6.0.5. 2010-05-17 18:12:16 +00:00
Richard Barry
6818a478c6 Add Cortus port to produce V6.0.5. 2010-05-17 18:06:11 +00:00
Richard Barry
9a54446449 Add Cortus port to produce V6.0.5. 2010-05-17 18:00:27 +00:00
Richard Barry
c73b3dc304 Add Cortus port to produce V6.0.5. 2010-05-17 15:41:58 +00:00
Richard Barry
4a5ea9e237 Add exit() function just to prevent loads of the standard library from being included in the build. 2010-05-17 14:52:27 +00:00
Richard Barry
18d6c565e6 Corrected mistake in sample code for xCoRoutineCreate(). 2010-05-01 01:35:52 +00:00
Richard Barry
1aca141247 Update comments at head of Cortus demo files to show correct version number. 2010-03-30 13:01:00 +00:00
Richard Barry
a2b1a64ba1 Finish off the Cortus demo application:
+ Add a traceTASK_SWITCHED_OUT macro as part of the RegTest.c.
+ Add task to test the saving and restoring of the interrupt mask.
+ Change the serial port interrupt handlers to use naked functions.
2010-03-29 14:04:11 +00:00
Richard Barry
f4d8802850 Modify Cortus save and restore macros to save and restore the entire context, so as not to rely on anything the compiler is doing. 2010-03-29 14:01:36 +00:00
Richard Barry
1ae4ae2348 Deleted the commented out naked attribute. 2010-03-28 17:48:00 +00:00
Richard Barry
0821d5201e Rename the portRESTORE_CONTEXT_REDUCED macro to portRESTORE_CONTEXT. 2010-03-28 17:46:57 +00:00
Richard Barry
afe2d4fc38 Simplify the Cortus port - removing the interrupt stack and interrupt nesting capability. 2010-03-28 17:44:06 +00:00
Richard Barry
f8b7288033 Continue work on Cortus demo. 2010-03-26 20:28:19 +00:00
Richard Barry
c848059d5f Work in progress on the Cortus port. 2010-03-26 20:27:10 +00:00
Richard Barry
a671be77bf Add the regtest tasks to the Cortus demo. 2010-03-26 12:43:00 +00:00
Richard Barry
b492b7eb89 Minor formatting and name changes only. 2010-03-26 10:03:32 +00:00
Richard Barry
a93c8d6659 Add Cortus demo. 2010-03-24 11:24:21 +00:00
Richard Barry
e65ab7222c Add directory for Cortus demo. 2010-03-24 11:22:36 +00:00
Richard Barry
1aed974822 Change name of constant to match coding standard. 2010-03-24 11:06:33 +00:00
Richard Barry
0d8229a087 The start of an APS3 port. 2010-03-19 14:22:34 +00:00
Richard Barry
2596728679 Initialised xFreeBytesRemaining where it is declared so xPortGetFreeHeapSize() returns a valid value even before the heap has been initialised. 2010-03-19 09:45:12 +00:00
Richard Barry
808bb8e159 Update the V6.0.4. The primary difference being that the unsupported demos have now been removed from the download, and instead placed in their own forums. 2010-03-14 11:55:16 +00:00
Richard Barry
71b23456fd Remove log file which should not have been part of the repository. 2010-03-14 11:33:11 +00:00
Richard Barry
c4a14fc1ef Added back the Unsupported_Demos directory, but this time containing just a .txt file with a link to the page that describes how the demos can be obtained. 2010-03-14 11:27:28 +00:00
Richard Barry
3382b13855 Remove the unsupported demos directory. The files it contains are now available at http://interactive.freertos.org. 2010-03-13 20:39:49 +00:00
Richard Barry
73ee7479e4 Correct spelling in comment. 2010-03-13 20:37:16 +00:00
Richard Barry
c981185506 Very first demo for the Energy Micro EFM32 added. 2010-03-13 19:20:19 +00:00
Richard Barry
8fc041a994 Update to use V2 of the CPU support pack from Rowley. 2010-03-11 13:29:05 +00:00
Richard Barry
85e6e01995 Removed unused files. 2010-02-25 16:36:32 +00:00
Richard Barry
e262d95404 Ready for V6.0.3 release. 2010-02-25 13:41:09 +00:00
Richard Barry
ec0f5ed043 Tidy up SuperH port a bit ready for release. 2010-02-18 13:34:46 +00:00
Richard Barry
450e344455 Tidy up SuperH port a bit ready for release. 2010-02-18 13:23:00 +00:00
Richard Barry
e35180acd9 Tidy up SuperH port a bit ready for release. 2010-02-18 13:21:33 +00:00
Richard Barry
9b27b75715 Continue work on the SH2A port. 2010-02-15 17:16:38 +00:00
Richard Barry
04c48138a8 Change path to included header files so they are now included from the apps directory. 2010-02-15 17:15:10 +00:00
Richard Barry
b25f24cb75 Continue work on SH2A demo. 2010-02-15 17:13:58 +00:00
Richard Barry
0978152144 Add back in the uip_arch.h header file. 2010-02-15 14:47:29 +00:00
Richard Barry
804d39fb69 Another two header files added back having been previously removed. 2010-02-13 22:08:45 +00:00
Richard Barry
d60032cec3 Not much more than a reformatted uIP so far - this will eventually replace the FreeRTOS-uIP files. 2010-02-13 21:15:28 +00:00
Richard Barry
7c54dfea37 Add back in header file that was mistakenly removed prior to previous check in. 2010-02-13 21:01:26 +00:00
Richard Barry
90ec8c2b57 Added file required to build demo. 2010-02-13 21:00:16 +00:00
Richard Barry
92ae2d0724 Update SuperH port to include WEB server. 2010-02-13 18:57:15 +00:00
Richard Barry
bbe10cf550 Add new files to the SuperH project. 2010-02-12 15:27:07 +00:00
Richard Barry
2ce61bafdc Not to be added for the next release, so removed to avoid confusion. 2010-02-01 13:38:03 +00:00
Richard Barry
416fcd3a3d Change case of name for consistency with other lwIP directories. 2010-01-25 19:04:45 +00:00
Richard Barry
073e831bcf Added latest lwIP source. 2010-01-25 12:54:55 +00:00
Richard Barry
06c89adf1e Remove the .bak files that were accidentally added to the repository. 2010-01-24 21:05:15 +00:00
Richard Barry
61dacf99ab 2010-01-24 21:04:32 +00:00
Richard Barry
ef57fa8947 Start of new demo added. Still a long way to go. 2010-01-24 21:00:36 +00:00
Richard Barry
9849c9ccab General tidy up of SH files. 2010-01-17 16:32:43 +00:00
Richard Barry
99cc14b365 General tidy up of SH files. 2010-01-17 16:32:06 +00:00
Richard Barry
73b49130c6 Just updated comments. 2010-01-17 15:45:37 +00:00
Richard Barry
8dd9c7dfd9 Moved the definitions of pvPortMallocAligned() and pvPortFreeAligned() to freertos.h. 2010-01-17 14:22:55 +00:00
Richard Barry
ebffeb7ae4 Added flop support. 2010-01-17 13:14:23 +00:00
Richard Barry
094945625d Add flop support. 2010-01-17 13:12:54 +00:00
Richard Barry
65b947b50f Still a work in progress. Checking in for backup only. 2010-01-16 17:09:39 +00:00
Richard Barry
b75ec97ea9 Still a work in progress. Checking in for backup only. 2010-01-16 17:07:44 +00:00
Richard Barry
b60eba005a Change interrupt mask in yield function. 2010-01-16 11:40:41 +00:00
Richard Barry
559e2a850f Still a work in progress. Need to add flop support. 2010-01-15 17:20:09 +00:00
Richard Barry
188a2c0cc1 Still a work in progress. Need to add flop support. 2010-01-15 17:18:47 +00:00
Richard Barry
1aa471d0ec Work in progress. 2010-01-14 12:24:29 +00:00
Richard Barry
68074c03d6 Work in progress. 2010-01-14 12:23:07 +00:00
Richard Barry
c99f3c55cd Update to V6.0.2. 2010-01-09 14:48:45 +00:00
Richard Barry
4f59d550c6 Update to V6.0.2. 2010-01-09 14:31:39 +00:00
Richard Barry
f902211804 Update resource files for latest IAR releases. 2010-01-09 14:03:33 +00:00
Richard Barry
b016c8bfb5 Update IAR version used. 2010-01-08 19:08:53 +00:00
Richard Barry
bf9b20e6b8 Change "SWI" to "SWI 0". 2010-01-08 14:25:12 +00:00
Richard Barry
ac94fdddf1 Again, just corrected some comments. 2010-01-08 14:21:33 +00:00
Richard Barry
a3cb76d07a Corrected a comment. 2010-01-08 14:20:30 +00:00
Richard Barry
2dc8e16e68 Corrected a couple of comments. 2010-01-08 14:19:35 +00:00
Richard Barry
e170cdef52 Skeleton for new port added. 2009-12-28 15:06:11 +00:00
Richard Barry
bc0e754d87 Work in progress for backup only. 2009-12-27 22:20:42 +00:00
Richard Barry
dbb3361ed9 Start a new demo for a new SH2A port. 2009-12-27 09:55:16 +00:00
Richard Barry
0840882d46 Change PIC32 stack byte alignment from 4 to 8. 2009-12-10 18:17:37 +00:00
Richard Barry
50ab249849 Added yet another type cast to the else if clause in xTaskCheckForTimeOut. This is to ensure it works correctly on ALL 16 bit compilers (hopefully). 2009-11-23 11:18:07 +00:00
Richard Barry
0bcacda16b vTaskList() now works for architectures where the stack grows up from low memory. 2009-11-23 10:43:04 +00:00
Richard Barry
e439365343 Added configQUEUE_REGISTRY_SIZE definition. 2009-11-23 10:24:50 +00:00
Richard Barry
c0fae3b4dd Changes in the comments only. 2009-11-23 10:23:31 +00:00
Richard Barry
d41bc9028e Updated to work with the latest compiler - changed the .mac file and updated the linker script. 2009-11-22 21:38:51 +00:00
Richard Barry
9ec30de7f4 Update Cortex M3 ports to ensure 8 byte alignment. 2009-11-15 21:47:15 +00:00
Richard Barry
db87c0ac06 Correct byte alignment on CM3 port layers. 2009-11-15 15:01:59 +00:00
Richard Barry
a9625ce462 Change the function that sets up the initial stack on CM3 ports to account for the post decrement used by the MCU when it alters the stack on the way into/out of interrupts. 2009-11-14 19:02:12 +00:00
Richard Barry
a06c91fcc1 Fixed typo. 2009-11-13 20:57:51 +00:00
Richard Barry
7c09eb2da7 Correct cut and paste comment error. 2009-10-25 10:33:01 +00:00
Richard Barry
eb89065789 Update the Posix simulator to contain more features. 2009-10-15 11:59:20 +00:00
Richard Barry
a75aec78ed Correct the auto reload value. 2009-10-15 11:57:49 +00:00
Richard Barry
0db3b5c258 Correct the auto reload value. 2009-10-15 11:56:48 +00:00
Richard Barry
26bf0da04e Change to the file headers only. 2009-10-13 11:05:41 +00:00
Richard Barry
aedbbb8a5c Change to the file headers only. 2009-10-13 10:57:25 +00:00
Richard Barry
11ed4d6fba Change to the file headers only. 2009-10-13 10:54:32 +00:00
Richard Barry
7dbf3304b3 Tidy up only. 2009-10-13 09:17:39 +00:00
Richard Barry
e00afda1b1 Correct compiler warnings when a certain configuration is set in FreeRTOSConfig.h. 2009-10-13 09:12:30 +00:00
Richard Barry
8560e094f2 Formatting only. 2009-10-13 09:11:17 +00:00
Richard Barry
8bbd6c243e Place #error string in quotes. 2009-10-11 22:33:58 +00:00
Richard Barry
dc5c2a5371 Add same additional tests and demos as already in the Rowley version. 2009-10-11 22:31:20 +00:00
Richard Barry
d80bf5e055 Remove unused definitions. 2009-10-11 22:25:59 +00:00
Richard Barry
2c761c6626 Add a few more tests and demos. 2009-10-11 11:53:07 +00:00
Richard Barry
448f83eb43 Add a few more tests and demos. 2009-10-11 09:30:12 +00:00
Richard Barry
9557f14233 Add missing cast where one of the static MPU blocks are configured. 2009-10-10 18:45:46 +00:00
Richard Barry
16612fb796 Removed the needs-lock property. 2009-10-10 18:44:47 +00:00
Richard Barry
cacf4036b9 Correct type on comment. 2009-10-10 18:43:18 +00:00
Richard Barry
7c927d69d5 Add the tests performed by prvOldStyleUserModeTask(). 2009-10-10 18:41:14 +00:00
Richard Barry
9c349886af Add clobber lists to inline asm code. 2009-10-06 08:48:34 +00:00
Richard Barry
d3f5c5348c Change where the free heap space variable is initialised. 2009-10-06 08:46:22 +00:00
Richard Barry
205b0dd863 Add clobber list to asm sections to allow use with higher optimisation. 2009-10-05 20:26:11 +00:00
Richard Barry
176aafbe00 Add portBYTE_ALIGNMENT definition to PC demos. 2009-10-05 12:17:50 +00:00
Richard Barry
e90ba3e57f Add xPortGetFreeHeapSize() function. 2009-10-05 11:16:38 +00:00
Richard Barry
9468e36040 Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
2009-10-05 11:10:48 +00:00
Richard Barry
f625cf929a Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
2009-10-05 11:01:09 +00:00
Richard Barry
23a5a73219 Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
2009-10-05 10:57:40 +00:00
Richard Barry
4322b8d649 Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
2009-10-05 10:28:54 +00:00
Richard Barry
64c701aff7 Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
2009-10-05 10:23:06 +00:00
Richard Barry
7f0c4ef656 Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
2009-10-05 10:08:35 +00:00
Richard Barry
506dd1b7c8 Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
2009-10-05 09:46:11 +00:00
Richard Barry
26f0258688 Remove unnecessary use of portLONG, portCHAR and portSHORT. 2009-10-04 18:34:36 +00:00
Richard Barry
804d114420 Add PRIVILEGED_FUNCTION qualifiers to port files. 2009-10-04 18:18:32 +00:00
Richard Barry
334bd8b66c Remove files accidentally added to repository. 2009-10-04 18:01:57 +00:00
Richard Barry
ee5608ddc2 Tidy up, starting to get ready for next release. 2009-10-04 17:59:49 +00:00
Richard Barry
a7462db433 Update to fit using later Keil version. 2009-10-04 14:56:54 +00:00
Richard Barry
1b3ceba83f Just remove compiler warning. 2009-10-04 10:59:01 +00:00
Richard Barry
2b2324a7e7 Add R32C contributed port. 2009-10-04 10:08:25 +00:00
Richard Barry
8c5f57a134 Correct spelling mistake only. 2009-10-03 19:57:25 +00:00
Richard Barry
d138104369 Reinstate privileged only RAM region when a task is running that does not otherwise make use of the MPU. 2009-10-03 19:56:09 +00:00
Richard Barry
5eeea3373f First Red Suite project for FreeRTOS MPU. 2009-10-03 18:53:16 +00:00
Richard Barry
c9b5c1332a Formatting only. 2009-09-30 20:18:36 +00:00
Richard Barry
b5f93ce546 Update to latest Rowley version. 2009-09-30 20:17:17 +00:00
Richard Barry
cf717acaae First version that includes the FreeRTOS-MPU implementation. 2009-09-30 20:16:26 +00:00
Richard Barry
291ea26bfe First version that includes the FreeRTOS-MPU implementation. 2009-09-30 20:12:31 +00:00
Richard Barry
6b7397ee92 Prepare for V6. 2009-09-29 20:11:12 +00:00
Richard Barry
b7da8d7a1b Remove the portBYTE_ALIGNMENT_MASK definitions as they are now in the common portable.h file. 2009-09-29 20:07:44 +00:00
Richard Barry
ad441634f0 Allow auto switching between creating tasks in ARM mode and THUMB mode. 2009-09-29 20:03:55 +00:00
Richard Barry
afaa3321ba Allow auto switching between creating tasks in ARM mode and THUMB mode. 2009-09-29 20:03:09 +00:00
Richard Barry
b500ab8be2 Allow auto switching between creating tasks in ARM mode and THUMB mode. 2009-09-29 20:02:16 +00:00
Richard Barry
2cb1578b30 Set ARM byte alignment to 8. 2009-09-29 20:01:17 +00:00
Richard Barry
2d958d3d2c Set ARM byte alignment to 8. 2009-09-29 19:58:05 +00:00
Richard Barry
98ed4f2a20 Update for V6. 2009-09-29 19:49:54 +00:00
Richard Barry
7dacae2ae9 New file added for V6. 2009-09-29 19:40:13 +00:00
Richard Barry
c3473a1e49 Update to latest Rowley version. 2009-09-29 19:37:19 +00:00
Richard Barry
3c09399524 Ensure the user is forced to select an option through the use of a #error directive. 2009-09-29 19:34:04 +00:00
Richard Barry
1f12f80eb7 Ensure compiles using latest Yagarto. 2009-09-29 19:32:27 +00:00
Richard Barry
a961f6daa3 Just checking in a file that was automatically updated by the IDE. 2009-09-29 19:30:14 +00:00
Richard Barry
13f92818a7 Update to latest IAR version. 2009-09-29 18:19:22 +00:00
Richard Barry
bb17e05f63 Update to latest IAR version. 2009-09-29 18:18:47 +00:00
Richard Barry
a9f422ed7c Update to latest IAR version. 2009-09-29 18:14:14 +00:00
Richard Barry
b0f9c55325 Update to latest IAR version. 2009-09-29 18:13:38 +00:00
Richard Barry
87c8d2f87a Update to latest IAR version. 2009-09-29 17:46:10 +00:00
Richard Barry
b7e0d0753a Update to latest IAR version. 2009-09-29 17:29:33 +00:00
Richard Barry
46b1b9f99d Update to latest IAR version. 2009-09-29 04:55:49 +00:00
Richard Barry
c5c32913c9 Inline the asm function in the ISR wrapper. 2009-09-28 18:50:32 +00:00
Richard Barry
e30b39e09f Auto updated file by the IDE. 2009-09-28 18:25:48 +00:00
Richard Barry
00462893c9 Use noinline attribute on C portion of asm functions, increase warning level and fix warnings output by new level. 2009-09-28 18:23:17 +00:00
Richard Barry
75c6804bb1 Test with latest IAR and Keil versions. 2009-09-28 18:15:32 +00:00
Richard Barry
07990a8c0c Added a couple of extra compiler options better for use with the latest Yagarto release. 2009-09-28 18:05:54 +00:00
Richard Barry
d7ca9be54d Added a couple of extra compiler options better for use with the latest Yagarto release. 2009-09-28 18:01:57 +00:00
Richard Barry
8a6518c3b3 Test with latest IAR version. 2009-09-28 17:52:42 +00:00
Richard Barry
b04f886ebd Updated for use with latest Yagarto release. 2009-09-28 17:15:51 +00:00
Richard Barry
5f896f1640 Added CM3 MPU demo. 2009-09-28 14:26:40 +00:00
Richard Barry
4640196beb Add CM3 MPU port. 2009-09-28 14:23:45 +00:00
Richard Barry
531faedf63 Update to use the latest Yagarto and change the C handler part of the interrupt routines to use the noinline attribute. 2009-09-18 20:27:00 +00:00
Richard Barry
7ff79ca26b Update to use the latest Yagarto and change the C handler part of the interrupt routines to use the noinline attribute. 2009-09-18 14:08:36 +00:00
Richard Barry
6bdf14c33f Update to use the latest Yagarto and change the C handler part of the interrupt routines to use the noinline attribute. 2009-09-18 14:04:40 +00:00
Richard Barry
9a76bc39cb Update to use Yagarto compiler and use the noinline attribute on the serial port handler function. 2009-09-18 13:55:43 +00:00
Richard Barry
4b7c5b07c1 Correct unintended duplication and slight wording change. 2009-08-20 13:49:12 +00:00
Richard Barry
b401621a85 Correct the name of the new Cortex M3 demo directory. 2009-08-12 16:17:33 +00:00
Richard Barry
2d4ed1801b Update libdriver for Rowley demos. 2009-08-12 16:12:31 +00:00
Richard Barry
19216099d0 Add LM3Sxxx Rowley demo. 2009-08-12 16:10:55 +00:00
Richard Barry
ed06a0400a Update to V5.4.2. See http://www.freertos.org/History.txt . 2009-08-09 19:10:57 +00:00
Richard Barry
1831418ec8 Prepare for release. 2009-08-09 14:03:25 +00:00
Richard Barry
5a5be9567c Start to prepare for release. 2009-08-09 14:02:07 +00:00
Richard Barry
a4708c9fc8 Increase frequency to 99MHz. 2009-08-09 13:03:17 +00:00
Richard Barry
fb01731f41 Initial IAR LPC1768 demo. Work in progress at this point. 2009-08-09 12:19:17 +00:00
Richard Barry
87bb2c58b2 Formatting only. 2009-08-09 12:11:16 +00:00
Richard Barry
790bacc8f2 Remove compiler warnings. 2009-08-09 12:10:34 +00:00
Richard Barry
e9830a7ee3 Remove unused structure definition. 2009-08-09 12:09:18 +00:00
Richard Barry
27135c4a1c Just remove compiler warning. 2009-08-09 12:07:49 +00:00
Richard Barry
44b4467b26 Add simple USB CDC task. 2009-08-07 15:30:57 +00:00
Richard Barry
df338c84c3 Add simple USB CDC task. 2009-08-07 15:30:18 +00:00
Richard Barry
a83d9d93e8 Add a basic USB CDC example using LPCUSB. 2009-08-07 14:35:24 +00:00
Richard Barry
d2a29ece23 Update new project file. 2009-08-06 20:31:17 +00:00
Richard Barry
3f3a091728 Correct the IF EXIST part of the batch file. 2009-08-06 20:20:22 +00:00
Richard Barry
d2a9f9624b Rename Nios2 to NiosII. 2009-08-06 20:15:39 +00:00
Richard Barry
ddb7c49f3c Add batch file to create the NiosII project directory structure. 2009-08-06 20:08:34 +00:00
Richard Barry
523ffada03 Add new NiosII demo project. 2009-08-06 19:36:48 +00:00
Richard Barry
5d6acacd7a Correct spelling error in comment only. 2009-08-06 19:33:06 +00:00
Richard Barry
6358344ea1 Added new Nios2 port layer. 2009-08-06 18:23:40 +00:00
10316 changed files with 3049494 additions and 214413 deletions

View File

@@ -1,99 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <AT91R40008.h>
#define configFLASH_SPEED_NSEC 100 /* External flash access speed (for ROM builds) */
/*-----------------------------------------------------------
* 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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 66000000 ) /* = 66.000MHz clk gen */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 25 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,116 +0,0 @@
#/*
# FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
#
# 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 exception 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.
# Alternative commercial license and support terms are also available upon
# request. See the licensing section of http://www.FreeRTOS.org for full
# license details.
#
# 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. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
# Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#
#
# ***************************************************************************
# * *
# * Looking for a quick start? Then check out the FreeRTOS eBook! *
# * See http://www.FreeRTOS.org/Documentation for details *
# * *
# ***************************************************************************
#
# 1 tab == 4 spaces!
#
# Please ensure to read the configuration and relevant port sections of the
# online documentation.
#
# http://www.FreeRTOS.org - Documentation, latest information, license and
# contact details.
#
# http://www.SafeRTOS.com - A version that is certified for use in safety
# critical systems.
#
# http://www.OpenRTOS.com - Commercial support, development, porting,
# licensing and training services.
#*/
CC=arm-elf-gcc
OBJCOPY=arm-elf-objcopy
ARCH=arm-elf-ar
CRT0=boot.s
#
# CFLAGS common to both the THUMB and ARM mode builds
#
CFLAGS=-Wall -D $(RUN_MODE) -D GCC_AT91FR40008 -I. -I../../Source/include \
-I../Common/include $(DEBUG) -mcpu=arm7tdmi -T$(LDSCRIPT) \
-Wcast-align $(OPTIM) -fomit-frame-pointer -fno-strict-aliasing
ifeq ($(USE_THUMB_MODE),YES)
CFLAGS += -mthumb-interwork -D THUMB_INTERWORK
THUMB_FLAGS=-mthumb
endif
LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
#
# Source files that can be built to THUMB mode.
#
THUMB_SRC = \
main.c \
serial/serial.c \
ParTest/ParTest.c \
../Common/Minimal/integer.c \
../Common/Minimal/flash.c \
../Common/Minimal/PollQ.c \
../Common/Minimal/comtest.c \
../Common/Minimal/flop.c \
../Common/Minimal/semtest.c \
../Common/Minimal/dynamic.c \
../Common/Minimal/BlockQ.c \
../../Source/tasks.c \
../../Source/queue.c \
../../Source/list.c \
../../Source/portable/MemMang/heap_2.c \
../../Source/portable/GCC/ARM7_AT91FR40008/port.c
#
# Source files that must be built to ARM mode.
#
ARM_SRC = \
../../Source/portable/GCC/ARM7_AT91FR40008/portISR.c \
serial/serialISR.c
#
# Define all object files.
#
ARM_OBJ = $(ARM_SRC:.c=.o)
THUMB_OBJ = $(THUMB_SRC:.c=.o)
rtosdemo.hex : rtosdemo.elf
$(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
$(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
$(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
$(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
$(CC) -c $(CFLAGS) $< -o $@
clean :
touch Makefile

View File

@@ -1,135 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "portable.h"
/* Demo app includes. */
#include "partest.h"
/* Hardware specific definitions. */
#include "AT91R40008.h"
#include "pio.h"
#include "aic.h"
#define partstNUM_LEDS ( 8 )
#define partstALL_OUTPUTS_OFF ( ( unsigned portLONG ) ~(0xFFFFFFFF << partstNUM_LEDS) )
static unsigned portLONG ulLEDReg;
/*-----------------------------------------------------------
* Simple parallel port IO routines.
*-----------------------------------------------------------*/
static void SetLeds (unsigned int leds)
{
unsigned portLONG ulPIOSetReg, ulPIOClearReg;
/* LEDs are grouped in different port bits: P3-P6 and P16-P19.
A port bit set to '0' turns an LED on, '1' turns it off. */
ulPIOSetReg = ( (leds & 0xF) << 16 ) | ( (leds & 0xF0) >> 1 );
ulPIOClearReg = (~ulPIOSetReg) & 0x000F0078;
AT91C_BASE_PIO->PIO_SODR = ulPIOSetReg;
AT91C_BASE_PIO->PIO_CODR = ulPIOClearReg;
}
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
/* This is performed from main() as the io bits are shared with other setup
functions. Ensure the outputs are off to start. */
ulLEDReg = partstALL_OUTPUTS_OFF;
/* Enable clock to PIO... */
AT91C_BASE_PS->PS_PCER = AT91C_PS_PIO;
/* Enable all 8 LEDs and the four switches to be controlled by PIO... */
AT91C_BASE_PIO->PIO_PER = P3 | P4 | P5 | P6 | P16 | P17 | P18 | P19 | P1 | P2 | P9 | P12;
/* Configure all LED PIO lines for output... */
AT91C_BASE_PIO->PIO_OER = P3 | P4 | P5 | P6 | P16 | P17 | P18 | P19;
/* Configure all switch PIO lines for input... */
AT91C_BASE_PIO->PIO_ODR = P1 | P2 | P9 | P12;
/* Set initial state of LEDs. */
SetLeds( ulLEDReg );
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
/* Switch an LED on or off as requested. */
if (uxLED < partstNUM_LEDS)
{
if( xValue )
{
ulLEDReg &= ~(1 << uxLED);
}
else
{
ulLEDReg |= (1 << uxLED);
}
SetLeds( ulLEDReg );
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
/* Toggle the state of the requested LED. */
if (uxLED < partstNUM_LEDS)
{
ulLEDReg ^= ( 1 << uxLED );
SetLeds( ulLEDReg );
}
}

View File

@@ -1,49 +0,0 @@
MEMORY
{
flash : ORIGIN = 0x00000000, LENGTH = 2048K
ram : ORIGIN = 0x00300000, LENGTH = 256K
}
__stack_end__ = 0x00300000 + 256K - 4;
SECTIONS
{
. = 0;
startup : { *(.startup)} >flash
prog :
{
*(.text)
*(.rodata)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
} >flash
__end_of_text__ = .;
.data :
{
__data_beg__ = .;
__data_beg_src__ = __end_of_text__;
*(.data)
__data_end__ = .;
} >ram AT>flash
.bss :
{
__bss_beg__ = .;
*(.bss)
} >ram
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
}
. = ALIGN(32 / 8);
_end = .;
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
PROVIDE (end = .);

View File

@@ -1,484 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles the onboard LED. Should any task contain an error at any time
* the LED toggle rate will change from 3 seconds to 500ms.
*
* To check the operation of the memory allocator the check task also
* dynamically creates a task before delaying, and deletes it again when it
* wakes. If memory cannot be allocated for the new task the call to xTaskCreate
* will fail and an error is signalled. The dynamically created task itself
* allocates and frees memory just to give the allocator a bit more exercise.
*
*/
/* Standard includes. */
#include <stdlib.h>
#include <string.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "partest.h"
#include "flash.h"
#include "integer.h"
#include "PollQ.h"
#include "comtest2.h"
#include "semtest.h"
#include "flop.h"
#include "dynamic.h"
#include "BlockQ.h"
#include "serial.h"
/* Hardware specific definitions. */
#include "aic.h"
#include "ebi.h"
/*-----------------------------------------------------------*/
/* Constants for the ComTest tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 115200 )
#define mainCOM_TEST_LED ( 5 )
/* Priorities for the demo application tasks. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* The rate at which the on board LED will toggle when there is/is not an
error. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainON_BOARD_LED_BIT ( ( unsigned portLONG ) 7 )
/* Constants used by the vMemCheckTask() task. */
#define mainCOUNT_INITIAL_VALUE ( ( unsigned portLONG ) 0 )
#define mainNO_TASK ( 0 )
/* The size of the memory blocks allocated by the vMemCheckTask() task. */
#define mainMEM_CHECK_SIZE_1 ( ( size_t ) 51 )
#define mainMEM_CHECK_SIZE_2 ( ( size_t ) 52 )
#define mainMEM_CHECK_SIZE_3 ( ( size_t ) 151 )
#define MAX_WAIT_STATES 8
static const unsigned portLONG ululCSRWaitValues[ MAX_WAIT_STATES + 1 ] =
{
WaitState1,/* There is no "zero wait state" value, so use one wait state */
WaitState1,
WaitState2,
WaitState3,
WaitState4,
WaitState5,
WaitState6,
WaitState7,
WaitState8
};
/*-----------------------------------------------------------*/
/*
* Checks that all the demo application tasks are still executing without error
* - as described at the top of the file.
*/
static portLONG prvCheckOtherTasksAreStillRunning( unsigned portLONG ulMemCheckTaskCount );
/*
* The task that executes at the highest priority and calls
* prvCheckOtherTasksAreStillRunning(). See the description at the top
* of the file.
*/
static void vErrorChecks( void *pvParameters );
/*
* Dynamically created and deleted during each cycle of the vErrorChecks()
* task. This is done to check the operation of the memory allocator.
* See the top of vErrorChecks for more details.
*/
static void vMemCheckTask( void *pvParameters );
/*
* Configure the processor for use with the Olimex demo board. This includes
* setup for the I/O, system clock, and access timings.
*/
static void prvSetupHardware( void );
/*-----------------------------------------------------------*/
/*
* Starts all the other tasks, then starts the scheduler.
*/
int main( void )
{
/* Setup the hardware for use with the Olimex demo board. */
prvSetupHardware();
/* Start the demo/test application tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartMathTasks( tskIDLE_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartDynamicPriorityTasks();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
/* Start the check task - which is defined in this file. */
xTaskCreate( vErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Now all the tasks have been started - start the scheduler.
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used here. */
vTaskStartScheduler();
/* Should never reach here! */
return 0;
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
unsigned portLONG ulMemCheckTaskRunningCount;
xTaskHandle xCreatedTask;
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. If an error is detected then the delay period
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
the on board LED flash rate will increase.
In addition to the standard tests the memory allocator is tested through
the dynamic creation and deletion of a task each cycle. Each time the
task is created memory must be allocated for its stack. When the task is
deleted this memory is returned to the heap. If the task cannot be created
then it is likely that the memory allocation failed. */
for( ;; )
{
/* Reset xCreatedTask. This is modified by the task about to be
created so we can tell if it is executing correctly or not. */
xCreatedTask = mainNO_TASK;
/* Dynamically create a task - passing ulMemCheckTaskRunningCount as a
parameter. */
ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE;
if( xTaskCreate( vMemCheckTask, ( signed portCHAR * ) "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )
{
/* Could not create the task - we have probably run out of heap. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
/* Delay until it is time to execute again. */
vTaskDelay( xDelayPeriod );
/* Delete the dynamically created task. */
if( xCreatedTask != mainNO_TASK )
{
vTaskDelete( xCreatedTask );
}
/* Check all the standard demo application tasks are executing without
error. ulMemCheckTaskRunningCount is checked to ensure it was
modified by the task just deleted. */
if( prvCheckOtherTasksAreStillRunning( ulMemCheckTaskRunningCount ) != pdPASS )
{
/* An error has been detected in one of the tasks - flash faster. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
/* The toggle rate of the LED depends on how long this task delays for.
An error reduces the delay period and so increases the toggle rate. */
vParTestToggleLED( mainON_BOARD_LED_BIT );
}
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
portLONG lCount;
#ifdef RUN_FROM_ROM
{
portFLOAT nsecsPerClockTick;
portLONG lNumWaitStates;
unsigned portLONG ulCSRWaitValue;
/* We are compiling to run from ROM (either on-chip or off-chip flash).
Leave the RAM/flash mapped the way they are on reset
(flash @ 0x00000000, RAM @ 0x00300000), and set up the
proper flash wait states (starts out at the maximum number
of wait states on reset, so we should be able to reduce it).
Most of this code will probably get removed by the compiler
if optimization is enabled, since these calculations are
based on constants. But the compiler should still produce
a correct wait state register value. */
nsecsPerClockTick = ( portFLOAT ) 1000000000 / configCPU_CLOCK_HZ;
lNumWaitStates = ( portLONG )( ( configFLASH_SPEED_NSEC / nsecsPerClockTick ) + 0.5 ) - 1;
if( lNumWaitStates < 0 )
{
lNumWaitStates = 0;
}
if( lNumWaitStates > MAX_WAIT_STATES )
{
lNumWaitStates = MAX_WAIT_STATES;
}
ulCSRWaitValue = ululCSRWaitValues[ lNumWaitStates ];
ulCSRWaitValue = WaitState5;
AT91C_BASE_EBI->EBI_CSR[ 0 ] = ulCSRWaitValue | DataBus16 | WaitStateEnable
| PageSize1M | tDF_0cycle
| ByteWriteAccessType | CSEnable
| 0x00000000 /* Base Address */;
}
#else /* else we are compiling to run from on-chip RAM */
{
/* If compiling to run from RAM, we expect the on-chip RAM to already
be mapped at 0x00000000. This is typically done with an initialization
script for the JTAG emulator you are using to download and run the
demo application. So there is nothing to do here in this case. */
}
#endif
/* Disable all interrupts at the AIC level initially... */
AT91C_BASE_AIC->AIC_IDCR = 0xFFFFFFFF;
/* Set all SVR and SMR entries to default values (start with a clean slate)... */
for( lCount = 0; lCount < 32; lCount++ )
{
AT91C_BASE_AIC->AIC_SVR[ lCount ] = (unsigned long) 0;
AT91C_BASE_AIC->AIC_SMR[ lCount ] = AIC_SRCTYPE_INT_EDGE_TRIGGERED;
}
/* Disable clocks to all peripherals initially... */
AT91C_BASE_PS->PS_PCDR = 0xFFFFFFFF;
/* Clear all interrupts at the AIC level initially... */
AT91C_BASE_AIC->AIC_ICCR = 0xFFFFFFFF;
/* Perform 8 "End Of Interrupt" cmds to make sure AIC will not Lock out
nIRQ */
for( lCount = 0; lCount < 8; lCount++ )
{
AT91C_BASE_AIC->AIC_EOICR = 0;
}
/* Initialise LED outputs. */
vParTestInitialise();
}
/*-----------------------------------------------------------*/
static portLONG prvCheckOtherTasksAreStillRunning( unsigned portLONG ulMemCheckTaskCount )
{
portLONG lReturn = ( portLONG ) pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( ulMemCheckTaskCount == mainCOUNT_INITIAL_VALUE )
{
/* The vMemCheckTask did not increment the counter - it must
have failed. */
lReturn = ( portLONG ) pdFAIL;
}
return lReturn;
}
/*-----------------------------------------------------------*/
static void vMemCheckTask( void *pvParameters )
{
unsigned portLONG *pulMemCheckTaskRunningCounter;
void *pvMem1, *pvMem2, *pvMem3;
static portLONG lErrorOccurred = pdFALSE;
/* This task is dynamically created then deleted during each cycle of the
vErrorChecks task to check the operation of the memory allocator. Each time
the task is created memory is allocated for the stack and TCB. Each time
the task is deleted this memory is returned to the heap. This task itself
exercises the allocator by allocating and freeing blocks.
The task executes at the idle priority so does not require a delay.
pulMemCheckTaskRunningCounter is incremented each cycle to indicate to the
vErrorChecks() task that this task is still executing without error. */
pulMemCheckTaskRunningCounter = ( unsigned portLONG * ) pvParameters;
for( ;; )
{
if( lErrorOccurred == pdFALSE )
{
/* We have never seen an error so increment the counter. */
( *pulMemCheckTaskRunningCounter )++;
}
else
{
/* There has been an error so reset the counter so the check task
can tell that an error occurred. */
*pulMemCheckTaskRunningCounter = mainCOUNT_INITIAL_VALUE;
}
/* Allocate some memory - just to give the allocator some extra
exercise. This has to be in a critical section to ensure the
task does not get deleted while it has memory allocated. */
vTaskSuspendAll();
{
pvMem1 = pvPortMalloc( mainMEM_CHECK_SIZE_1 );
if( pvMem1 == NULL )
{
lErrorOccurred = pdTRUE;
}
else
{
memset( pvMem1, 0xaa, mainMEM_CHECK_SIZE_1 );
vPortFree( pvMem1 );
}
}
xTaskResumeAll();
/* Again - with a different size block. */
vTaskSuspendAll();
{
pvMem2 = pvPortMalloc( mainMEM_CHECK_SIZE_2 );
if( pvMem2 == NULL )
{
lErrorOccurred = pdTRUE;
}
else
{
memset( pvMem2, 0xaa, mainMEM_CHECK_SIZE_2 );
vPortFree( pvMem2 );
}
}
xTaskResumeAll();
/* Again - with a different size block. */
vTaskSuspendAll();
{
pvMem3 = pvPortMalloc( mainMEM_CHECK_SIZE_3 );
if( pvMem3 == NULL )
{
lErrorOccurred = pdTRUE;
}
else
{
memset( pvMem3, 0xaa, mainMEM_CHECK_SIZE_3 );
vPortFree( pvMem3 );
}
}
xTaskResumeAll();
}
}

View File

@@ -1,243 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART0.
This file contains all the serial port components that can be compiled to
either ARM or THUMB mode. Components that must be compiled to ARM mode are
contained in serialISR.c.
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
/* Demo application includes. */
#include "serial.h"
#include "AT91R40008.h"
#include "usart.h"
#include "pio.h"
#include "aic.h"
/*-----------------------------------------------------------*/
/* Constants to setup and access the UART. */
#define portUSART0_AIC_CHANNEL ( ( unsigned portLONG ) 2 )
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
/*-----------------------------------------------------------*/
/*
* The queues are created in serialISR.c as they are used from the ISR.
* Obtain references to the queues and THRE Empty flag.
*/
extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx );
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
unsigned portLONG ulSpeed;
unsigned portLONG ulCD;
xComPortHandle xReturn = serHANDLE;
extern void ( vUART_ISR_Wrapper )( void );
/* The queues are used in the serial ISR routine, so are created from
serialISR.c (which is always compiled to ARM mode. */
vSerialISRCreateQueues( uxQueueLength, &xRxedChars, &xCharsForTx );
if(
( xRxedChars != serINVALID_QUEUE ) &&
( xCharsForTx != serINVALID_QUEUE ) &&
( ulWantedBaud != ( unsigned portLONG ) 0 )
)
{
portENTER_CRITICAL();
{
/* Enable clock to USART0... */
AT91C_BASE_PS->PS_PCER = AT91C_PS_US0;
/* Disable all USART0 interrupt sources to begin... */
AT91C_BASE_US0->US_IDR = 0xFFFFFFFF;
/* Reset various status bits (just in case)... */
AT91C_BASE_US0->US_CR = US_RSTSTA;
AT91C_BASE_PIO->PIO_PDR = TXD0 | RXD0; /* Enable RXD and TXD pins */
AT91C_BASE_US0->US_CR = US_RSTRX | US_RSTTX | US_RXDIS | US_TXDIS;
/* Clear Transmit and Receive Counters */
AT91C_BASE_US0->US_RCR = 0;
AT91C_BASE_US0->US_TCR = 0;
/* Input clock to baud rate generator is MCK */
ulSpeed = configCPU_CLOCK_HZ * 10;
ulSpeed = ulSpeed / 16;
ulSpeed = ulSpeed / ulWantedBaud;
/* compute the error */
ulCD = ulSpeed / 10;
if ((ulSpeed - (ulCD * 10)) >= 5)
ulCD++;
/* Define the baud rate divisor register */
AT91C_BASE_US0->US_BRGR = ulCD;
/* Define the USART mode */
AT91C_BASE_US0->US_MR = US_CLKS_MCK | US_CHRL_8 | US_PAR_NO | US_NBSTOP_1 | US_CHMODE_NORMAL;
/* Write the Timeguard Register */
AT91C_BASE_US0->US_TTGR = 0;
/* Setup the interrupt for USART0.
Store interrupt handler function address in USART0 vector register... */
AT91C_BASE_AIC->AIC_SVR[ portUSART0_AIC_CHANNEL ] = (unsigned long)vUART_ISR_Wrapper;
/* USART0 interrupt level-sensitive, priority 1... */
AT91C_BASE_AIC->AIC_SMR[ portUSART0_AIC_CHANNEL ] = AIC_SRCTYPE_INT_LEVEL_SENSITIVE | 1;
/* Clear some pending USART0 interrupts (just in case)... */
AT91C_BASE_US0->US_CR = US_RSTSTA;
/* Enable USART0 interrupt sources (but not Tx for now)... */
AT91C_BASE_US0->US_IER = US_RXRDY;
/* Enable USART0 interrupts in the AIC... */
AT91C_BASE_AIC->AIC_IECR = ( 1 << portUSART0_AIC_CHANNEL );
/* Enable receiver and transmitter... */
AT91C_BASE_US0->US_CR = US_RXEN | US_TXEN;
}
portEXIT_CRITICAL();
}
else
{
xReturn = ( xComPortHandle ) 0;
}
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
/* Place the character in the queue of characters to be transmitted. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
{
return pdFAIL;
}
/* Turn on the Tx interrupt so the ISR will remove the character from the
queue and send it. This does not need to be in a critical section as
if the interrupt has already removed the character the next interrupt
will simply turn off the Tx interrupt again. */
AT91C_BASE_US0->US_IER = US_TXRDY;
return pdPASS;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
/* Not supported as not required by the demo application. */
}
/*-----------------------------------------------------------*/

View File

@@ -1,174 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART0.
This file contains all the serial port components that must be compiled
to ARM mode. The components that can be compiled to either ARM or THUMB
mode are contained in serial.c.
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
/* Demo application includes. */
#include "serial.h"
#include "AT91R40008.h"
#include "usart.h"
/*-----------------------------------------------------------*/
/* Constant to access the AIC. */
#define serCLEAR_AIC_INTERRUPT ( ( unsigned portLONG ) 0 )
/* Constants to determine the ISR source. */
#define serSOURCE_THRE ( ( unsigned portCHAR ) 0x02 )
#define serSOURCE_RX_TIMEOUT ( ( unsigned portCHAR ) 0x0c )
#define serSOURCE_ERROR ( ( unsigned portCHAR ) 0x06 )
#define serSOURCE_RX ( ( unsigned portCHAR ) 0x04 )
#define serINTERRUPT_SOURCE_MASK ( ( unsigned portLONG ) (US_RXRDY | US_TXRDY | US_RXBRK | US_OVRE | US_FRAME | US_PARE) )
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
/*-----------------------------------------------------------*/
/* UART0 interrupt service routine. This can cause a context switch so MUST
be declared "naked". */
void vUART_ISR_Wrapper( void ) __attribute__ ((naked));
/* The ISR function that actually performs the work. This must be separate
from the wrapper to ensure the correct stack frame is set up. */
void vUART_ISR_Handler( void );
/*-----------------------------------------------------------*/
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx )
{
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* Pass back a reference to the queues so the serial API file can
post/receive characters. */
*pxRxedChars = xRxedChars;
*pxCharsForTx = xCharsForTx;
}
/*-----------------------------------------------------------*/
void vUART_ISR_Wrapper( void )
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler. This must be a separate function to ensure the
stack frame is correctly set up. */
vUART_ISR_Handler();
/* Restore the context of whichever task will run next. */
portRESTORE_CONTEXT();
}
/*-----------------------------------------------------------*/
void vUART_ISR_Handler( void )
{
/* Now we can declare the local variables. These must be static. */
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
unsigned portLONG ulStatus;
/* What caused the interrupt? */
ulStatus = AT91C_BASE_US0->US_CSR & AT91C_BASE_US0->US_IMR;
if (ulStatus & US_TXRDY)
{
/* The interrupt was caused by the THR becoming empty. Are there any
more characters to transmit? */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
/* A character was retrieved from the queue so can be sent to the
THR now. */
AT91C_BASE_US0->US_THR = cChar;
}
else
{
/* Queue empty, nothing to send so turn off the Tx interrupt. */
AT91C_BASE_US0->US_IDR = US_TXRDY;
}
}
if (ulStatus & US_RXRDY)
{
/* The interrupt was caused by the receiver getting data. */
cChar = AT91C_BASE_US0->US_RHR;
xQueueSendFromISR(xRxedChars, &cChar, &xHigherPriorityTaskWoken);
}
/* Acknowledge the interrupt at AIC level... */
AT91C_BASE_AIC->AIC_EOICR = serCLEAR_AIC_INTERRUPT;
/* If an event caused a task to unblock then we call "Yield from ISR" to
ensure that the unblocked task is the task that executes when the interrupt
completes if the unblocked task has a priority higher than the interrupted
task. */
if( xHigherPriorityTaskWoken )
{
portYIELD_FROM_ISR();
}
}
/*-----------------------------------------------------------*/

View File

@@ -1,95 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <intrinsics.h>
#include "Board.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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 47923200 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 14200 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 0
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,96 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#include "FreeRTOS.h"
#include "partest.h"
#include "board.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's.
*-----------------------------------------------------------*/
const unsigned portLONG led_mask[ NB_LED ]= { LED1, LED2, LED3, LED4 };
void vParTestInitialise( void )
{
/* Start with all LED's off. */
AT91F_PIO_SetOutput( AT91C_BASE_PIOA, LED_MASK );
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED < ( portBASE_TYPE ) NB_LED )
{
if( xValue )
{
AT91F_PIO_SetOutput( AT91C_BASE_PIOA, led_mask[ uxLED ] );
}
else
{
AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, led_mask[ uxLED ]);
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED < ( portBASE_TYPE ) NB_LED )
{
if( AT91F_PIO_GetInput( AT91C_BASE_PIOA ) & led_mask[ uxLED ] )
{
AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, led_mask[ uxLED ]);
}
else
{
AT91F_PIO_SetOutput( AT91C_BASE_PIOA, led_mask[ uxLED ] );
}
}
}

View File

@@ -1,89 +0,0 @@
/*----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support - ROUSSET -
*----------------------------------------------------------------------------
* The software is delivered "AS IS" without warranty or condition of any
* kind, either express, implied or statutory. This includes without
* limitation any warranty or condition with respect to merchantability or
* fitness for any particular purpose, or against the infringements of
* intellectual property rights of others.
*----------------------------------------------------------------------------
* File Name : Board.h
* Object : AT91SAM7S Evaluation Board Features Definition File.
*
* Creation : JPP 16/Jun/2004
*----------------------------------------------------------------------------
*/
#ifndef Board_h
#define Board_h
#include "AT91SAM7S64.h"
#define __inline inline
#include "lib_AT91SAM7S64.h"
#define true -1
#define false 0
/*-------------------------------*/
/* SAM7Board Memories Definition */
/*-------------------------------*/
// The AT91SAM7S64 embeds a 16-Kbyte SRAM bank, and 64 K-Byte Flash
#define INT_SARM 0x00200000
#define INT_SARM_REMAP 0x00000000
#define INT_FLASH 0x00000000
#define INT_FLASH_REMAP 0x01000000
#define FLASH_PAGE_NB 512
#define FLASH_PAGE_SIZE 128
/*-----------------*/
/* Leds Definition */
/*-----------------*/
/* PIO Flash PA PB PIN */
#define LED1 (1<<0) /* PA0 / PGMEN0 & PWM0 TIOA0 48 */
#define LED2 (1<<1) /* PA1 / PGMEN1 & PWM1 TIOB0 47 */
#define LED3 (1<<2) /* PA2 & PWM2 SCK0 44 */
#define LED4 (1<<3) /* PA3 & TWD NPCS3 43 */
#define NB_LED 4
#define LED_MASK (LED1|LED2|LED3|LED4)
/*-------------------------*/
/* Push Buttons Definition */
/*-------------------------*/
/* PIO Flash PA PB PIN */
#define SW1_MASK (1<<19) /* PA19 / PGMD7 & RK FIQ 13 */
#define SW2_MASK (1<<20) /* PA20 / PGMD8 & RF IRQ0 16 */
#define SW3_MASK (1<<15) /* PA15 / PGM3 & TF TIOA1 20 */
#define SW4_MASK (1<<14) /* PA14 / PGMD2 & SPCK PWM3 21 */
#define SW_MASK (SW1_MASK|SW2_MASK|SW3_MASK|SW4_MASK)
#define SW1 (1<<19) // PA19
#define SW2 (1<<20) // PA20
#define SW3 (1<<15) // PA15
#define SW4 (1<<14) // PA14
/*------------------*/
/* USART Definition */
/*------------------*/
/* SUB-D 9 points J3 DBGU*/
#define DBGU_RXD AT91C_PA9_DRXD /* JP11 must be close */
#define DBGU_TXD AT91C_PA10_DTXD /* JP12 must be close */
#define AT91C_DBGU_BAUD 115200 // Baud rate
#define US_RXD_PIN AT91C_PA5_RXD0 /* JP9 must be close */
#define US_TXD_PIN AT91C_PA6_TXD0 /* JP7 must be close */
#define US_RTS_PIN AT91C_PA7_RTS0 /* JP8 must be close */
#define US_CTS_PIN AT91C_PA8_CTS0 /* JP6 must be close */
/*--------------*/
/* Master Clock */
/*--------------*/
#define EXT_OC 18432000 // Exetrnal ocilator MAINCK
#define MCK 47923200 // MCK (PLLRC div by 2)
#define MCKKHz (MCK/1000) //
#endif /* Board_h */

File diff suppressed because it is too large Load Diff

View File

@@ -1,267 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks. The SAM7
* includes a sample USB that emulates a Joystick input to a USB host.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles the onboard LED. Should any task contain an error at any time
* the LED toggle rate will change from 3 seconds to 500ms.
*
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "flash.h"
#include "integer.h"
#include "PollQ.h"
#include "BlockQ.h"
#include "semtest.h"
#include "dynamic.h"
#include "partest.h"
#include "comtest2.h"
#include "USB/USBSample.h"
/* Priorities for the demo application tasks. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainUSB_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* Constants required by the 'Check' task. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( 3 )
/* Constants for the ComTest tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 115200 )
#define mainCOM_TEST_LED ( 4 ) /* Off the board. */
/*
* The task that executes at the highest priority and calls
* prvCheckOtherTasksAreStillRunning(). See the description at the top
* of the file.
*/
static void vErrorChecks( void *pvParameters );
/*
* Configure the processor for use with the Atmel demo board. Setup is minimal
* as the low level init function (called from the startup asm file) takes care
* of most things.
*/
static void prvSetupHardware( void );
/*
* Checks that all the demo application tasks are still executing without error
* - as described at the top of the file.
*/
static portLONG prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/*
* Starts all the other tasks, then starts the scheduler.
*/
void main( void )
{
/* Setup any hardware that has not already been configured by the low
level init routines. */
prvSetupHardware();
/* Initialise the LED outputs for use by the demo application tasks. */
vParTestInitialise();
/* Start all the standard demo application tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartDynamicPriorityTasks();
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
/* Also start the USB demo which is just for the SAM7. */
xTaskCreate( vUSBDemoTask, "USB", configMINIMAL_STACK_SIZE, NULL, mainUSB_PRIORITY, NULL );
/* Start the check task - which is defined in this file. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler.
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used here. */
vTaskStartScheduler();
/* We should never get here as control is now taken by the scheduler. */
return;
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
/* When using the JTAG debugger the hardware is not always initialised to
the correct default state. This line just ensures that this does not
cause all interrupts to be masked at the start. */
AT91C_BASE_AIC->AIC_EOICR = 0;
/* Most setup is performed by the low level init function called from the
startup asm file. */
/* Configure the PIO Lines corresponding to LED1 to LED4 to be outputs as
well as the UART Tx line. */
AT91F_PIO_CfgOutput( AT91C_BASE_PIOA, LED_MASK );
/* Enable the peripheral clock. */
AT91F_PMC_EnablePeriphClock( AT91C_BASE_PMC, 1 << AT91C_ID_PIOA );
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
/* The parameters are not used in this task. */
( void ) pvParameters;
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. If an error is detected then the delay period
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
the on board LED flash rate will increase. */
for( ;; )
{
/* Delay until it is time to execute again. */
vTaskDelay( xDelayPeriod );
/* Check all the standard demo application tasks are executing without
error. */
if( prvCheckOtherTasksAreStillRunning() != pdPASS )
{
/* An error has been detected in one of the tasks - flash faster. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portLONG prvCheckOtherTasksAreStillRunning( void )
{
portLONG lReturn = ( portLONG ) pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
return lReturn;
}
/*-----------------------------------------------------------*/

View File

@@ -1,42 +0,0 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x00000100;
define symbol __ICFEDIT_region_ROM_end__ = 0x0000FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x00200000;
define symbol __ICFEDIT_region_RAM_end__ = 0x00203FFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x200;
define symbol __ICFEDIT_size_svcstack__ = 0x200;
define symbol __ICFEDIT_size_irqstack__ = 0x200;
define symbol __ICFEDIT_size_fiqstack__ = 0x4;
define symbol __ICFEDIT_size_undstack__ = 0x4;
define symbol __ICFEDIT_size_abtstack__ = 0x4;
define symbol __ICFEDIT_size_heap__ = 0x4;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
block UND_STACK, block ABT_STACK, block HEAP };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,261 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
/* Demo application includes. */
#include "serial.h"
/*-----------------------------------------------------------*/
/* Location of the COM0 registers. */
#define serCOM0 ( ( AT91PS_USART ) AT91C_BASE_US0 )
/* Interrupt control macros. */
#define serINTERRUPT_LEVEL ( 5 )
#define vInterruptOn() AT91F_US_EnableIt( serCOM0, AT91C_US_TXRDY | AT91C_US_RXRDY )
#define vInterruptOff() AT91F_US_DisableIt( serCOM0, AT91C_US_TXRDY )
/* Misc constants. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
#define serNO_TIMEGUARD ( ( unsigned portLONG ) 0 )
#define serNO_PERIPHERAL_B_SETUP ( ( unsigned portLONG ) 0 )
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
/*-----------------------------------------------------------*/
/* Interrupt entry point written in the assembler file serialISR.s79. */
extern void vSerialISREntry( void );
/* The interrupt service routine - called from the assembly entry point. */
__arm void vSerialISR( void );
/*-----------------------------------------------------------*/
/*
* See the serial2.h header file.
*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
xComPortHandle xReturn = serHANDLE;
extern void ( vUART_ISR )( void );
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* If the queues were created correctly then setup the serial port
hardware. */
if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) )
{
portENTER_CRITICAL();
{
/* Enable the USART clock. */
AT91F_PMC_EnablePeriphClock( AT91C_BASE_PMC, 1 << AT91C_ID_US0 );
AT91F_PIO_CfgPeriph( AT91C_BASE_PIOA, ( ( unsigned portLONG ) AT91C_PA5_RXD0 ) | ( ( unsigned portLONG ) AT91C_PA6_TXD0 ), serNO_PERIPHERAL_B_SETUP );
/* Set the required protocol. */
AT91F_US_Configure( serCOM0, configCPU_CLOCK_HZ, AT91C_US_ASYNC_MODE, ulWantedBaud, serNO_TIMEGUARD );
/* Enable Rx and Tx. */
serCOM0->US_CR = AT91C_US_RXEN | AT91C_US_TXEN;
/* Enable the Rx interrupts. The Tx interrupts are not enabled
until there are characters to be transmitted. */
AT91F_US_EnableIt( serCOM0, AT91C_US_RXRDY );
/* Enable the interrupts in the AIC. */
AT91F_AIC_ConfigureIt( AT91C_BASE_AIC, AT91C_ID_US0, serINTERRUPT_LEVEL, AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE, ( void (*)( void ) ) vSerialISREntry );
AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_US0 );
}
portEXIT_CRITICAL();
}
else
{
xReturn = ( xComPortHandle ) 0;
}
/* This demo file only supports a single port but we have to return
something to comply with the standard demo header file. */
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* A couple of parameters that this port does not use. */
( void ) usStringLength;
( void ) pxPort;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
/* Place the character in the queue of characters to be transmitted. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
{
return pdFAIL;
}
/* Turn on the Tx interrupt so the ISR will remove the character from the
queue and send it. This does not need to be in a critical section as
if the interrupt has already removed the character the next interrupt
will simply turn off the Tx interrupt again. */
vInterruptOn();
return pdPASS;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
/* Not supported as not required by the demo application. */
}
/*-----------------------------------------------------------*/
/* Serial port ISR. This can cause a context switch so is not defined as a
standard ISR using the __irq keyword. Instead a wrapper function is defined
within serialISR.s79 which in turn calls this function. See the port
documentation on the FreeRTOS.org website for more information. */
__arm void vSerialISR( void )
{
unsigned portLONG ulStatus;
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt? */
ulStatus = serCOM0->US_CSR &= serCOM0->US_IMR;
if( ulStatus & AT91C_US_TXRDY )
{
/* The interrupt was caused by the THR becoming empty. Are there any
more characters to transmit? */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
/* A character was retrieved from the queue so can be sent to the
THR now. */
serCOM0->US_THR = cChar;
}
else
{
/* Queue empty, nothing to send so turn off the Tx interrupt. */
vInterruptOff();
}
}
if( ulStatus & AT91C_US_RXRDY )
{
/* The interrupt was caused by a character being received. Grab the
character from the RHR and place it in the queue or received
characters. */
cChar = serCOM0->US_RHR;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
}
/* If a task was woken by either a character being received or a character
being transmitted then we may need to switch to another task. */
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
/* End the interrupt in the AIC. */
AT91C_BASE_AIC->AIC_EOICR = 0;
}

View File

@@ -1,62 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Project>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>204</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Disassembly>
<PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><MixedMode>1</MixedMode><CodeCovEnabled>0</CodeCovEnabled><CodeCovShow>0</CodeCovShow></Disassembly>
<Debug-Log><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window></Windows></PreferedWindows></Debug-Log>
<Build><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Debug-Log</Factory></Window></Windows></PreferedWindows></Build>
<Register>
<PreferedWindows>
<Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows>
</Register>
<QWatch><Column0>161</Column0><Column1>100</Column1><Column2>100</Column2><Column3>100</Column3></QWatch><Memory><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><ZoneNumber>0</ZoneNumber><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory></Static>
<Windows>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-22256-14845</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode><ExpandedNode>rtosdemo/USBSample.c</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3><Tabs><Tab><Identity>TabID-18517-20319</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>25</YPos><SelStart>1726</SelStart><SelEnd>1726</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\SrcIAR\Cstartup.s79</Filename><XPos>0</XPos><YPos>19</YPos><SelStart>1527</SelStart><SelEnd>1527</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\SrcIAR\Cstartup.s</Filename><XPos>0</XPos><YPos>52</YPos><SelStart>3250</SelStart><SelEnd>3250</SelEnd></Tab><ActiveTab>2</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Source\portable\IAR\AtmelSAM7S64\port.c</Filename><XPos>0</XPos><YPos>217</YPos><SelStart>8345</SelStart><SelEnd>8345</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-01284260><key>iaridepm.enu1</key></Toolbar-01284260><Toolbar-070bd990><key>debuggergui.enu1</key></Toolbar-070bd990></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>740</Bottom><Right>278</Right><x>-2</x><y>-2</y><xscreen>0</xscreen><yscreen>0</yscreen><sizeHorzCX>0</sizeHorzCX><sizeHorzCY>0</sizeHorzCY><sizeVertCX>166667</sizeVertCX><sizeVertCY>755601</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Project>

View File

@@ -1,39 +0,0 @@
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1
[JLinkDriver]
WatchVectorCatch=_ 0
WatchCond=_ 0
Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
[Low Level]
Pipeline mode=1
Initialized=0
[CodeCoverage]
Enabled=_ 0
[Profiling]
Enabled=0
[StackPlugin]
Enabled=1
OverflowWarningsEnabled=1
WarningThreshold=90
SpWarningsEnabled=1
WarnHow=0
UseTrigger=1
TriggerName=main
LimitSize=0
ByteLimit=50
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
[Disassemble mode]
mode=0
[Breakpoints]
Count=0
[TraceHelper]
Enabled=0
ShowSource=1

View File

@@ -1,76 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>rtosdemo/Flash Bin</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>236</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build><ColumnWidth0>18</ColumnWidth0><ColumnWidth1>1155</ColumnWidth1><ColumnWidth2>308</ColumnWidth2><ColumnWidth3>77</ColumnWidth3></Build>
<Debug-Log/>
<TerminalIO/>
<CodeCoveragePlugin/>
<Profiling/>
<Watch>
<Format>
<struct_types/>
<watch_formats/>
</Format>
</Watch>
<Disassembly><MixedMode>1</MixedMode><CodeCovEnabled>0</CodeCovEnabled><CodeCovShow>0</CodeCovShow></Disassembly><Memory><ZoneNumber>0</ZoneNumber><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory></Static>
<Windows>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-17425-14382</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3>
<Tabs>
<Tab>
<Identity>TabID-4084-16269</Identity>
<TabName>Build</TabName>
<Factory>Build</Factory>
<Session/>
</Tab>
<Tab>
<Identity>TabID-25581-16276</Identity>
<TabName>Debug Log</TabName>
<Factory>Debug-Log</Factory>
<Session/>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-01284260><key>iaridepm.enu1</key></Toolbar-01284260></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>576</Bottom><Right>310</Right><x>-2</x><y>-2</y><xscreen>32</xscreen><yscreen>26</yscreen><sizeHorzCX>19048</sizeHorzCX><sizeHorzCY>26477</sizeHorzCY><sizeVertCX>185714</sizeVertCX><sizeVertCY>588595</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>362</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>364</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>370672</sizeHorzCY><sizeVertCX>19048</sizeVertCX><sizeVertCY>26477</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View File

@@ -1,113 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <stdio.h>
#include "AT91SAM7X256.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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 47923200 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 130 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_xTaskGetCurrentTaskHandle 1
/* MAC address configuration. */
#define uipMAC_ADDR0 0x00
#define uipMAC_ADDR1 0x12
#define uipMAC_ADDR2 0x13
#define uipMAC_ADDR3 0x10
#define uipMAC_ADDR4 0x15
#define uipMAC_ADDR5 0x11
/* IP address configuration. */
#define uipIP_ADDR0 172
#define uipIP_ADDR1 25
#define uipIP_ADDR2 218
#define uipIP_ADDR3 10
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,149 +0,0 @@
#/*
# FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
#
# 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 exception 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.
# Alternative commercial license and support terms are also available upon
# request. See the licensing section of http://www.FreeRTOS.org for full
# license details.
#
# 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. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
# Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#
#
# ***************************************************************************
# * *
# * Looking for a quick start? Then check out the FreeRTOS eBook! *
# * See http://www.FreeRTOS.org/Documentation for details *
# * *
# ***************************************************************************
#
# 1 tab == 4 spaces!
#
# Please ensure to read the configuration and relevant port sections of the
# online documentation.
#
# http://www.FreeRTOS.org - Documentation, latest information, license and
# contact details.
#
# http://www.SafeRTOS.com - A version that is certified for use in safety
# critical systems.
#
# http://www.OpenRTOS.com - Commercial support, development, porting,
# licensing and training services.
#*/
RTOS_SOURCE_DIR=../../../Source
DEMO_COMMON_DIR=../../Common/Minimal
DEMO_INCLUDE_DIR=../../Common/include
UIP_COMMON_DIR=../../Common/ethernet/uIP/uip-1.0/uip
CC=arm-elf-gcc
OBJCOPY=arm-elf-objcopy
LDSCRIPT=atmel-rom.ld
LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
DEBUG=-g
OPTIM=-O3
CFLAGS= $(DEBUG) \
$(OPTIM) \
-T$(LDSCRIPT) \
-I . \
-I $(RTOS_SOURCE_DIR)/include \
-I $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S \
-I $(DEMO_INCLUDE_DIR) \
-I ./webserver \
-I $(UIP_COMMON_DIR) \
-I ./SrcAtmel \
-I ./USB \
-D SAM7_GCC \
-D THUMB_INTERWORK \
-mcpu=arm7tdmi \
-D PACK_STRUCT_END=__attribute\(\(packed\)\) \
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) \
-fomit-frame-pointer \
-mthumb-interwork
THUMB_SOURCE= \
main.c \
./ParTest/ParTest.c \
$(DEMO_COMMON_DIR)/BlockQ.c \
$(DEMO_COMMON_DIR)/blocktim.c \
$(DEMO_COMMON_DIR)/flash.c \
$(DEMO_COMMON_DIR)/integer.c \
$(DEMO_COMMON_DIR)/GenQTest.c \
$(DEMO_COMMON_DIR)/QPeek.c \
$(DEMO_COMMON_DIR)/dynamic.c \
./webserver/uIP_Task.c \
./webserver/httpd.c \
./webserver/httpd-cgi.c \
./webserver/httpd-fs.c \
./webserver/http-strings.c \
./webserver/SAM7_EMAC.c \
$(UIP_COMMON_DIR)/uip_arp.c \
$(UIP_COMMON_DIR)/psock.c \
$(UIP_COMMON_DIR)/timer.c \
$(UIP_COMMON_DIR)/uip.c \
$(RTOS_SOURCE_DIR)/list.c \
$(RTOS_SOURCE_DIR)/queue.c \
$(RTOS_SOURCE_DIR)/tasks.c \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/port.c \
$(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
./USB/USBSample.c
ARM_SOURCE= \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_AT91SAM7S/portISR.c \
./webserver/emac_isr.c \
./SrcAtmel/Cstartup_SAM7.c \
./USB/USB_ISR.c
THUMB_OBJS = $(THUMB_SOURCE:.c=.o)
ARM_OBJS = $(ARM_SOURCE:.c=.o)
all: RTOSDemo.bin
RTOSDemo.bin : RTOSDemo.hex
$(OBJCOPY) RTOSDemo.elf -O binary RTOSDemo.bin
RTOSDemo.hex : RTOSDemo.elf
$(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
RTOSDemo.elf : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
$(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s $(LINKER_FLAGS)
$(THUMB_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) -mthumb $< -o $@
$(ARM_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) $< -o $@
clean :
rm $(THUMB_OBJS)
rm $(ARM_OBJS)
touch Makefile
rm RTOSDemo.elf
rm RTOSDemo.hex

View File

@@ -1,112 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Scheduler includes. */
#include "FreeRTOS.h"
/* Demo application includes. */
#include "partest.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's. LED's can be set, cleared
* or toggled.
*-----------------------------------------------------------*/
#define partstNUM_LEDS ( 4 )
#define partstALL_LEDS ( ulLED_Mask[ 0 ] | ulLED_Mask[ 1 ] | ulLED_Mask[ 2 ] | ulLED_Mask[ 3 ] )
const unsigned portLONG ulLED_Mask[ partstNUM_LEDS ]= { (1<<19), (1<<20), (1<<21), (1<<22) };
void vParTestInitialise( void )
{
/* Configure the PIO Lines corresponding to LED1 to LED4 to be outputs. */
AT91C_BASE_PIOB->PIO_PER = partstALL_LEDS;
AT91C_BASE_PIOB->PIO_OER = partstALL_LEDS;
/* Start with all LED's off. */
AT91C_BASE_PIOB->PIO_SODR = partstALL_LEDS;
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED < ( portBASE_TYPE ) partstNUM_LEDS )
{
if( xValue )
{
AT91C_BASE_PIOB->PIO_SODR = ulLED_Mask[ uxLED ];
}
else
{
AT91C_BASE_PIOB->PIO_CODR = ulLED_Mask[ uxLED ];
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED < ( portBASE_TYPE ) partstNUM_LEDS )
{
if( AT91C_BASE_PIOB->PIO_PDSR & ulLED_Mask[ uxLED ] )
{
AT91C_BASE_PIOB->PIO_CODR = ulLED_Mask[ uxLED ];
}
else
{
AT91C_BASE_PIOB->PIO_SODR = ulLED_Mask[ uxLED ];
}
}
}
/*-----------------------------------------------------------*/
unsigned portBASE_TYPE uxParTestGetLED( void )
{
/* Return the value of LED DS4 for use by the WEB server. */
return !( AT91C_BASE_PIOB->PIO_PDSR & ulLED_Mask[ partstNUM_LEDS - 1 ] );
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,95 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef USB_DEMO_H
#define USB_DEMO_H
/*-----------------------------------------------------------*/
#define usbQUEUE_LENGTH ( 0x3 ) /* Must have all bits set! */
#define usbEND_POINT_0 ( 0 )
#define usbEND_POINT_1 ( 1 )
#define usbRX_COUNT_MASK ( ( unsigned portLONG ) 0x7ff )
#define AT91C_UDP_STALLSENT AT91C_UDP_ISOERROR
/* Structure used to take a snapshot of the USB status from within the ISR. */
typedef struct X_ISR_STATUS
{
unsigned portLONG ulISR;
unsigned portLONG ulCSR0;
unsigned portCHAR ucFifoData[ 8 ];
} xISRStatus;
/* Macros to manipulate the control and status registers. These registers
cannot be accessed using a direct read modify write operation outside of the
ISR as some bits are left unchanged by writing with a 0, and some are left
unchanged by writing with a 1. */
#define usbCSR_SET_BIT( pulValueNow, ulBit ) \
{ \
/* Set TXCOMP, RX_DATA_BK0, RXSETUP, */ \
/* STALLSENT and RX_DATA_BK1 to 1 so the */ \
/* write has no effect. */ \
( * ( ( unsigned portLONG * ) pulValueNow ) ) |= ( unsigned portLONG ) 0x4f; \
\
/* Clear the FORCE_STALL and TXPKTRDY bits */ \
/* so the write has no effect. */ \
( * ( ( unsigned portLONG * ) pulValueNow ) ) &= ( unsigned portLONG ) 0xffffffcf; \
\
/* Set whichever bit we want set. */ \
( * ( ( unsigned portLONG * ) pulValueNow ) ) |= ( ulBit ); \
}
/*
* Creates the queue used to communicate between the USB task and the USB ISR, then
* createst the task that manages the USB peripheral.
*/
void vStartUSBTask( unsigned portBASE_TYPE uxPriority );
#endif

View File

@@ -1,191 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
/* Demo app includes. */
#include "USBSample.h"
#define usbINT_CLEAR_MASK (AT91C_UDP_TXCOMP | AT91C_UDP_STALLSENT | AT91C_UDP_RXSETUP | AT91C_UDP_RX_DATA_BK0 | AT91C_UDP_RX_DATA_BK1 )
#define usbCSR_CLEAR_BIT( pulValueNow, ulBit ) \
{ \
/* Set TXCOMP, RX_DATA_BK0, RXSETUP, */ \
/* STALLSENT and RX_DATA_BK1 to 1 so the */ \
/* write has no effect. */ \
( * ( ( unsigned portLONG * ) pulValueNow ) ) |= ( unsigned portLONG ) 0x4f; \
\
/* Clear the FORCE_STALL and TXPKTRDY bits */ \
/* so the write has no effect. */ \
( * ( ( unsigned portLONG * ) pulValueNow ) ) &= ( unsigned portLONG ) 0xffffffcf; \
\
/* Clear whichever bit we want clear. */ \
( * ( ( unsigned portLONG * ) pulValueNow ) ) &= ( ~ulBit ); \
}
/*-----------------------------------------------------------*/
/*
* ISR entry point.
*/
void vUSB_ISR_Wrapper( void ) __attribute__((naked));
/*
* Actual ISR handler. This must be separate from the entry point as the stack
* is used.
*/
void vUSB_ISR_Handler( void );
/*-----------------------------------------------------------*/
/* Array in which the USB interrupt status is passed between the ISR and task. */
static xISRStatus xISRMessages[ usbQUEUE_LENGTH + 1 ];
/* Queue used to pass messages between the ISR and the task. */
extern xQueueHandle xUSBInterruptQueue;
/*-----------------------------------------------------------*/
void vUSB_ISR_Handler( void )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
static volatile unsigned portLONG ulNextMessage = 0;
xISRStatus *pxMessage;
unsigned portLONG ulTemp, ulRxBytes;
/* To reduce the amount of time spent in this interrupt it would be
possible to defer the majority of this processing to an 'interrupt task',
that is a task that runs at a higher priority than any of the application
tasks. */
/* Take the next message from the queue. Note that usbQUEUE_LENGTH *must*
be all 1's, as in 0x01, 0x03, 0x07, etc. */
pxMessage = &( xISRMessages[ ( ulNextMessage & usbQUEUE_LENGTH ) ] );
ulNextMessage++;
/* Take a snapshot of the current USB state for processing at the task
level. */
pxMessage->ulISR = AT91C_BASE_UDP->UDP_ISR;
pxMessage->ulCSR0 = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_0 ];
/* Clear the interrupts from the ICR register. The bus end interrupt is
cleared separately as it does not appear in the mask register. */
AT91C_BASE_UDP->UDP_ICR = AT91C_BASE_UDP->UDP_IMR | AT91C_UDP_ENDBUSRES;
/* If there are bytes in the FIFO then we have to retrieve them here.
Ideally this would be done at the task level. However we need to clear the
RXSETUP interrupt before leaving the ISR, and this may cause the data in
the FIFO to be overwritten. Also the DIR bit has to be changed before the
RXSETUP bit is cleared (as per the SAM7 manual). */
ulTemp = pxMessage->ulCSR0;
/* Are there any bytes in the FIFO? */
ulRxBytes = ulTemp >> 16;
ulRxBytes &= usbRX_COUNT_MASK;
/* With this minimal implementation we are only interested in receiving
setup bytes on the control end point. */
if( ( ulRxBytes > 0 ) && ( ulTemp & AT91C_UDP_RXSETUP ) )
{
/* Take off 1 for a zero based index. */
while( ulRxBytes > 0 )
{
ulRxBytes--;
pxMessage->ucFifoData[ ulRxBytes ] = AT91C_BASE_UDP->UDP_FDR[ usbEND_POINT_0 ];
}
/* The direction must be changed first. */
usbCSR_SET_BIT( &ulTemp, ( AT91C_UDP_DIR ) );
AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_0 ] = ulTemp;
}
/* Must write zero's to TXCOMP, STALLSENT, RXSETUP, and the RX DATA
registers to clear the interrupts in the CSR register. */
usbCSR_CLEAR_BIT( &ulTemp, usbINT_CLEAR_MASK );
AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_0 ] = ulTemp;
/* Also clear the interrupts in the CSR1 register. */
ulTemp = AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ];
usbCSR_CLEAR_BIT( &ulTemp, usbINT_CLEAR_MASK );
AT91C_BASE_UDP->UDP_CSR[ usbEND_POINT_1 ] = ulTemp;
/* The message now contains the entire state and optional data from
the USB interrupt. This can now be posted on the Rx queue ready for
processing at the task level. */
xQueueSendFromISR( xUSBInterruptQueue, &pxMessage, &xHigherPriorityTaskWoken );
/* We may want to switch to the USB task, if this message has made
it the highest priority task that is ready to execute. */
if( xHigherPriorityTaskWoken )
{
portYIELD_FROM_ISR();
}
/* Clear the AIC ready for the next interrupt. */
AT91C_BASE_AIC->AIC_EOICR = 0;
}
/*-----------------------------------------------------------*/
void vUSB_ISR_Wrapper( void )
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler itself. This must be a separate function as it uses
the stack. */
vUSB_ISR_Handler();
/* Restore the context of the task that is going to
execute next. This might not be the same as the originally
interrupted task.*/
portRESTORE_CONTEXT();
}

View File

@@ -1,247 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
NOTE : Tasks run in System mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used.
*/
/*
* This demo includes a (basic) USB mouse driver and a WEB server. It is
* targeted for the AT91SAM7X EK prototyping board which includes a small
* joystick to provide the mouse inputs. The WEB interface provides some basic
* interactivity through the use of a check box to turn on and off an LED.
*
* main() creates the WEB server, USB, and a set of the standard demo tasks
* before starting the scheduler. See the online FreeRTOS.org documentation
* for more information on the standard demo tasks.
*
* LEDs D1 to D3 are controlled by the standard 'flash' tasks - each will
* toggle at a different fixed frequency.
*
* A tick hook function is used to monitor the standard demo tasks - with LED
* D4 being used to indicate the system status. D4 toggling every 5 seconds
* indicates that all the standard demo tasks are executing without error. The
* toggle rate increasing to 500ms is indicative of an error having been found
* in at least one demo task.
*
* See the online documentation page that accompanies this demo for full setup
* and usage information.
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "partest.h"
#include "USBSample.h"
#include "uip_task.h"
#include "BlockQ.h"
#include "blocktim.h"
#include "flash.h"
#include "QPeek.h"
#include "dynamic.h"
/* Priorities for the demo application tasks. */
#define mainUIP_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainUSB_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainFLASH_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
/* The task allocated to the uIP task is large to account for its use of the
sprintf() library function. Use of a cut down printf() library would allow
the stack usage to be greatly reduced. */
#define mainUIP_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 6 )
/* The LED toggle by the tick hook should an error have been found in a task. */
#define mainERROR_LED ( 3 )
/*-----------------------------------------------------------*/
/*
* Configure the processor for use with the Atmel demo board. Setup is minimal
* as the low level init function (called from the startup asm file) takes care
* of most things.
*/
static void prvSetupHardware( void );
/*-----------------------------------------------------------*/
/*
* Starts all the other tasks, then starts the scheduler.
*/
int main( void )
{
/* Setup any hardware that has not already been configured by the low
level init routines. */
prvSetupHardware();
/* Start the task that handles the TCP/IP and WEB server functionality. */
xTaskCreate( vuIP_Task, "uIP", mainUIP_TASK_STACK_SIZE, NULL, mainUIP_PRIORITY, NULL );
/* Also start the USB demo which is just for the SAM7. */
vStartUSBTask( mainUSB_PRIORITY );
/* Start the standard demo tasks. */
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vCreateBlockTimeTasks();
vStartLEDFlashTasks( mainFLASH_PRIORITY );
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
vStartQueuePeekTasks();
vStartDynamicPriorityTasks();
/* Start the scheduler.
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used here. */
vTaskStartScheduler();
/* We should never get here as control is now taken by the scheduler. */
return 0;
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
portDISABLE_INTERRUPTS();
/* When using the JTAG debugger the hardware is not always initialised to
the correct default state. This line just ensures that this does not
cause all interrupts to be masked at the start. */
AT91C_BASE_AIC->AIC_EOICR = 0;
/* Most setup is performed by the low level init function called from the
startup asm file. */
/* Enable the peripheral clock. */
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOA;
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOB;
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_EMAC;
/* Initialise the LED outputs for use by the demo application tasks. */
vParTestInitialise();
}
/*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
static unsigned portLONG ulCallCount = 0, ulErrorFound = pdFALSE;
/* The rate at which LED D4 will toggle if an error has been found in one or
more of the standard demo tasks. */
const unsigned portLONG ulErrorFlashRate = 500 / portTICK_RATE_MS;
/* The rate at which LED D4 will toggle if no errors have been found in any
of the standard demo tasks. */
const unsigned portLONG ulNoErrorCheckRate = 5000 / portTICK_RATE_MS;
ulCallCount++;
if( ulErrorFound != pdFALSE )
{
/* We have already found an error, so flash the LED with the appropriate
frequency. */
if( ulCallCount > ulErrorFlashRate )
{
ulCallCount = 0;
vParTestToggleLED( mainERROR_LED );
}
}
else
{
if( ulCallCount > ulNoErrorCheckRate )
{
ulCallCount = 0;
/* We have not yet found an error. Check all the demo tasks to ensure
this is still the case. */
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorFound |= 0x01;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x02;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x04;
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x08;
}
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x10;
}
vParTestToggleLED( mainERROR_LED );
}
}
}

View File

@@ -1,112 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* Wrapper for the EMAC interrupt. */
void vEMACISR_Wrapper( void ) __attribute__((naked));
/* Handler called by the ISR wrapper. This must be kept a separate
function to ensure the stack frame is correctly set up. */
void vEMACISR_Handler( void );
static xSemaphoreHandle xEMACSemaphore;
/*-----------------------------------------------------------*/
void vPassEMACSemaphore( xSemaphoreHandle xSemaphore )
{
xEMACSemaphore = xSemaphore;
}
/*-----------------------------------------------------------*/
void vEMACISR_Handler( void )
{
volatile unsigned portLONG ulIntStatus, ulRxStatus;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
ulIntStatus = AT91C_BASE_EMAC->EMAC_ISR;
ulRxStatus = AT91C_BASE_EMAC->EMAC_RSR;
if( ( ulIntStatus & AT91C_EMAC_RCOMP ) || ( ulRxStatus & AT91C_EMAC_REC ) )
{
/* A frame has been received, signal the uIP task so it can process
the Rx descriptors. */
xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken );
AT91C_BASE_EMAC->EMAC_RSR = AT91C_EMAC_REC;
}
/* Clear the interrupt. */
AT91C_BASE_AIC->AIC_EOICR = 0;
/* Switch to the uIP task. */
if( xHigherPriorityTaskWoken )
{
/* If a task of higher priority than the interrupted task was
unblocked by the ISR then this call will ensure that the
unblocked task is the task the ISR returns to. */
portYIELD_FROM_ISR();
}
}
/*-----------------------------------------------------------*/
void vEMACISR_Wrapper( void )
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler task to do the actual work. This must be a separate
function to ensure the stack frame is correctly set up. */
vEMACISR_Handler();
/* Restore the context of whichever task is the next to run. */
portRESTORE_CONTEXT();
}

View File

@@ -1,685 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Standard includes. */
#include <string.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* Demo application includes. */
#include "SAM7_EMAC.h"
/* uIP includes. */
#include "uip.h"
/* Hardware specific includes. */
#include "Emac.h"
#include "mii.h"
#include "AT91SAM7X256.h"
/* USE_RMII_INTERFACE must be defined as 1 to use an RMII interface, or 0
to use an MII interface. */
#define USE_RMII_INTERFACE 0
/* The buffer addresses written into the descriptors must be aligned so the
last few bits are zero. These bits have special meaning for the EMAC
peripheral and cannot be used as part of the address. */
#define emacADDRESS_MASK ( ( unsigned portLONG ) 0xFFFFFFFC )
/* Bit used within the address stored in the descriptor to mark the last
descriptor in the array. */
#define emacRX_WRAP_BIT ( ( unsigned portLONG ) 0x02 )
/* Bit used within the Tx descriptor status to indicate whether the
descriptor is under the control of the EMAC or the software. */
#define emacTX_BUF_USED ( ( unsigned portLONG ) 0x80000000 )
/* A short delay is used to wait for a buffer to become available, should
one not be immediately available when trying to transmit a frame. */
#define emacBUFFER_WAIT_DELAY ( 2 )
#define emacMAX_WAIT_CYCLES ( configTICK_RATE_HZ / 40 )
/* Misc defines. */
#define emacINTERRUPT_LEVEL ( 5 )
#define emacNO_DELAY ( 0 )
#define emacTOTAL_FRAME_HEADER_SIZE ( 54 )
#define emacPHY_INIT_DELAY ( 5000 / portTICK_RATE_MS )
#define emacRESET_KEY ( ( unsigned portLONG ) 0xA5000000 )
#define emacRESET_LENGTH ( ( unsigned portLONG ) ( 0x01 << 8 ) )
/* The Atmel header file only defines the TX frame length mask. */
#define emacRX_LENGTH_FRAME ( 0xfff )
/* Peripheral setup for the EMAC. */
#define emacPERIPHERAL_A_SETUP ( ( unsigned portLONG ) AT91C_PB2_ETX0 ) | \
( ( unsigned portLONG ) AT91C_PB12_ETXER ) | \
( ( unsigned portLONG ) AT91C_PB16_ECOL ) | \
( ( unsigned portLONG ) AT91C_PB11_ETX3 ) | \
( ( unsigned portLONG ) AT91C_PB6_ERX1 ) | \
( ( unsigned portLONG ) AT91C_PB15_ERXDV ) | \
( ( unsigned portLONG ) AT91C_PB13_ERX2 ) | \
( ( unsigned portLONG ) AT91C_PB3_ETX1 ) | \
( ( unsigned portLONG ) AT91C_PB8_EMDC ) | \
( ( unsigned portLONG ) AT91C_PB5_ERX0 ) | \
( ( unsigned portLONG ) AT91C_PB14_ERX3 ) | \
( ( unsigned portLONG ) AT91C_PB4_ECRS_ECRSDV ) | \
( ( unsigned portLONG ) AT91C_PB1_ETXEN ) | \
( ( unsigned portLONG ) AT91C_PB10_ETX2 ) | \
( ( unsigned portLONG ) AT91C_PB0_ETXCK_EREFCK ) | \
( ( unsigned portLONG ) AT91C_PB9_EMDIO ) | \
( ( unsigned portLONG ) AT91C_PB7_ERXER ) | \
( ( unsigned portLONG ) AT91C_PB17_ERXCK );
/*-----------------------------------------------------------*/
/*
* Prototype for the EMAC interrupt function - called by the asm wrapper.
*/
extern void vEMACISR_Wrapper( void ) __attribute__((naked));
/*
* Initialise both the Tx and Rx descriptors used by the EMAC.
*/
static void prvSetupDescriptors(void);
/*
* Write our MAC address into the EMAC. The MAC address is set as one of the
* uip options.
*/
static void prvSetupMACAddress( void );
/*
* Configure the EMAC and AIC for EMAC interrupts.
*/
static void prvSetupEMACInterrupt( void );
/*
* Some initialisation functions taken from the Atmel EMAC sample code.
*/
static void vReadPHY( unsigned portCHAR ucPHYAddress, unsigned portCHAR ucAddress, unsigned portLONG *pulValue );
#if USE_RMII_INTERFACE != 1
static void vWritePHY( unsigned portCHAR ucPHYAddress, unsigned portCHAR ucAddress, unsigned portLONG ulValue);
#endif
static portBASE_TYPE xGetLinkSpeed( void );
static portBASE_TYPE prvProbePHY( void );
/*-----------------------------------------------------------*/
/* Buffer written to by the EMAC DMA. Must be aligned as described by the
comment above the emacADDRESS_MASK definition. */
#pragma data_alignment=8
static volatile portCHAR pcRxBuffer[ NB_RX_BUFFERS * ETH_RX_BUFFER_SIZE ];
/* Buffer read by the EMAC DMA. Must be aligned as described by he comment
above the emacADDRESS_MASK definition. */
#pragma data_alignment=8
static portCHAR pcTxBuffer[ NB_TX_BUFFERS * ETH_TX_BUFFER_SIZE ];
/* Descriptors used to communicate between the program and the EMAC peripheral.
These descriptors hold the locations and state of the Rx and Tx buffers. */
static volatile AT91S_TxTdDescriptor xTxDescriptors[ NB_TX_BUFFERS ];
static volatile AT91S_RxTdDescriptor xRxDescriptors[ NB_RX_BUFFERS ];
/* The IP and Ethernet addresses are read from the uIP setup. */
const portCHAR cMACAddress[ 6 ] = { uipMAC_ADDR0, uipMAC_ADDR1, uipMAC_ADDR2, uipMAC_ADDR3, uipMAC_ADDR4, uipMAC_ADDR5 };
const unsigned char ucIPAddress[ 4 ] = { uipIP_ADDR0, uipIP_ADDR1, uipIP_ADDR2, uipIP_ADDR3 };
/* The semaphore used by the EMAC ISR to wake the EMAC task. */
static xSemaphoreHandle xSemaphore = NULL;
/*-----------------------------------------------------------*/
xSemaphoreHandle xEMACInit( void )
{
/* Code supplied by Atmel -------------------------------*/
/* Disable pull up on RXDV => PHY normal mode (not in test mode),
PHY has internal pull down. */
AT91C_BASE_PIOB->PIO_PPUDR = 1 << 15;
#if USE_RMII_INTERFACE != 1
/* PHY has internal pull down : set MII mode. */
AT91C_BASE_PIOB->PIO_PPUDR = 1 << 16;
#endif
/* Clear PB18 <=> PHY powerdown. */
AT91C_BASE_PIOB->PIO_PER = 1 << 18;
AT91C_BASE_PIOB->PIO_OER = 1 << 18;
AT91C_BASE_PIOB->PIO_CODR = 1 << 18;
/* After PHY power up, hardware reset. */
AT91C_BASE_RSTC->RSTC_RMR = emacRESET_KEY | emacRESET_LENGTH;
AT91C_BASE_RSTC->RSTC_RCR = emacRESET_KEY | AT91C_RSTC_EXTRST;
/* Wait for hardware reset end. */
while( !( AT91C_BASE_RSTC->RSTC_RSR & AT91C_RSTC_NRSTL ) )
{
__asm volatile ( "NOP" );
}
__asm volatile ( "NOP" );
/* Setup the pins. */
AT91C_BASE_PIOB->PIO_ASR = emacPERIPHERAL_A_SETUP;
AT91C_BASE_PIOB->PIO_PDR = emacPERIPHERAL_A_SETUP;
/* Enable com between EMAC PHY.
Enable management port. */
AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE;
/* MDC = MCK/32. */
AT91C_BASE_EMAC->EMAC_NCFGR |= ( 2 ) << 10;
/* Wait for PHY auto init end (rather crude delay!). */
vTaskDelay( emacPHY_INIT_DELAY );
/* PHY configuration. */
#if USE_RMII_INTERFACE != 1
{
unsigned portLONG ulControl;
/* PHY has internal pull down : disable MII isolate. */
vReadPHY( AT91C_PHY_ADDR, MII_BMCR, &ulControl );
vReadPHY( AT91C_PHY_ADDR, MII_BMCR, &ulControl );
ulControl &= ~BMCR_ISOLATE;
vWritePHY( AT91C_PHY_ADDR, MII_BMCR, ulControl );
}
#endif
/* Disable management port again. */
AT91C_BASE_EMAC->EMAC_NCR &= ~AT91C_EMAC_MPE;
#if USE_RMII_INTERFACE != 1
/* Enable EMAC in MII mode, enable clock ERXCK and ETXCK. */
AT91C_BASE_EMAC->EMAC_USRIO = AT91C_EMAC_CLKEN ;
#else
/* Enable EMAC in RMII mode, enable RMII clock (50MHz from oscillator
on ERFCK). */
AT91C_BASE_EMAC->EMAC_USRIO = AT91C_EMAC_RMII | AT91C_EMAC_CLKEN ;
#endif
/* End of code supplied by Atmel ------------------------*/
/* Setup the buffers and descriptors. */
prvSetupDescriptors();
/* Load our MAC address into the EMAC. */
prvSetupMACAddress();
/* Are we connected? */
if( prvProbePHY() )
{
/* Enable the interrupt! */
portENTER_CRITICAL();
{
prvSetupEMACInterrupt();
vPassEMACSemaphore( xSemaphore );
}
portEXIT_CRITICAL();
}
return xSemaphore;
}
/*-----------------------------------------------------------*/
portLONG lEMACSend( void )
{
static unsigned portBASE_TYPE uxTxBufferIndex = 0;
portBASE_TYPE xWaitCycles = 0;
portLONG lReturn = pdPASS;
portCHAR *pcBuffer;
/* Is a buffer available? */
while( !( xTxDescriptors[ uxTxBufferIndex ].U_Status.status & AT91C_TRANSMIT_OK ) )
{
/* There is no room to write the Tx data to the Tx buffer. Wait a
short while, then try again. */
xWaitCycles++;
if( xWaitCycles > emacMAX_WAIT_CYCLES )
{
/* Give up. */
lReturn = pdFAIL;
break;
}
else
{
vTaskDelay( emacBUFFER_WAIT_DELAY );
}
}
/* lReturn will only be pdPASS if a buffer is available. */
if( lReturn == pdPASS )
{
/* Copy the headers into the Tx buffer. These will be in the uIP buffer. */
pcBuffer = ( portCHAR * ) xTxDescriptors[ uxTxBufferIndex ].addr;
memcpy( ( void * ) pcBuffer, ( void * ) uip_buf, emacTOTAL_FRAME_HEADER_SIZE );
/* If there is room, also copy in the application data if any. */
if( ( uip_len > emacTOTAL_FRAME_HEADER_SIZE ) && ( uip_len <= ( ETH_TX_BUFFER_SIZE - emacTOTAL_FRAME_HEADER_SIZE ) ) )
{
memcpy( ( void * ) &( pcBuffer[ emacTOTAL_FRAME_HEADER_SIZE ] ), ( void * ) uip_appdata, ( uip_len - emacTOTAL_FRAME_HEADER_SIZE ) );
}
/* Send. */
portENTER_CRITICAL();
{
if( uxTxBufferIndex >= ( NB_TX_BUFFERS - 1 ) )
{
/* Fill out the necessary in the descriptor to get the data sent. */
xTxDescriptors[ uxTxBufferIndex ].U_Status.status = ( uip_len & ( unsigned portLONG ) AT91C_LENGTH_FRAME )
| AT91C_LAST_BUFFER
| AT91C_TRANSMIT_WRAP;
uxTxBufferIndex = 0;
}
else
{
/* Fill out the necessary in the descriptor to get the data sent. */
xTxDescriptors[ uxTxBufferIndex ].U_Status.status = ( uip_len & ( unsigned portLONG ) AT91C_LENGTH_FRAME )
| AT91C_LAST_BUFFER;
uxTxBufferIndex++;
}
AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_TSTART;
}
portEXIT_CRITICAL();
}
return lReturn;
}
/*-----------------------------------------------------------*/
unsigned portLONG ulEMACPoll( void )
{
static unsigned portBASE_TYPE ulNextRxBuffer = 0;
unsigned portLONG ulSectionLength = 0, ulLengthSoFar = 0, ulEOF = pdFALSE;
portCHAR *pcSource;
/* Skip any fragments. */
while( ( xRxDescriptors[ ulNextRxBuffer ].addr & AT91C_OWNERSHIP_BIT ) && !( xRxDescriptors[ ulNextRxBuffer ].U_Status.status & AT91C_SOF ) )
{
/* Mark the buffer as free again. */
xRxDescriptors[ ulNextRxBuffer ].addr &= ~( AT91C_OWNERSHIP_BIT );
ulNextRxBuffer++;
if( ulNextRxBuffer >= NB_RX_BUFFERS )
{
ulNextRxBuffer = 0;
}
}
/* Is there a packet ready? */
while( ( xRxDescriptors[ ulNextRxBuffer ].addr & AT91C_OWNERSHIP_BIT ) && !ulSectionLength )
{
pcSource = ( portCHAR * )( xRxDescriptors[ ulNextRxBuffer ].addr & emacADDRESS_MASK );
ulSectionLength = xRxDescriptors[ ulNextRxBuffer ].U_Status.status & emacRX_LENGTH_FRAME;
if( ulSectionLength == 0 )
{
/* The frame is longer than the buffer pointed to by this
descriptor so copy the entire buffer to uIP - then move onto
the next descriptor to get the rest of the frame. */
if( ( ulLengthSoFar + ETH_RX_BUFFER_SIZE ) <= UIP_BUFSIZE )
{
memcpy( &( uip_buf[ ulLengthSoFar ] ), pcSource, ETH_RX_BUFFER_SIZE );
ulLengthSoFar += ETH_RX_BUFFER_SIZE;
}
}
else
{
/* This is the last section of the frame. Copy the section to
uIP. */
if( ulSectionLength < UIP_BUFSIZE )
{
/* The section length holds the length of the entire frame.
ulLengthSoFar holds the length of the frame sections already
copied to uIP, so the length of the final section is
ulSectionLength - ulLengthSoFar; */
if( ulSectionLength > ulLengthSoFar )
{
memcpy( &( uip_buf[ ulLengthSoFar ] ), pcSource, ( ulSectionLength - ulLengthSoFar ) );
}
}
/* Is this the last buffer for the frame? If not why? */
ulEOF = xRxDescriptors[ ulNextRxBuffer ].U_Status.status & AT91C_EOF;
}
/* Mark the buffer as free again. */
xRxDescriptors[ ulNextRxBuffer ].addr &= ~( AT91C_OWNERSHIP_BIT );
/* Increment to the next buffer, wrapping if necessary. */
ulNextRxBuffer++;
if( ulNextRxBuffer >= NB_RX_BUFFERS )
{
ulNextRxBuffer = 0;
}
}
/* If we obtained data but for some reason did not find the end of the
frame then discard the data as it must contain an error. */
if( !ulEOF )
{
ulSectionLength = 0;
}
return ulSectionLength;
}
/*-----------------------------------------------------------*/
static void prvSetupDescriptors(void)
{
unsigned portBASE_TYPE xIndex;
unsigned portLONG ulAddress;
/* Initialise xRxDescriptors descriptor. */
for( xIndex = 0; xIndex < NB_RX_BUFFERS; ++xIndex )
{
/* Calculate the address of the nth buffer within the array. */
ulAddress = ( unsigned portLONG )( pcRxBuffer + ( xIndex * ETH_RX_BUFFER_SIZE ) );
/* Write the buffer address into the descriptor. The DMA will place
the data at this address when this descriptor is being used. Mask off
the bottom bits of the address as these have special meaning. */
xRxDescriptors[ xIndex ].addr = ulAddress & emacADDRESS_MASK;
}
/* The last buffer has the wrap bit set so the EMAC knows to wrap back
to the first buffer. */
xRxDescriptors[ NB_RX_BUFFERS - 1 ].addr |= emacRX_WRAP_BIT;
/* Initialise xTxDescriptors. */
for( xIndex = 0; xIndex < NB_TX_BUFFERS; ++xIndex )
{
/* Calculate the address of the nth buffer within the array. */
ulAddress = ( unsigned portLONG )( pcTxBuffer + ( xIndex * ETH_TX_BUFFER_SIZE ) );
/* Write the buffer address into the descriptor. The DMA will read
data from here when the descriptor is being used. */
xTxDescriptors[ xIndex ].addr = ulAddress & emacADDRESS_MASK;
xTxDescriptors[ xIndex ].U_Status.status = AT91C_TRANSMIT_OK;
}
/* The last buffer has the wrap bit set so the EMAC knows to wrap back
to the first buffer. */
xTxDescriptors[ NB_TX_BUFFERS - 1 ].U_Status.status = AT91C_TRANSMIT_WRAP | AT91C_TRANSMIT_OK;
/* Tell the EMAC where to find the descriptors. */
AT91C_BASE_EMAC->EMAC_RBQP = ( unsigned portLONG ) xRxDescriptors;
AT91C_BASE_EMAC->EMAC_TBQP = ( unsigned portLONG ) xTxDescriptors;
/* Clear all the bits in the receive status register. */
AT91C_BASE_EMAC->EMAC_RSR = ( AT91C_EMAC_OVR | AT91C_EMAC_REC | AT91C_EMAC_BNA );
/* Enable the copy of data into the buffers, ignore broadcasts,
and don't copy FCS. */
AT91C_BASE_EMAC->EMAC_NCFGR |= ( AT91C_EMAC_CAF | AT91C_EMAC_NBC | AT91C_EMAC_DRFCS);
/* Enable Rx and Tx, plus the stats register. */
AT91C_BASE_EMAC->EMAC_NCR |= ( AT91C_EMAC_TE | AT91C_EMAC_RE | AT91C_EMAC_WESTAT );
}
/*-----------------------------------------------------------*/
static void prvSetupMACAddress( void )
{
/* Must be written SA1L then SA1H. */
AT91C_BASE_EMAC->EMAC_SA1L = ( ( unsigned portLONG ) cMACAddress[ 3 ] << 24 ) |
( ( unsigned portLONG ) cMACAddress[ 2 ] << 16 ) |
( ( unsigned portLONG ) cMACAddress[ 1 ] << 8 ) |
cMACAddress[ 0 ];
AT91C_BASE_EMAC->EMAC_SA1H = ( ( unsigned portLONG ) cMACAddress[ 5 ] << 8 ) |
cMACAddress[ 4 ];
}
/*-----------------------------------------------------------*/
static void prvSetupEMACInterrupt( void )
{
/* Create the semaphore used to trigger the EMAC task. */
vSemaphoreCreateBinary( xSemaphore );
if( xSemaphore )
{
/* We start by 'taking' the semaphore so the ISR can 'give' it when the
first interrupt occurs. */
xSemaphoreTake( xSemaphore, emacNO_DELAY );
portENTER_CRITICAL();
{
/* We want to interrupt on Rx events. */
AT91C_BASE_EMAC->EMAC_IER = AT91C_EMAC_RCOMP;
/* Enable the interrupts in the AIC. */
AT91F_AIC_ConfigureIt( AT91C_ID_EMAC, emacINTERRUPT_LEVEL, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, ( void (*)( void ) ) vEMACISR_Wrapper );
AT91C_BASE_AIC->AIC_IECR = 0x1 << AT91C_ID_EMAC;
}
portEXIT_CRITICAL();
}
}
/*-----------------------------------------------------------*/
/*
* The following functions are initialisation functions taken from the Atmel
* EMAC sample code.
*/
static portBASE_TYPE prvProbePHY( void )
{
unsigned portLONG ulPHYId1, ulPHYId2, ulStatus;
portBASE_TYPE xReturn = pdPASS;
/* Code supplied by Atmel (reformatted) -----------------*/
/* Enable management port */
AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_MPE;
AT91C_BASE_EMAC->EMAC_NCFGR |= ( 2 ) << 10;
/* Read the PHY ID. */
vReadPHY( AT91C_PHY_ADDR, MII_PHYSID1, &ulPHYId1 );
vReadPHY( AT91C_PHY_ADDR, MII_PHYSID2, &ulPHYId2 );
/* AMD AM79C875:
PHY_ID1 = 0x0022
PHY_ID2 = 0x5541
Bits 3:0 Revision Number Four bit manufacturer<65>s revision number.
0001 stands for Rev. A, etc.
*/
if( ( ( ulPHYId1 << 16 ) | ( ulPHYId2 & 0xfff0 ) ) != MII_DM9161_ID )
{
/* Did not expect this ID. */
xReturn = pdFAIL;
}
else
{
ulStatus = xGetLinkSpeed();
if( ulStatus != pdPASS )
{
xReturn = pdFAIL;
}
}
/* Disable management port */
AT91C_BASE_EMAC->EMAC_NCR &= ~AT91C_EMAC_MPE;
/* End of code supplied by Atmel ------------------------*/
return xReturn;
}
/*-----------------------------------------------------------*/
static void vReadPHY( unsigned portCHAR ucPHYAddress, unsigned portCHAR ucAddress, unsigned portLONG *pulValue )
{
/* Code supplied by Atmel (reformatted) ----------------------*/
AT91C_BASE_EMAC->EMAC_MAN = (AT91C_EMAC_SOF & (0x01<<30))
| (2 << 16) | (2 << 28)
| ((ucPHYAddress & 0x1f) << 23)
| (ucAddress << 18);
/* Wait until IDLE bit in Network Status register is cleared. */
while( !( AT91C_BASE_EMAC->EMAC_NSR & AT91C_EMAC_IDLE ) )
{
__asm( "NOP" );
}
*pulValue = ( AT91C_BASE_EMAC->EMAC_MAN & 0x0000ffff );
/* End of code supplied by Atmel ------------------------*/
}
/*-----------------------------------------------------------*/
#if USE_RMII_INTERFACE != 1
static void vWritePHY( unsigned portCHAR ucPHYAddress, unsigned portCHAR ucAddress, unsigned portLONG ulValue )
{
/* Code supplied by Atmel (reformatted) ----------------------*/
AT91C_BASE_EMAC->EMAC_MAN = (( AT91C_EMAC_SOF & (0x01<<30))
| (2 << 16) | (1 << 28)
| ((ucPHYAddress & 0x1f) << 23)
| (ucAddress << 18))
| (ulValue & 0xffff);
/* Wait until IDLE bit in Network Status register is cleared */
while( !( AT91C_BASE_EMAC->EMAC_NSR & AT91C_EMAC_IDLE ) )
{
__asm( "NOP" );
};
/* End of code supplied by Atmel ------------------------*/
}
#endif
/*-----------------------------------------------------------*/
static portBASE_TYPE xGetLinkSpeed( void )
{
unsigned portLONG ulBMSR, ulBMCR, ulLPA, ulMACCfg, ulSpeed, ulDuplex;
/* Code supplied by Atmel (reformatted) -----------------*/
/* Link status is latched, so read twice to get current value */
vReadPHY(AT91C_PHY_ADDR, MII_BMSR, &ulBMSR);
vReadPHY(AT91C_PHY_ADDR, MII_BMSR, &ulBMSR);
if( !( ulBMSR & BMSR_LSTATUS ) )
{
/* No Link. */
return pdFAIL;
}
vReadPHY(AT91C_PHY_ADDR, MII_BMCR, &ulBMCR);
if (ulBMCR & BMCR_ANENABLE)
{
/* AutoNegotiation is enabled. */
if (!(ulBMSR & BMSR_ANEGCOMPLETE))
{
/* Auto-negotiation in progress. */
return pdFAIL;
}
vReadPHY(AT91C_PHY_ADDR, MII_LPA, &ulLPA);
if( ( ulLPA & LPA_100FULL ) || ( ulLPA & LPA_100HALF ) )
{
ulSpeed = SPEED_100;
}
else
{
ulSpeed = SPEED_10;
}
if( ( ulLPA & LPA_100FULL ) || ( ulLPA & LPA_10FULL ) )
{
ulDuplex = DUPLEX_FULL;
}
else
{
ulDuplex = DUPLEX_HALF;
}
}
else
{
ulSpeed = ( ulBMCR & BMCR_SPEED100 ) ? SPEED_100 : SPEED_10;
ulDuplex = ( ulBMCR & BMCR_FULLDPLX ) ? DUPLEX_FULL : DUPLEX_HALF;
}
/* Update the MAC */
ulMACCfg = AT91C_BASE_EMAC->EMAC_NCFGR & ~( AT91C_EMAC_SPD | AT91C_EMAC_FD );
if( ulSpeed == SPEED_100 )
{
if( ulDuplex == DUPLEX_FULL )
{
/* 100 Full Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_SPD | AT91C_EMAC_FD;
}
else
{
/* 100 Half Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_SPD;
}
}
else
{
if (ulDuplex == DUPLEX_FULL)
{
/* 10 Full Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg | AT91C_EMAC_FD;
}
else
{
/* 10 Half Duplex */
AT91C_BASE_EMAC->EMAC_NCFGR = ulMACCfg;
}
}
/* End of code supplied by Atmel ------------------------*/
return pdPASS;
}

View File

@@ -1,71 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef SAM_7_EMAC_H
#define SAM_7_EMAC_H
/*
* Initialise the EMAC driver. If successful a semaphore is returned that
* is used by the EMAC ISR to indicate that Rx packets have been received.
* If the initialisation fails then NULL is returned.
*/
xSemaphoreHandle xEMACInit( void );
/*
* Send the current uIP buffer. This copies the uIP buffer to one of the
* EMAC Tx buffers, then indicates to the EMAC that the buffer is ready.
*/
portLONG lEMACSend( void );
/*
* Called in response to an EMAC Rx interrupt. Copies the received frame
* into the uIP buffer.
*/
unsigned portLONG ulEMACPoll( void );
#endif

View File

@@ -1,268 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* Web server script interface
* \author
* Adam Dunkels <adam@sics.se>
*
*/
/*
* Copyright (c) 2001-2006, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd-cgi.c,v 1.2 2006/06/11 21:46:37 adam Exp $
*
*/
#include "uip.h"
#include "psock.h"
#include "httpd.h"
#include "httpd-cgi.h"
#include "httpd-fs.h"
#include <stdio.h>
#include <string.h>
HTTPD_CGI_CALL(file, "file-stats", file_stats);
HTTPD_CGI_CALL(tcp, "tcp-connections", tcp_stats);
HTTPD_CGI_CALL(net, "net-stats", net_stats);
HTTPD_CGI_CALL(rtos, "rtos-stats", rtos_stats );
HTTPD_CGI_CALL(io, "led-io", led_io );
static const struct httpd_cgi_call *calls[] = { &file, &tcp, &net, &rtos, &io, NULL };
/*---------------------------------------------------------------------------*/
static
PT_THREAD(nullfunction(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
httpd_cgifunction
httpd_cgi(char *name)
{
const struct httpd_cgi_call **f;
/* Find the matching name in the table, return the function. */
for(f = calls; *f != NULL; ++f) {
if(strncmp((*f)->name, name, strlen((*f)->name)) == 0) {
return (*f)->function;
}
}
return nullfunction;
}
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
char *f = (char *)arg;
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u", httpd_fs_count(f));
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(file_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static const char closed[] = /* "CLOSED",*/
{0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0};
static const char syn_rcvd[] = /* "SYN-RCVD",*/
{0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56,
0x44, 0};
static const char syn_sent[] = /* "SYN-SENT",*/
{0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e,
0x54, 0};
static const char established[] = /* "ESTABLISHED",*/
{0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48,
0x45, 0x44, 0};
static const char fin_wait_1[] = /* "FIN-WAIT-1",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x31, 0};
static const char fin_wait_2[] = /* "FIN-WAIT-2",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x32, 0};
static const char closing[] = /* "CLOSING",*/
{0x43, 0x4c, 0x4f, 0x53, 0x49,
0x4e, 0x47, 0};
static const char time_wait[] = /* "TIME-WAIT,"*/
{0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41,
0x49, 0x54, 0};
static const char last_ack[] = /* "LAST-ACK"*/
{0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43,
0x4b, 0};
static const char *states[] = {
closed,
syn_rcvd,
syn_sent,
established,
fin_wait_1,
fin_wait_2,
closing,
time_wait,
last_ack};
static unsigned short
generate_tcp_stats(void *arg)
{
struct uip_conn *conn;
struct httpd_state *s = (struct httpd_state *)arg;
conn = &uip_conns[s->count];
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
"<tr><td>%d</td><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
htons(conn->lport),
htons(conn->ripaddr[0]) >> 8,
htons(conn->ripaddr[0]) & 0xff,
htons(conn->ripaddr[1]) >> 8,
htons(conn->ripaddr[1]) & 0xff,
htons(conn->rport),
states[conn->tcpstateflags & UIP_TS_MASK],
conn->nrtx,
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' ');
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {
if((uip_conns[s->count].tcpstateflags & UIP_TS_MASK) != UIP_CLOSED) {
PSOCK_GENERATOR_SEND(&s->sout, generate_tcp_stats, s);
}
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static unsigned short
generate_net_stats(void *arg)
{
struct httpd_state *s = (struct httpd_state *)arg;
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
"%5u\n", ((uip_stats_t *)&uip_stat)[s->count]);
}
static
PT_THREAD(net_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
#if UIP_STATISTICS
for(s->count = 0; s->count < sizeof(uip_stat) / sizeof(uip_stats_t);
++s->count) {
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);
}
#endif /* UIP_STATISTICS */
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
extern void vTaskList( signed char *pcWriteBuffer );
static char cCountBuf[ 32 ];
long lRefreshCount = 0;
static unsigned short
generate_rtos_stats(void *arg)
{
lRefreshCount++;
sprintf( cCountBuf, "<p><br>Refresh count = %ld", lRefreshCount );
vTaskList( uip_appdata );
strcat( uip_appdata, cCountBuf );
return strlen( uip_appdata );
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(rtos_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
char *pcStatus;
unsigned long ulString;
extern unsigned long uxParTextGetLED( unsigned long uxLED );
static unsigned short generate_io_state( void *arg )
{
if( uxParTestGetLED() )
{
pcStatus = "checked";
}
else
{
pcStatus = "";
}
sprintf( uip_appdata,
"<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED DS4,"\
"<p>",
pcStatus );
return strlen( uip_appdata );
}
static PT_THREAD(led_io(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_io_state, NULL);
PSOCK_END(&s->sout);
}
/** @} */

View File

@@ -1,197 +0,0 @@
/*
* Modified from an original work that is Copyright (c) 2001-2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: main.c,v 1.10.2.4 2003/10/21 21:27:51 adam Exp $
*
*/
/* Standard includes. */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* uip includes. */
#include "uip.h"
#include "uip_arp.h"
#include "httpd.h"
#include "timer.h"
#include "clock-arch.h"
/* Demo includes. */
#include "SAM7_EMAC.h"
#include "partest.h"
/* How long to wait before attempting to connect the MAC again. */
#define uipINIT_WAIT ( 100 / portTICK_RATE_MS )
/* Shortcut to the header within the Rx buffer. */
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
/* The semaphore used by the ISR to wake the uIP task. */
static xSemaphoreHandle xEMACSemaphore;
/*-----------------------------------------------------------*/
void vuIP_Task( void *pvParameters )
{
portBASE_TYPE i;
uip_ipaddr_t xIPAddr;
struct timer periodic_timer, arp_timer;
/* Initialise the uIP stack. */
timer_set( &periodic_timer, configTICK_RATE_HZ / 2 );
timer_set( &arp_timer, configTICK_RATE_HZ * 10 );
uip_init();
uip_ipaddr( xIPAddr, uipIP_ADDR0, uipIP_ADDR1, uipIP_ADDR2, uipIP_ADDR3 );
uip_sethostaddr( xIPAddr );
httpd_init();
/* Initialise the MAC. */
do
{
vTaskDelay( uipINIT_WAIT );
xEMACSemaphore = xEMACInit();
} while( xEMACSemaphore == NULL );
for( ;; )
{
/* Is there received data ready to be processed? */
uip_len = ulEMACPoll();
if( uip_len > 0 )
{
/* Standard uIP loop taken from the uIP manual. */
if( xHeader->type == htons( UIP_ETHTYPE_IP ) )
{
uip_arp_ipin();
uip_input();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
lEMACSend();
}
}
else if( xHeader->type == htons( UIP_ETHTYPE_ARP ) )
{
uip_arp_arpin();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
lEMACSend();
}
}
}
else
{
if( timer_expired( &periodic_timer ) )
{
timer_reset( &periodic_timer );
for( i = 0; i < UIP_CONNS; i++ )
{
uip_periodic( i );
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
lEMACSend();
}
}
/* Call the ARP timer function every 10 seconds. */
if( timer_expired( &arp_timer ) )
{
timer_reset( &arp_timer );
uip_arp_timer();
}
}
else
{
/* We did not receive a packet, and there was no periodic
processing to perform. Block for a fixed period. If a packet
is received during this period we will be woken by the ISR
giving us the Semaphore. */
xSemaphoreTake( xEMACSemaphore, configTICK_RATE_HZ / 2 );
}
}
}
}
/*-----------------------------------------------------------------------------------*/
void clock_init(void)
{
/* This is done when the scheduler starts. */
}
/*-----------------------------------------------------------*/
clock_time_t clock_time( void )
{
return xTaskGetTickCount();
}
/*-----------------------------------------------------------*/
void vProcessInput( char *pcInput )
{
char *c;
/* Turn the LED on or off depending on the checkbox status. */
c = strstr( pcInput, "?" );
if( c )
{
if( strstr( c, "LED0=1" ) != NULL )
{
vParTestSetLED( 3, 0 );
}
else
{
vParTestSetLED( 3, 1 );
}
}
}

View File

@@ -1,55 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef UIP_TASK_H
#define UIP_TASK_H
/* The task that handles all uIP data. */
void vuIP_Task( void *pvParameters );
#endif

View File

@@ -1,96 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <lpc210x.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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 58982400 ) /* =14.7456MHz xtal multiplied by 4 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configQUEUE_REGISTRY_SIZE 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,136 +0,0 @@
#/*
# FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
#
# 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 exception 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.
# Alternative commercial license and support terms are also available upon
# request. See the licensing section of http://www.FreeRTOS.org for full
# license details.
#
# 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. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
# Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#
#
# ***************************************************************************
# * *
# * Looking for a quick start? Then check out the FreeRTOS eBook! *
# * See http://www.FreeRTOS.org/Documentation for details *
# * *
# ***************************************************************************
#
# 1 tab == 4 spaces!
#
# Please ensure to read the configuration and relevant port sections of the
# online documentation.
#
# http://www.FreeRTOS.org - Documentation, latest information, license and
# contact details.
#
# http://www.SafeRTOS.com - A version that is certified for use in safety
# critical systems.
#
# http://www.OpenRTOS.com - Commercial support, development, porting,
# licensing and training services.
#*/
# Changes from V2.4.2
#
# + Replaced source/portable/gcc/arm7/portheap.c with source/portable/memmang/heap_2.c.
CC=arm-elf-gcc
OBJCOPY=arm-elf-objcopy
ARCH=arm-elf-ar
CRT0=boot.s
WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare \
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused
#
# CFLAGS common to both the THUMB and ARM mode builds
#
CFLAGS=$(WARNINGS) -D $(RUN_MODE) -D GCC_ARM7 -I. -I../../Source/include \
-I../Common/include $(DEBUG) -mcpu=arm7tdmi -T$(LDSCRIPT) \
$(OPTIM) -fomit-frame-pointer -fno-strict-aliasing
ifeq ($(USE_THUMB_MODE),YES)
CFLAGS += -mthumb-interwork -D THUMB_INTERWORK
THUMB_FLAGS=-mthumb
endif
LINKER_FLAGS=-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
RTOS_SOURCE_DIR=../../Source
DEMO_SOURCE_DIR=../Common/Minimal
#
# Source files that can be built to THUMB mode.
#
THUMB_SRC = \
main.c \
serial/serial.c \
ParTest/ParTest.c \
$(DEMO_SOURCE_DIR)/integer.c \
$(DEMO_SOURCE_DIR)/flash.c \
$(DEMO_SOURCE_DIR)/PollQ.c \
$(DEMO_SOURCE_DIR)/comtest.c \
$(DEMO_SOURCE_DIR)/flop.c \
$(DEMO_SOURCE_DIR)/semtest.c \
$(DEMO_SOURCE_DIR)/dynamic.c \
$(DEMO_SOURCE_DIR)/BlockQ.c \
$(RTOS_SOURCE_DIR)/tasks.c \
$(RTOS_SOURCE_DIR)/queue.c \
$(RTOS_SOURCE_DIR)/list.c \
$(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC2000/port.c
#
# Source files that must be built to ARM mode.
#
ARM_SRC = \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC2000/portISR.c \
serial/serialISR.c
#
# Define all object files.
#
ARM_OBJ = $(ARM_SRC:.c=.o)
THUMB_OBJ = $(THUMB_SRC:.c=.o)
rtosdemo.hex : rtosdemo.elf
$(OBJCOPY) rtosdemo.elf -O ihex rtosdemo.hex
rtosdemo.elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
$(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
$(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
$(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
$(CC) -c $(CFLAGS) $< -o $@
clean :
rm -rf $(ARM_OBJ) $(THUMB_OBJ)
touch Makefile

View File

@@ -1,121 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
Changes from V2.5.2
+ All LED's are turned off to start.
*/
#include "FreeRTOS.h"
#include "partest.h"
#define partstFIRST_IO ( ( unsigned portLONG ) 0x400 )
#define partstNUM_LEDS ( 4 )
#define partstALL_OUTPUTS_OFF ( ( unsigned portLONG ) 0xffffffff )
/*-----------------------------------------------------------
* Simple parallel port IO routines.
*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
/* This is performed from main() as the io bits are shared with other setup
functions. */
/* Turn all outputs off. */
GPIO_IOSET = partstALL_OUTPUTS_OFF;
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned portLONG ulLED = partstFIRST_IO;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 0. Only P10 to P13 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* Set of clear the output. */
if( xValue )
{
GPIO_IOCLR = ulLED;
}
else
{
GPIO_IOSET = ulLED;
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 0. Only P10 to P13 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* If this bit is already set, clear it, and visa versa. */
ulCurrentState = GPIO0_IOPIN;
if( ulCurrentState & ulLED )
{
GPIO_IOCLR = ulLED;
}
else
{
GPIO_IOSET = ulLED;
}
}
}

View File

@@ -1,490 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles the onboard LED. Should any task contain an error at any time
* the LED toggle rate will change from 3 seconds to 500ms.
*
* To check the operation of the memory allocator the check task also
* dynamically creates a task before delaying, and deletes it again when it
* wakes. If memory cannot be allocated for the new task the call to xTaskCreate
* will fail and an error is signalled. The dynamically created task itself
* allocates and frees memory just to give the allocator a bit more exercise.
*
*/
/*
Changes from V2.4.2
+ The vErrorChecks() task now dynamically creates then deletes a task each
cycle. This tests the operation of the memory allocator.
Changes from V2.5.2
+ vParTestInitialise() is called during initialisation to ensure all the
LED's start off.
*/
/* Standard includes. */
#include <stdlib.h>
#include <string.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "partest.h"
#include "flash.h"
#include "integer.h"
#include "PollQ.h"
#include "comtest2.h"
#include "semtest.h"
#include "flop.h"
#include "dynamic.h"
#include "BlockQ.h"
#include "serial.h"
/*-----------------------------------------------------------*/
/* Constants to setup I/O. */
#define mainTX_ENABLE ( ( unsigned portLONG ) 0x0001 )
#define mainRX_ENABLE ( ( unsigned portLONG ) 0x0004 )
#define mainP0_14 ( ( unsigned portLONG ) 0x4000 )
#define mainJTAG_PORT ( ( unsigned portLONG ) 0x3E0000UL )
/* Constants to setup the PLL. */
#define mainPLL_MUL_4 ( ( unsigned portCHAR ) 0x0003 )
#define mainPLL_DIV_1 ( ( unsigned portCHAR ) 0x0000 )
#define mainPLL_ENABLE ( ( unsigned portCHAR ) 0x0001 )
#define mainPLL_CONNECT ( ( unsigned portCHAR ) 0x0003 )
#define mainPLL_FEED_BYTE1 ( ( unsigned portCHAR ) 0xaa )
#define mainPLL_FEED_BYTE2 ( ( unsigned portCHAR ) 0x55 )
#define mainPLL_LOCK ( ( unsigned portLONG ) 0x0400 )
/* Constants to setup the MAM. */
#define mainMAM_TIM_3 ( ( unsigned portCHAR ) 0x03 )
#define mainMAM_MODE_FULL ( ( unsigned portCHAR ) 0x02 )
/* Constants to setup the peripheral bus. */
#define mainBUS_CLK_FULL ( ( unsigned portCHAR ) 0x01 )
/* Constants for the ComTest tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 115200 )
#define mainCOM_TEST_LED ( 3 )
/* Priorities for the demo application tasks. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 0 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 0 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* The rate at which the on board LED will toggle when there is/is not an
error. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainON_BOARD_LED_BIT ( ( unsigned portLONG ) 0x80 )
/* Constants used by the vMemCheckTask() task. */
#define mainCOUNT_INITIAL_VALUE ( ( unsigned portLONG ) 0 )
#define mainNO_TASK ( 0 )
/* The size of the memory blocks allocated by the vMemCheckTask() task. */
#define mainMEM_CHECK_SIZE_1 ( ( size_t ) 51 )
#define mainMEM_CHECK_SIZE_2 ( ( size_t ) 52 )
#define mainMEM_CHECK_SIZE_3 ( ( size_t ) 151 )
/*-----------------------------------------------------------*/
/*
* The Olimex demo board has a single built in LED. This function simply
* toggles its state.
*/
void prvToggleOnBoardLED( void );
/*
* Checks that all the demo application tasks are still executing without error
* - as described at the top of the file.
*/
static portLONG prvCheckOtherTasksAreStillRunning( unsigned portLONG ulMemCheckTaskCount );
/*
* The task that executes at the highest priority and calls
* prvCheckOtherTasksAreStillRunning(). See the description at the top
* of the file.
*/
static void vErrorChecks( void *pvParameters );
/*
* Dynamically created and deleted during each cycle of the vErrorChecks()
* task. This is done to check the operation of the memory allocator.
* See the top of vErrorChecks for more details.
*/
static void vMemCheckTask( void *pvParameters );
/*
* Configure the processor for use with the Olimex demo board. This includes
* setup for the I/O, system clock, and access timings.
*/
static void prvSetupHardware( void );
/*-----------------------------------------------------------*/
/*
* Starts all the other tasks, then starts the scheduler.
*/
int main( void )
{
/* Setup the hardware for use with the Olimex demo board. */
prvSetupHardware();
/* Start the demo/test application tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartMathTasks( tskIDLE_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartDynamicPriorityTasks();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
/* Start the check task - which is defined in this file. */
xTaskCreate( vErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Now all the tasks have been started - start the scheduler.
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used here. */
vTaskStartScheduler();
/* Should never reach here! */
return 0;
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
unsigned portLONG ulMemCheckTaskRunningCount;
xTaskHandle xCreatedTask;
/* The parameters are not used in this function. */
( void ) pvParameters;
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. If an error is detected then the delay period
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
the on board LED flash rate will increase.
In addition to the standard tests the memory allocator is tested through
the dynamic creation and deletion of a task each cycle. Each time the
task is created memory must be allocated for its stack. When the task is
deleted this memory is returned to the heap. If the task cannot be created
then it is likely that the memory allocation failed. */
for( ;; )
{
/* Dynamically create a task - passing ulMemCheckTaskRunningCount as a
parameter. */
ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE;
xCreatedTask = mainNO_TASK;
if( xTaskCreate( vMemCheckTask, ( signed portCHAR * ) "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS )
{
/* Could not create the task - we have probably run out of heap. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
/* Delay until it is time to execute again. */
vTaskDelay( xDelayPeriod );
/* Delete the dynamically created task. */
if( xCreatedTask != mainNO_TASK )
{
vTaskDelete( xCreatedTask );
}
/* Check all the standard demo application tasks are executing without
error. ulMemCheckTaskRunningCount is checked to ensure it was
modified by the task just deleted. */
if( prvCheckOtherTasksAreStillRunning( ulMemCheckTaskRunningCount ) != pdPASS )
{
/* An error has been detected in one of the tasks - flash faster. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
prvToggleOnBoardLED();
}
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
#ifdef RUN_FROM_RAM
/* Remap the interrupt vectors to RAM if we are are running from RAM. */
SCB_MEMMAP = 2;
#endif
/* Configure the RS2332 pins. All other pins remain at their default of 0. */
PCB_PINSEL0 |= mainTX_ENABLE;
PCB_PINSEL0 |= mainRX_ENABLE;
/* Set all GPIO to output other than the P0.14 (BSL), and the JTAG pins.
The JTAG pins are left as input as I'm not sure what will happen if the
Wiggler is connected after powerup - not that it would be a good idea to
do that anyway. */
GPIO_IODIR = ~( mainP0_14 + mainJTAG_PORT );
/* Setup the PLL to multiply the XTAL input by 4. */
SCB_PLLCFG = ( mainPLL_MUL_4 | mainPLL_DIV_1 );
/* Activate the PLL by turning it on then feeding the correct sequence of
bytes. */
SCB_PLLCON = mainPLL_ENABLE;
SCB_PLLFEED = mainPLL_FEED_BYTE1;
SCB_PLLFEED = mainPLL_FEED_BYTE2;
/* Wait for the PLL to lock... */
while( !( SCB_PLLSTAT & mainPLL_LOCK ) );
/* ...before connecting it using the feed sequence again. */
SCB_PLLCON = mainPLL_CONNECT;
SCB_PLLFEED = mainPLL_FEED_BYTE1;
SCB_PLLFEED = mainPLL_FEED_BYTE2;
/* Setup and turn on the MAM. Three cycle access is used due to the fast
PLL used. It is possible faster overall performance could be obtained by
tuning the MAM and PLL settings. */
MAM_TIM = mainMAM_TIM_3;
MAM_CR = mainMAM_MODE_FULL;
/* Setup the peripheral bus to be the same as the PLL output. */
SCB_VPBDIV = mainBUS_CLK_FULL;
/* Initialise LED outputs. */
vParTestInitialise();
}
/*-----------------------------------------------------------*/
void prvToggleOnBoardLED( void )
{
unsigned portLONG ulState;
ulState = GPIO0_IOPIN;
if( ulState & mainON_BOARD_LED_BIT )
{
GPIO_IOCLR = mainON_BOARD_LED_BIT;
}
else
{
GPIO_IOSET = mainON_BOARD_LED_BIT;
}
}
/*-----------------------------------------------------------*/
static portLONG prvCheckOtherTasksAreStillRunning( unsigned portLONG ulMemCheckTaskCount )
{
portLONG lReturn = ( portLONG ) pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( ulMemCheckTaskCount == mainCOUNT_INITIAL_VALUE )
{
/* The vMemCheckTask did not increment the counter - it must
have failed. */
lReturn = ( portLONG ) pdFAIL;
}
return lReturn;
}
/*-----------------------------------------------------------*/
static void vMemCheckTask( void *pvParameters )
{
unsigned portLONG *pulMemCheckTaskRunningCounter;
void *pvMem1, *pvMem2, *pvMem3;
static portLONG lErrorOccurred = pdFALSE;
/* This task is dynamically created then deleted during each cycle of the
vErrorChecks task to check the operation of the memory allocator. Each time
the task is created memory is allocated for the stack and TCB. Each time
the task is deleted this memory is returned to the heap. This task itself
exercises the allocator by allocating and freeing blocks.
The task executes at the idle priority so does not require a delay.
pulMemCheckTaskRunningCounter is incremented each cycle to indicate to the
vErrorChecks() task that this task is still executing without error. */
pulMemCheckTaskRunningCounter = ( unsigned portLONG * ) pvParameters;
for( ;; )
{
if( lErrorOccurred == pdFALSE )
{
/* We have never seen an error so increment the counter. */
( *pulMemCheckTaskRunningCounter )++;
}
/* Allocate some memory - just to give the allocator some extra
exercise. This has to be in a critical section to ensure the
task does not get deleted while it has memory allocated. */
vTaskSuspendAll();
{
pvMem1 = pvPortMalloc( mainMEM_CHECK_SIZE_1 );
if( pvMem1 == NULL )
{
lErrorOccurred = pdTRUE;
}
else
{
memset( pvMem1, 0xaa, mainMEM_CHECK_SIZE_1 );
vPortFree( pvMem1 );
}
}
xTaskResumeAll();
/* Again - with a different size block. */
vTaskSuspendAll();
{
pvMem2 = pvPortMalloc( mainMEM_CHECK_SIZE_2 );
if( pvMem2 == NULL )
{
lErrorOccurred = pdTRUE;
}
else
{
memset( pvMem2, 0xaa, mainMEM_CHECK_SIZE_2 );
vPortFree( pvMem2 );
}
}
xTaskResumeAll();
/* Again - with a different size block. */
vTaskSuspendAll();
{
pvMem3 = pvPortMalloc( mainMEM_CHECK_SIZE_3 );
if( pvMem3 == NULL )
{
lErrorOccurred = pdTRUE;
}
else
{
memset( pvMem3, 0xaa, mainMEM_CHECK_SIZE_3 );
vPortFree( pvMem3 );
}
}
xTaskResumeAll();
}
}

View File

@@ -1,278 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
Changes from V2.4.0
+ Made serial ISR handling more complete and robust.
Changes from V2.4.1
+ Split serial.c into serial.c and serialISR.c. serial.c can be
compiled using ARM or THUMB modes. serialISR.c must always be
compiled in ARM mode.
+ Another small change to cSerialPutChar().
Changed from V2.5.1
+ In cSerialPutChar() an extra check is made to ensure the post to
the queue was successful if then attempting to retrieve the posted
character.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
This file contains all the serial port components that can be compiled to
either ARM or THUMB mode. Components that must be compiled to ARM mode are
contained in serialISR.c.
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
/* Demo application includes. */
#include "serial.h"
/*-----------------------------------------------------------*/
/* Constants to setup and access the UART. */
#define serDLAB ( ( unsigned portCHAR ) 0x80 )
#define serENABLE_INTERRUPTS ( ( unsigned portCHAR ) 0x03 )
#define serNO_PARITY ( ( unsigned portCHAR ) 0x00 )
#define ser1_STOP_BIT ( ( unsigned portCHAR ) 0x00 )
#define ser8_BIT_CHARS ( ( unsigned portCHAR ) 0x03 )
#define serFIFO_ON ( ( unsigned portCHAR ) 0x01 )
#define serCLEAR_FIFO ( ( unsigned portCHAR ) 0x06 )
#define serWANTED_CLOCK_SCALING ( ( unsigned portLONG ) 16 )
/* Constants to setup and access the VIC. */
#define serUART0_VIC_CHANNEL ( ( unsigned portLONG ) 0x0006 )
#define serUART0_VIC_CHANNEL_BIT ( ( unsigned portLONG ) 0x0040 )
#define serUART0_VIC_ENABLE ( ( unsigned portLONG ) 0x0020 )
#define serCLEAR_VIC_INTERRUPT ( ( unsigned portLONG ) 0 )
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
/*-----------------------------------------------------------*/
/* Communication flag between the interrupt service routine and serial API. */
static volatile portLONG *plTHREEmpty;
/*
* The queues are created in serialISR.c as they are used from the ISR.
* Obtain references to the queues and THRE Empty flag.
*/
extern void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx, portLONG volatile **pplTHREEmptyFlag );
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
unsigned portLONG ulDivisor, ulWantedClock;
xComPortHandle xReturn = serHANDLE;
extern void ( vUART_ISR_Wrapper )( void );
/* The queues are used in the serial ISR routine, so are created from
serialISR.c (which is always compiled to ARM mode. */
vSerialISRCreateQueues( uxQueueLength, &xRxedChars, &xCharsForTx, &plTHREEmpty );
if(
( xRxedChars != serINVALID_QUEUE ) &&
( xCharsForTx != serINVALID_QUEUE ) &&
( ulWantedBaud != ( unsigned portLONG ) 0 )
)
{
portENTER_CRITICAL();
{
/* Setup the baud rate: Calculate the divisor value. */
ulWantedClock = ulWantedBaud * serWANTED_CLOCK_SCALING;
ulDivisor = configCPU_CLOCK_HZ / ulWantedClock;
/* Set the DLAB bit so we can access the divisor. */
UART0_LCR |= serDLAB;
/* Setup the divisor. */
UART0_DLL = ( unsigned portCHAR ) ( ulDivisor & ( unsigned portLONG ) 0xff );
ulDivisor >>= 8;
UART0_DLM = ( unsigned portCHAR ) ( ulDivisor & ( unsigned portLONG ) 0xff );
/* Turn on the FIFO's and clear the buffers. */
UART0_FCR = ( serFIFO_ON | serCLEAR_FIFO );
/* Setup transmission format. */
UART0_LCR = serNO_PARITY | ser1_STOP_BIT | ser8_BIT_CHARS;
/* Setup the VIC for the UART. */
VICIntSelect &= ~( serUART0_VIC_CHANNEL_BIT );
VICIntEnable |= serUART0_VIC_CHANNEL_BIT;
VICVectAddr1 = ( portLONG ) vUART_ISR_Wrapper;
VICVectCntl1 = serUART0_VIC_CHANNEL | serUART0_VIC_ENABLE;
/* Enable UART0 interrupts. */
UART0_IER |= serENABLE_INTERRUPTS;
}
portEXIT_CRITICAL();
}
else
{
xReturn = ( xComPortHandle ) 0;
}
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
( void ) usStringLength;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
signed portBASE_TYPE xReturn;
/* This demo driver only supports one port so the parameter is not used. */
( void ) pxPort;
portENTER_CRITICAL();
{
/* Is there space to write directly to the UART? */
if( *plTHREEmpty == ( portLONG ) pdTRUE )
{
/* We wrote the character directly to the UART, so was
successful. */
*plTHREEmpty = pdFALSE;
UART0_THR = cOutChar;
xReturn = pdPASS;
}
else
{
/* We cannot write directly to the UART, so queue the character.
Block for a maximum of xBlockTime if there is no space in the
queue. */
xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime );
/* Depending on queue sizing and task prioritisation: While we
were blocked waiting to post interrupts were not disabled. It is
possible that the serial ISR has emptied the Tx queue, in which
case we need to start the Tx off again. */
if( ( *plTHREEmpty == ( portLONG ) pdTRUE ) && ( xReturn == pdPASS ) )
{
xQueueReceive( xCharsForTx, &cOutChar, serNO_BLOCK );
*plTHREEmpty = pdFALSE;
UART0_THR = cOutChar;
}
}
}
portEXIT_CRITICAL();
return xReturn;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
/* Not supported as not required by the demo application. */
( void ) xPort;
}
/*-----------------------------------------------------------*/

View File

@@ -1,186 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
This file contains all the serial port components that must be compiled
to ARM mode. The components that can be compiled to either ARM or THUMB
mode are contained in serial.c.
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
/* Demo application includes. */
#include "serial.h"
/*-----------------------------------------------------------*/
/* Constant to access the VIC. */
#define serCLEAR_VIC_INTERRUPT ( ( unsigned portLONG ) 0 )
/* Constants to determine the ISR source. */
#define serSOURCE_THRE ( ( unsigned portCHAR ) 0x02 )
#define serSOURCE_RX_TIMEOUT ( ( unsigned portCHAR ) 0x0c )
#define serSOURCE_ERROR ( ( unsigned portCHAR ) 0x06 )
#define serSOURCE_RX ( ( unsigned portCHAR ) 0x04 )
#define serINTERRUPT_SOURCE_MASK ( ( unsigned portCHAR ) 0x0f )
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static volatile portLONG lTHREEmpty;
/*-----------------------------------------------------------*/
/*
* The queues are created in serialISR.c as they are used from the ISR.
* Obtain references to the queues and THRE Empty flag.
*/
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx, portLONG volatile **pplTHREEmptyFlag );
/* UART0 interrupt service routine entry point. */
void vUART_ISR_Wrapper( void ) __attribute__ ((naked));
/* UART0 interrupt service routine handler. */
void vUART_ISR_Handler( void );
/*-----------------------------------------------------------*/
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars,
xQueueHandle *pxCharsForTx, portLONG volatile **pplTHREEmptyFlag )
{
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* Pass back a reference to the queues so the serial API file can
post/receive characters. */
*pxRxedChars = xRxedChars;
*pxCharsForTx = xCharsForTx;
/* Initialise the THRE empty flag - and pass back a reference. */
lTHREEmpty = ( portLONG ) pdTRUE;
*pplTHREEmptyFlag = &lTHREEmpty;
}
/*-----------------------------------------------------------*/
void vUART_ISR_Wrapper( void )
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler. This must be a separate function from the wrapper
to ensure the correct stack frame is set up. */
vUART_ISR_Handler();
/* Restore the context of whichever task is going to run next. */
portRESTORE_CONTEXT();
}
/*-----------------------------------------------------------*/
void vUART_ISR_Handler( void )
{
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt? */
switch( UART0_IIR & serINTERRUPT_SOURCE_MASK )
{
case serSOURCE_ERROR : /* Not handling this, but clear the interrupt. */
cChar = UART0_LSR;
break;
case serSOURCE_THRE : /* The THRE is empty. If there is another
character in the Tx queue, send it now. */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
UART0_THR = cChar;
}
else
{
/* There are no further characters
queued to send so we can indicate
that the THRE is available. */
lTHREEmpty = pdTRUE;
}
break;
case serSOURCE_RX_TIMEOUT :
case serSOURCE_RX : /* A character was received. Place it in
the queue of received characters. */
cChar = UART0_RBR;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
break;
default : /* There is nothing to do, leave the ISR. */
break;
}
if( xHigherPriorityTaskWoken )
{
portYIELD_FROM_ISR();
}
/* Clear the ISR in the VIC. */
VICVectAddr = serCLEAR_VIC_INTERRUPT;
}

View File

@@ -1,95 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/* Hardware specifics. */
#include <NXP/iolpc2129.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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 60000000 ) /* =12.0MHz xtal multiplied by 5 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 14200 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 0
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,117 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's.
*-----------------------------------------------------------*/
/* Scheduler includes. */
#include "FreeRTOS.h"
/* Demo application includes. */
#include "partest.h"
/* Board specific defines. */
#define partstFIRST_IO ( ( unsigned portLONG ) 0x10000 )
#define partstNUM_LEDS ( 8 )
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
/* The ports are setup within prvInitialiseHardware(), called by main(). */
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned portLONG ulLED = partstFIRST_IO;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 1. Only P16 to P23 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* Set or clear the output. */
if( xValue )
{
IO1SET = ulLED;
}
else
{
IO1CLR = ulLED;
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 1. Only P10 to P13 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* If this bit is already set, clear it, and visa versa. */
ulCurrentState = IO1PIN;
if( ulCurrentState & ulLED )
{
IO1CLR = ulLED;
}
else
{
IO1SET = ulLED;
}
}
}

View File

@@ -1,299 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles the onboard LED. Should any task contain an error at any time
* the LED toggle rate will change from 3 seconds to 500ms.
*
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "flash.h"
#include "integer.h"
#include "PollQ.h"
#include "BlockQ.h"
#include "semtest.h"
#include "dynamic.h"
#include "partest.h"
#include "comtest2.h"
/* Priorities for the demo application tasks. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* Constants required by the 'Check' task. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( 7 )
/* Constants for the ComTest tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 115200 )
#define mainCOM_TEST_LED ( 4 )
#define mainTX_ENABLE ( ( unsigned portLONG ) 0x0001 )
#define mainRX_ENABLE ( ( unsigned portLONG ) 0x0004 )
/* Constants to setup the PLL. */
#define mainPLL_MUL_5 ( ( unsigned portCHAR ) 0x0004 )
#define mainPLL_DIV_1 ( ( unsigned portCHAR ) 0x0000 )
#define mainPLL_ENABLE ( ( unsigned portCHAR ) 0x0001 )
#define mainPLL_CONNECT ( ( unsigned portCHAR ) 0x0003 )
#define mainPLL_FEED_BYTE1 ( ( unsigned portCHAR ) 0xaa )
#define mainPLL_FEED_BYTE2 ( ( unsigned portCHAR ) 0x55 )
#define mainPLL_LOCK ( ( unsigned portLONG ) 0x0400 )
/* Constants to setup the MAM. */
#define mainMAM_TIM_3 ( ( unsigned portCHAR ) 0x03 )
#define mainMAM_MODE_FULL ( ( unsigned portCHAR ) 0x02 )
/* Constants to setup the peripheral bus. */
#define mainBUS_CLK_FULL ( ( unsigned portCHAR ) 0x01 )
/* And finally, constant to setup the port for the LED's. */
#define mainLED_TO_OUTPUT ( ( unsigned portLONG ) 0xff0000 )
/*
* The task that executes at the highest priority and calls
* prvCheckOtherTasksAreStillRunning(). See the description at the top
* of the file.
*/
static void vErrorChecks( void *pvParameters );
/*
* Configures the processor for use with this demo.
*/
static void prvSetupHardware( void );
/*
* Checks that all the demo application tasks are still executing without error
* - as described at the top of the file.
*/
static portLONG prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/*
* Starts all the other tasks, then starts the scheduler.
*/
void main( void )
{
/* Setup the processor. */
prvSetupHardware();
/* Start all the standard demo application tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartDynamicPriorityTasks();
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
/* Start the check task - which is defined in this file. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler.
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used here.
*/
vTaskStartScheduler();
/* We should never get here as control is now taken by the scheduler. */
return;
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
/* Setup the PLL to multiply the XTAL input by 5. */
PLLCFG = ( mainPLL_MUL_5 | mainPLL_DIV_1 );
/* Activate the PLL by turning it on then feeding the correct sequence of
bytes. */
PLLCON = mainPLL_ENABLE;
PLLFEED = mainPLL_FEED_BYTE1;
PLLFEED = mainPLL_FEED_BYTE2;
/* Wait for the PLL to lock... */
while( !( PLLSTAT & mainPLL_LOCK ) );
/* ...before connecting it using the feed sequence again. */
PLLCON = mainPLL_CONNECT;
PLLFEED = mainPLL_FEED_BYTE1;
PLLFEED = mainPLL_FEED_BYTE2;
/* Setup and turn on the MAM. Three cycle access is used due to the fast
PLL used. It is possible faster overall performance could be obtained by
tuning the MAM and PLL settings. */
MAMTIM = mainMAM_TIM_3;
MAMCR = mainMAM_MODE_FULL;
/* Setup the peripheral bus to be the same as the PLL output. */
APBDIV = mainBUS_CLK_FULL;
/* Configure the RS2332 pins. All other pins remain at their default of 0. */
PINSEL0 |= mainTX_ENABLE;
PINSEL0 |= mainRX_ENABLE;
/* LED pins need to be output. */
IO1DIR = mainLED_TO_OUTPUT;
/* Setup the peripheral bus to be the same as the PLL output. */
APBDIV = mainBUS_CLK_FULL;
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
/* The parameters are not used in this task. */
( void ) pvParameters;
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. If an error is detected then the delay period
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
the on board LED flash rate will increase. */
for( ;; )
{
/* Delay until it is time to execute again. */
vTaskDelay( xDelayPeriod );
/* Check all the standard demo application tasks are executing without
error. */
if( prvCheckOtherTasksAreStillRunning() != pdPASS )
{
/* An error has been detected in one of the tasks - flash faster. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portLONG prvCheckOtherTasksAreStillRunning( void )
{
portLONG lReturn = ( portLONG ) pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
return lReturn;
}
/*-----------------------------------------------------------*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,300 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
/* Demo application includes. */
#include "serial.h"
/*-----------------------------------------------------------*/
/* Constants to setup and access the UART. */
#define serDLAB ( ( unsigned portCHAR ) 0x80 )
#define serENABLE_INTERRUPTS ( ( unsigned portCHAR ) 0x03 )
#define serNO_PARITY ( ( unsigned portCHAR ) 0x00 )
#define ser1_STOP_BIT ( ( unsigned portCHAR ) 0x00 )
#define ser8_BIT_CHARS ( ( unsigned portCHAR ) 0x03 )
#define serFIFO_ON ( ( unsigned portCHAR ) 0x01 )
#define serCLEAR_FIFO ( ( unsigned portCHAR ) 0x06 )
#define serWANTED_CLOCK_SCALING ( ( unsigned portLONG ) 16 )
/* Constants to setup and access the VIC. */
#define serU0VIC_CHANNEL ( ( unsigned portLONG ) 0x0006 )
#define serU0VIC_CHANNEL_BIT ( ( unsigned portLONG ) 0x0040 )
#define serU0VIC_ENABLE ( ( unsigned portLONG ) 0x0020 )
#define serCLEAR_VIC_INTERRUPT ( ( unsigned portLONG ) 0 )
/* Constants to determine the ISR source. */
#define serSOURCE_THRE ( ( unsigned portCHAR ) 0x02 )
#define serSOURCE_RX_TIMEOUT ( ( unsigned portCHAR ) 0x0c )
#define serSOURCE_ERROR ( ( unsigned portCHAR ) 0x06 )
#define serSOURCE_RX ( ( unsigned portCHAR ) 0x04 )
#define serINTERRUPT_SOURCE_MASK ( ( unsigned portCHAR ) 0x0f )
/* Misc. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static volatile portLONG lTHREEmpty = pdFALSE;
/*-----------------------------------------------------------*/
/* The ISR. Note that this is called by a wrapper written in the file
SerialISR.s79. See the WEB documentation for this port for further
information. */
__arm void vSerialISR( void );
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
unsigned portLONG ulDivisor, ulWantedClock;
xComPortHandle xReturn = serHANDLE;
extern void ( vSerialISREntry) ( void );
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* Initialise the THRE empty flag. */
lTHREEmpty = pdTRUE;
if(
( xRxedChars != serINVALID_QUEUE ) &&
( xCharsForTx != serINVALID_QUEUE ) &&
( ulWantedBaud != ( unsigned portLONG ) 0 )
)
{
portENTER_CRITICAL();
{
/* Setup the baud rate: Calculate the divisor value. */
ulWantedClock = ulWantedBaud * serWANTED_CLOCK_SCALING;
ulDivisor = configCPU_CLOCK_HZ / ulWantedClock;
/* Set the DLAB bit so we can access the divisor. */
U0LCR |= serDLAB;
/* Setup the divisor. */
U0DLL = ( unsigned portCHAR ) ( ulDivisor & ( unsigned portLONG ) 0xff );
ulDivisor >>= 8;
U0DLM = ( unsigned portCHAR ) ( ulDivisor & ( unsigned portLONG ) 0xff );
/* Turn on the FIFO's and clear the buffers. */
U0FCR = ( serFIFO_ON | serCLEAR_FIFO );
/* Setup transmission format. */
U0LCR = serNO_PARITY | ser1_STOP_BIT | ser8_BIT_CHARS;
/* Setup the VIC for the UART. */
VICIntSelect &= ~( serU0VIC_CHANNEL_BIT );
VICIntEnable |= serU0VIC_CHANNEL_BIT;
VICVectAddr1 = ( unsigned portLONG ) vSerialISREntry;
VICVectCntl1 = serU0VIC_CHANNEL | serU0VIC_ENABLE;
/* Enable UART0 interrupts. */
U0IER |= serENABLE_INTERRUPTS;
}
portEXIT_CRITICAL();
xReturn = ( xComPortHandle ) 1;
}
else
{
xReturn = ( xComPortHandle ) 0;
}
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
( void ) usStringLength;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
signed portBASE_TYPE xReturn;
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
portENTER_CRITICAL();
{
/* Is there space to write directly to the UART? */
if( lTHREEmpty == ( portLONG ) pdTRUE )
{
/* We wrote the character directly to the UART, so was
successful. */
lTHREEmpty = pdFALSE;
U0THR = cOutChar;
xReturn = pdPASS;
}
else
{
/* We cannot write directly to the UART, so queue the character.
Block for a maximum of xBlockTime if there is no space in the
queue. It is ok to block within a critical section as each
task has it's own critical section management. */
xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime );
/* Depending on queue sizing and task prioritisation: While we
were blocked waiting to post interrupts were not disabled. It is
possible that the serial ISR has emptied the Tx queue, in which
case we need to start the Tx off again. */
if( lTHREEmpty == ( portLONG ) pdTRUE )
{
xQueueReceive( xCharsForTx, &cOutChar, serNO_BLOCK );
lTHREEmpty = pdFALSE;
U0THR = cOutChar;
}
}
}
portEXIT_CRITICAL();
return xReturn;
}
/*-----------------------------------------------------------*/
__arm void vSerialISR( void )
{
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt? */
switch( U0IIR & serINTERRUPT_SOURCE_MASK )
{
case serSOURCE_ERROR : /* Not handling this, but clear the interrupt. */
cChar = U0LSR;
break;
case serSOURCE_THRE : /* The THRE is empty. If there is another
character in the Tx queue, send it now. */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
U0THR = cChar;
}
else
{
/* There are no further characters
queued to send so we can indicate
that the THRE is available. */
lTHREEmpty = pdTRUE;
}
break;
case serSOURCE_RX_TIMEOUT :
case serSOURCE_RX : /* A character was received. Place it in
the queue of received characters. */
cChar = U0RBR;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
break;
default : /* There is nothing to do, leave the ISR. */
break;
}
/* Exit the ISR. If a task was woken by either a character being received
or transmitted then a context switch will occur. */
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
/* Clear the ISR in the VIC. */
VICVectAddr = serCLEAR_VIC_INTERRUPT;
}
/*-----------------------------------------------------------*/

View File

@@ -1,46 +0,0 @@
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1
[JLinkDriver]
WatchVectorCatch=_ 0
WatchCond=_ 0
Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
[Low Level]
Pipeline mode=1
Initialized=0
[Interrupts]
Enabled=1
[MemoryMap]
Enabled=0
TypeVolition=1
UnspecRange=1
ActionState=1
[CodeCoverage]
Enabled=_ 0
[Profiling]
Enabled=0
[StackPlugin]
Enabled=1
OverflowWarningsEnabled=1
WarningThreshold=90
SpWarningsEnabled=1
WarnHow=0
UseTrigger=1
TriggerName=main
LimitSize=0
ByteLimit=50
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
[Disassemble mode]
mode=0
[Breakpoints]
Count=0
[TraceHelper]
Enabled=0
ShowSource=1

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>rtosdemo/Flash Debug</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>191</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build><ColumnWidth0>18</ColumnWidth0><ColumnWidth1>1155</ColumnWidth1><ColumnWidth2>308</ColumnWidth2><ColumnWidth3>77</ColumnWidth3></Build>
<Debug-Log/>
<TerminalIO/>
<CodeCoveragePlugin/>
<Profiling/>
<Watch>
<Format>
<struct_types/>
<watch_formats/>
</Format>
</Watch>
<Disassembly><CodeCovEnabled>0</CodeCovEnabled><MixedMode>1</MixedMode><CodeCovShow>0</CodeCovShow></Disassembly><Memory><ZoneNumber>0</ZoneNumber><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory><Find-in-Files><ColumnWidth0>552</ColumnWidth0><ColumnWidth1>78</ColumnWidth1><ColumnWidth2>946</ColumnWidth2></Find-in-Files><Breakpoints/></Static>
<Windows>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-17425-14382</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode><ExpandedNode>rtosdemo/Demo Source</ExpandedNode><ExpandedNode>rtosdemo/System Files</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd0><Wnd1><Tabs><Tab><Identity>TabID-22109-27077</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab><Tab><Identity>TabID-12074-10873</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory><Session/></Tab><Tab><Identity>TabID-18349-15872</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab><Tab><Identity>TabID-30013-18825</Identity><TabName>Find in Files</TabName><Factory>Find-in-Files</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd1></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\temp\rc\1\Demo\ARM7_LPC2129_IAR\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-01284348><key>iaridepm.enu1</key></Toolbar-01284348></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>605</Bottom><Right>265</Right><x>-2</x><y>-2</y><xscreen>0</xscreen><yscreen>0</yscreen><sizeHorzCX>0</sizeHorzCX><sizeHorzCY>0</sizeHorzCY><sizeVertCX>190714</sizeVertCX><sizeVertCY>618126</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>333</Bottom><Right>1402</Right><x>-2</x><y>-2</y><xscreen>1404</xscreen><yscreen>335</yscreen><sizeHorzCX>1002857</sizeHorzCX><sizeHorzCY>341141</sizeHorzCY><sizeVertCX>55000</sizeVertCX><sizeVertCY>78411</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View File

@@ -1,97 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <lpc21xx.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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 60000000 ) /* =12.0MHz xtal multiplied by 5 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 13 * 1024 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configQUEUE_REGISTRY_SIZE 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,112 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#include "FreeRTOS.h"
#include "portable.h"
#include "partest.h"
#define partstFIRST_IO ( ( unsigned portLONG ) 0x10000 )
#define partstNUM_LEDS ( 8 )
/*-----------------------------------------------------------
* Simple parallel port IO routines.
*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
/* This is performed from main() as the io bits are shared with other setup
functions. */
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned portLONG ulLED = partstFIRST_IO;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 0. Only P16 to P23 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* Set or clear the output. */
if( xValue )
{
IOSET1 = ulLED;
}
else
{
IOCLR1 = ulLED;
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 0. Only P10 to P13 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* If this bit is already set, clear it, and visa versa. */
ulCurrentState = IOPIN1;
if( ulCurrentState & ulLED )
{
IOCLR1 = ulLED;
}
else
{
IOSET1 = ulLED;
}
}
}

View File

@@ -1,87 +0,0 @@
### uVision2 Project, (C) Keil Software
### Do not modify !
cExt (*.c)
aExt (*.s*; *.src; *.a*)
oExt (*.obj)
lExt (*.lib)
tExt (*.txt; *.h; *.inc)
pExt (*.plm)
CppX (*.cpp)
DaveTm { 0,0,0,0,0,0,0,0 }
Target (RTOSDemo_ARM), 0x0004 // Tools: 'ARM-ADS'
Target (RTOSDemo_THUMB), 0x0004 // Tools: 'ARM-ADS'
GRPOPT 1,(Other),1,0,0
GRPOPT 2,(FreeRTOS),1,0,0
GRPOPT 3,(Stadard Demo),0,0,0
OPTFFF 1,1,2,0,0,0,0,0,<.\Startup.s><Startup.s>
OPTFFF 1,2,1,503316480,0,0,0,0,<.\ParTest\ParTest.c><ParTest.c>
OPTFFF 1,3,1,2,0,1,1,0,<.\main.c><main.c> { 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,66,0,0,0,66,0,0,0,135,4,0,0,33,2,0,0 }
OPTFFF 1,4,1,0,0,0,0,0,<.\serial\serial.c><serial.c>
OPTFFF 1,5,2,0,0,0,0,0,<.\serial\serialISR.s><serialISR.s>
OPTFFF 2,6,1,301989888,0,0,0,0,<..\..\Source\tasks.c><tasks.c>
OPTFFF 2,7,1,0,0,0,0,0,<..\..\Source\list.c><list.c>
OPTFFF 2,8,1,754974720,0,0,0,0,<..\..\Source\queue.c><queue.c>
OPTFFF 2,9,1,0,0,0,0,0,<..\..\Source\portable\RVDS\ARM7_LPC21xx\port.c><port.c>
OPTFFF 2,10,1,0,0,0,0,0,<..\..\Source\portable\MemMang\heap_2.c><heap_2.c>
OPTFFF 2,11,2,301989888,0,0,0,0,<..\..\Source\portable\RVDS\ARM7_LPC21xx\portASM.s><portASM.s>
OPTFFF 3,12,1,0,0,0,0,0,<..\Common\Minimal\flash.c><flash.c>
OPTFFF 3,13,1,0,0,0,0,0,<..\Common\Minimal\integer.c><integer.c>
OPTFFF 3,14,1,0,0,0,0,0,<..\Common\Minimal\comtest.c><comtest.c>
OPTFFF 3,15,1,0,0,0,0,0,<..\Common\Minimal\BlockQ.c><BlockQ.c>
OPTFFF 3,16,1,0,0,0,0,0,<..\Common\Minimal\dynamic.c><dynamic.c>
OPTFFF 3,17,1,0,0,0,0,0,<..\Common\Minimal\PollQ.c><PollQ.c>
OPTFFF 3,18,1,0,0,0,0,0,<..\Common\Minimal\semtest.c><semtest.c>
TARGOPT 1, (RTOSDemo_ARM)
ADSCLK=12000000
OPTTT 1,1,1,0
OPTHX 1,65535,0,0,0
OPTLX 79,66,8,<.\>
OPTOX 16
OPTLT 1,1,1,0,1,1,0,1,0,0,0,0
OPTXL 1,1,1,1,1,1,1,0,0
OPTFL 1,0,0
OPTAX 8
OPTBL 0,(Data Sheet)<DATASHTS\PHILIPS\LPC2119_2129.PDF>
OPTBL 1,(User Manual)<DATASHTS\PHILIPS\user_manual_LPC2119_2129_2194_2292_2294.PDF>
OPTDL (SARM.DLL)(-cLPC2100)(DARMP.DLL)(-pLPC21x9)(SARM.DLL)()(TARMP.DLL)(-pLPC21x9)
OPTDBG 49150,0,()()()()()()()()()() (BIN\UL2ARM.DLL)()()()
OPTKEY 0,(DLGTARM)((134=-1,-1,-1,-1,0)(135=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(80=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(101=-1,-1,-1,-1,0)(113=932,102,1307,529,0)(112=-1,-1,-1,-1,0)(136=-1,-1,-1,-1,0)(117=-1,-1,-1,-1,0)(118=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(114=-1,-1,-1,-1,0)(119=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(121=-1,-1,-1,-1,0)(122=-1,-1,-1,-1,0)(115=-1,-1,-1,-1,0)(116=-1,-1,-1,-1,0))
OPTKEY 0,(UL2ARM)(-UU0605F6E -O47 -S0 -C0 -N00("ARM7TDMI-S Core") -D00(4F1F0F0F) -L00(4) -FO7 -FD40000000 -FC800 -FN1 -FF0LPC_IAP_256 -FS00 -FL03E000)
OPTKEY 0,(DLGDARM)((134=-1,-1,-1,-1,0)(135=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(80=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(101=-1,-1,-1,-1,0)(113=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0)(136=-1,-1,-1,-1,0)(117=-1,-1,-1,-1,0)(118=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(114=-1,-1,-1,-1,0)(119=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(121=-1,-1,-1,-1,0)(122=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(115=-1,-1,-1,-1,0)(116=-1,-1,-1,-1,0))
OPTKEY 0,(ARMDBGFLAGS)(-T5F)
OPTBB 0,0,303,1,1676,0,0,0,0,1,<serial.c>()()
OPTDF 0x86
OPTLE <>
OPTLC <>
EndOpt
TARGOPT 2, (RTOSDemo_THUMB)
ADSCLK=12000000
OPTTT 1,1,1,0
OPTHX 1,65535,0,0,0
OPTLX 79,66,8,<.\>
OPTOX 16
OPTLT 1,1,1,0,1,1,0,1,0,0,0,0
OPTXL 1,1,1,1,1,1,1,0,0
OPTFL 1,0,1
OPTAX 8
OPTBL 0,(Data Sheet)<DATASHTS\PHILIPS\LPC2119_2129.PDF>
OPTBL 1,(User Manual)<DATASHTS\PHILIPS\user_manual_LPC2119_2129_2194_2292_2294.PDF>
OPTDL (SARM.DLL)(-cLPC2100)(DARMP.DLL)(-pLPC21x9)(SARM.DLL)()(TARMP.DLL)(-pLPC21x9)
OPTDBG 49149,0,()()()()()()()()()() (BIN\UL2ARM.DLL)()()()
OPTKEY 0,(DLGTARM)((134=-1,-1,-1,-1,0)(135=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(80=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(101=-1,-1,-1,-1,0)(113=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0)(136=-1,-1,-1,-1,0)(117=-1,-1,-1,-1,0)(118=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(114=-1,-1,-1,-1,0)(119=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(121=-1,-1,-1,-1,0)(122=-1,-1,-1,-1,0)(115=-1,-1,-1,-1,0)(116=-1,-1,-1,-1,0))
OPTKEY 0,(UL2ARM)(-UU0605F6E -O39 -S0 -C0 -N00("ARM7TDMI-S Core") -D00(4F1F0F0F) -L00(4) -FO19 -FD40000000 -FC800 -FN1 -FF0LPC_IAP_256 -FS00 -FL03E000)
OPTKEY 0,(DLGDARM)((134=-1,-1,-1,-1,0)(135=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(80=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(101=-1,-1,-1,-1,0)(113=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0)(136=-1,-1,-1,-1,0)(117=-1,-1,-1,-1,0)(118=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(114=-1,-1,-1,-1,0)(119=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(121=-1,-1,-1,-1,0)(122=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(115=-1,-1,-1,-1,0)(116=-1,-1,-1,-1,0))
OPTKEY 0,(ARMDBGFLAGS)(-T5F)
OPTBB 0,0,218,1,644,0,0,0,0,1,<main.c>()()
OPTBB 1,0,207,1,626,0,0,0,0,1,<main.c>()()
OPTDF 0x86
OPTLE <>
OPTLC <>
EndOpt

View File

@@ -1,210 +0,0 @@
### uVision2 Project, (C) Keil Software
### Do not modify !
Target (RTOSDemo_ARM), 0x0004 // Tools: 'ARM-ADS'
Target (RTOSDemo_THUMB), 0x0004 // Tools: 'ARM-ADS'
Group (Other)
Group (FreeRTOS)
Group (Stadard Demo)
File 1,2,<.\Startup.s><Startup.s>
File 1,1,<.\ParTest\ParTest.c><ParTest.c>
File 1,1,<.\main.c><main.c>
File 1,1,<.\serial\serial.c><serial.c>
File 1,2,<.\serial\serialISR.s><serialISR.s>
File 2,1,<..\..\Source\tasks.c><tasks.c>
File 2,1,<..\..\Source\list.c><list.c>
File 2,1,<..\..\Source\queue.c><queue.c>
File 2,1,<..\..\Source\portable\RVDS\ARM7_LPC21xx\port.c><port.c>
File 2,1,<..\..\Source\portable\MemMang\heap_2.c><heap_2.c>
File 2,2,<..\..\Source\portable\RVDS\ARM7_LPC21xx\portASM.s><portASM.s>
File 3,1,<..\Common\Minimal\flash.c><flash.c>
File 3,1,<..\Common\Minimal\integer.c><integer.c>
File 3,1,<..\Common\Minimal\comtest.c><comtest.c>
File 3,1,<..\Common\Minimal\BlockQ.c><BlockQ.c>
File 3,1,<..\Common\Minimal\dynamic.c><dynamic.c>
File 3,1,<..\Common\Minimal\PollQ.c><PollQ.c>
File 3,1,<..\Common\Minimal\semtest.c><semtest.c>
Options 1,0,0 // Target 'RTOSDemo_ARM'
Device (LPC2129)
Vendor (NXP (founded by Philips))
Cpu (IRAM(0x40000000-0x40003FFF) IROM(0-0x3FFFF) CLOCK(12000000) CPUTYPE(ARM7TDMI))
FlashUt (LPC210x_ISP.EXE ("#H" ^X $D COM1: 9600 1))
StupF ("STARTUP\Philips\Startup.s" ("Philips LPC2100 Startup Code"))
FlashDR (UL2ARM(-U40296420 -O7 -C0 -FO7 -FD40000000 -FC800 -FN1 -FF0LPC_IAP_256 -FS00 -FL03E000))
DevID (3648)
Rgf (LPC21xx.H)
Mem ()
C ()
A ()
RL ()
OH ()
DBC_IFX ()
DBC_CMS ()
DBC_AMS ()
DBC_LMS ()
UseEnv=0
EnvBin ()
EnvInc ()
EnvLib ()
EnvReg (<28>Philips\)
OrgReg (<28>Philips\)
TgStat=16
OutDir (.\)
OutName (RTOSDemo)
GenApp=1
GenLib=0
GenHex=0
Debug=1
Browse=1
LstDir (.\)
HexSel=1
MG32K=0
TGMORE=0
RunUsr 0 0 <>
RunUsr 1 0 <>
BrunUsr 0 0 <>
BrunUsr 1 0 <>
CrunUsr 0 0 <>
CrunUsr 1 0 <>
SVCSID <>
GLFLAGS=1790
ADSFLGA { 243,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ACPUTYP (ARM7TDMI)
RVDEV ()
ADSTFLGA { 0,12,0,2,99,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0 }
OCMADSOCM { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
OCMADSIRAM { 0,0,0,0,64,0,64,0,0 }
OCMADSIROM { 1,0,0,0,0,0,0,4,0 }
OCMADSXRAM { 0,0,0,0,0,0,0,0,0 }
OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,64,0,0,0,0,0,0,0,0,0,0,0 }
RV_STAVEC ()
ADSCCFLG { 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSCMISC ()
ADSCDEFN (ARM7_LPC21xx_KEIL_RVDS)
ADSCUDEF ()
ADSCINCD (.;..\..\Source\portable\RVDS\ARM7_LPC21xx;..\Common\include;..\..\Source\include)
ADSASFLG { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSAMISC ()
ADSADEFN ()
ADSAUDEF ()
ADSAINCD (..\..\Source\portable\RVDS\ARM7_LPC21xx)
PropFld { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
IncBld=1
AlwaysBuild=0
GenAsm=0
AsmAsm=0
PublicsOnly=0
StopCode=3
CustArgs ()
LibMods ()
ADSLDFG { 17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSLDTA (0x00000000)
ADSLDDA (0x40000000)
ADSLDSC ()
ADSLDIB ()
ADSLDIC ()
ADSLDMC ()
ADSLDIF ()
ADSLDDW ()
OPTDL (SARM.DLL)(-cLPC2100)(DARMP.DLL)(-pLPC21x9)(SARM.DLL)()(TARMP.DLL)(-pLPC21x9)
OPTDBG 49150,0,()()()()()()()()()() (BIN\UL2ARM.DLL)()()()
FLASH1 { 1,0,0,0,1,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0 }
FLASH2 (BIN\UL2ARM.DLL)
FLASH3 ("LPC210x_ISP.EXE" ("#H" ^X $D COM1: 9600 1))
FLASH4 ()
EndOpt
Options 2,0,0 // Target 'RTOSDemo_THUMB'
Device (LPC2129)
Vendor (NXP (founded by Philips))
Cpu (IRAM(0x40000000-0x40003FFF) IROM(0-0x3FFFF) CLOCK(12000000) CPUTYPE(ARM7TDMI))
FlashUt (LPC210x_ISP.EXE ("#H" ^X $D COM1: 9600 1))
StupF ("STARTUP\Philips\Startup.s" ("Philips LPC2100 Startup Code"))
FlashDR (UL2ARM(-U40296420 -O7 -C0 -FO7 -FD40000000 -FC800 -FN1 -FF0LPC_IAP_256 -FS00 -FL03E000))
DevID (3648)
Rgf (LPC21xx.H)
Mem ()
C ()
A ()
RL ()
OH ()
DBC_IFX ()
DBC_CMS ()
DBC_AMS ()
DBC_LMS ()
UseEnv=0
EnvBin ()
EnvInc ()
EnvLib ()
EnvReg (<28>Philips\)
OrgReg (<28>Philips\)
TgStat=16
OutDir (.\bin\)
OutName (RTOSDemo)
GenApp=1
GenLib=0
GenHex=1
Debug=1
Browse=1
LstDir (.\)
HexSel=1
MG32K=0
TGMORE=0
RunUsr 0 0 <>
RunUsr 1 0 <>
BrunUsr 0 0 <>
BrunUsr 1 0 <>
CrunUsr 0 0 <>
CrunUsr 1 0 <>
SVCSID <>
GLFLAGS=1790
ADSFLGA { 243,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ACPUTYP (ARM7TDMI)
RVDEV ()
ADSTFLGA { 0,12,0,2,99,4,0,66,0,0,0,0,0,0,0,0,0,0,0,0 }
OCMADSOCM { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
OCMADSIRAM { 0,0,0,0,64,0,64,0,0 }
OCMADSIROM { 1,0,0,0,0,0,0,4,0 }
OCMADSXRAM { 0,0,0,0,0,0,0,0,0 }
OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,64,0,0,0,0,0,0,0,0,0,0,0 }
RV_STAVEC ()
ADSCCFLG { 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSCMISC ()
ADSCDEFN (ARM7_LPC21xx_KEIL_RVDS KEIL_THUMB_INTERWORK)
ADSCUDEF ()
ADSCINCD (.;..\..\Source\portable\RVDS\ARM7_LPC21xx;..\Common\include;..\..\Source\include)
ADSASFLG { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSAMISC ()
ADSADEFN ()
ADSAUDEF ()
ADSAINCD (..\..\Source\portable\RVDS\ARM7_LPC21xx)
PropFld { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
IncBld=1
AlwaysBuild=0
GenAsm=0
AsmAsm=0
PublicsOnly=0
StopCode=3
CustArgs ()
LibMods ()
ADSLDFG { 17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSLDTA (0x00000000)
ADSLDDA (0x40000000)
ADSLDSC ()
ADSLDIB ()
ADSLDIC ()
ADSLDMC ()
ADSLDIF ()
ADSLDDW ()
OPTDL (SARM.DLL)(-cLPC2100)(DARMP.DLL)(-pLPC21x9)(SARM.DLL)()(TARMP.DLL)(-pLPC21x9)
OPTDBG 49149,0,()()()()()()()()()() (BIN\UL2ARM.DLL)()()()
FLASH1 { 1,0,0,0,1,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0 }
FLASH2 (BIN\UL2ARM.DLL)
FLASH3 ("LPC210x_ISP.EXE" ("#H" ^X $D COM1: 9600 1))
FLASH4 ()
EndOpt

View File

@@ -1,429 +0,0 @@
;/*****************************************************************************/
;/* STARTUP.S: Startup file for Philips LPC2000 */
;/*****************************************************************************/
;/* <<< Use Configuration Wizard in Context Menu >>> */
;/*****************************************************************************/
;/* This file is part of the uVision/ARM development tools. */
;/* Copyright (c) 2005-2007 Keil Software. All rights reserved. */
;/* This software may only be used under the terms of a valid, current, */
;/* end user licence from KEIL for a compatible version of KEIL software */
;/* development tools. Nothing else gives you the right to use this software. */
;/*****************************************************************************/
;/*
; * The STARTUP.S code is executed after CPU Reset. This file may be
; * translated with the following SET symbols. In uVision these SET
; * symbols are entered under Options - ASM - Define.
; *
; * REMAP: when set the startup code initializes the register MEMMAP
; * which overwrites the settings of the CPU configuration pins. The
; * startup and interrupt vectors are remapped from:
; * 0x00000000 default setting (not remapped)
; * 0x80000000 when EXTMEM_MODE is used
; * 0x40000000 when RAM_MODE is used
; *
; * EXTMEM_MODE: when set the device is configured for code execution
; * from external memory starting at address 0x80000000.
; *
; * RAM_MODE: when set the device is configured for code execution
; * from on-chip RAM starting at address 0x40000000.
; *
; * EXTERNAL_MODE: when set the PIN2SEL values are written that enable
; * the external BUS at startup.
; */
; Standard definitions of Mode bits and Interrupt (I & F) flags in PSRs
Mode_USR EQU 0x10
Mode_FIQ EQU 0x11
Mode_IRQ EQU 0x12
Mode_SVC EQU 0x13
Mode_ABT EQU 0x17
Mode_UND EQU 0x1B
Mode_SYS EQU 0x1F
I_Bit EQU 0x80 ; when I bit is set, IRQ is disabled
F_Bit EQU 0x40 ; when F bit is set, FIQ is disabled
;// <h> Stack Configuration (Stack Sizes in Bytes)
;// <o0> Undefined Mode <0x0-0xFFFFFFFF:8>
;// <o1> Supervisor Mode <0x0-0xFFFFFFFF:8>
;// <o2> Abort Mode <0x0-0xFFFFFFFF:8>
;// <o3> Fast Interrupt Mode <0x0-0xFFFFFFFF:8>
;// <o4> Interrupt Mode <0x0-0xFFFFFFFF:8>
;// <o5> User/System Mode <0x0-0xFFFFFFFF:8>
;// </h>
UND_Stack_Size EQU 0x00000008
SVC_Stack_Size EQU 0x00000400
ABT_Stack_Size EQU 0x00000008
FIQ_Stack_Size EQU 0x00000008
IRQ_Stack_Size EQU 0x00000400
USR_Stack_Size EQU 0x00000008
ISR_Stack_Size EQU (UND_Stack_Size + SVC_Stack_Size + ABT_Stack_Size + \
FIQ_Stack_Size + IRQ_Stack_Size)
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE USR_Stack_Size
__initial_sp SPACE ISR_Stack_Size
Stack_Top
;// <h> Heap Configuration
;// <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF>
;// </h>
Heap_Size EQU 0x00000000
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
; VPBDIV definitions
VPBDIV EQU 0xE01FC100 ; VPBDIV Address
;// <e> VPBDIV Setup
;// <i> Peripheral Bus Clock Rate
;// <o1.0..1> VPBDIV: VPB Clock
;// <0=> VPB Clock = CPU Clock / 4
;// <1=> VPB Clock = CPU Clock
;// <2=> VPB Clock = CPU Clock / 2
;// <o1.4..5> XCLKDIV: XCLK Pin
;// <0=> XCLK Pin = CPU Clock / 4
;// <1=> XCLK Pin = CPU Clock
;// <2=> XCLK Pin = CPU Clock / 2
;// </e>
VPBDIV_SETUP EQU 0
VPBDIV_Val EQU 0x00000000
; Phase Locked Loop (PLL) definitions
PLL_BASE EQU 0xE01FC080 ; PLL Base Address
PLLCON_OFS EQU 0x00 ; PLL Control Offset
PLLCFG_OFS EQU 0x04 ; PLL Configuration Offset
PLLSTAT_OFS EQU 0x08 ; PLL Status Offset
PLLFEED_OFS EQU 0x0C ; PLL Feed Offset
PLLCON_PLLE EQU (1<<0) ; PLL Enable
PLLCON_PLLC EQU (1<<1) ; PLL Connect
PLLCFG_MSEL EQU (0x1F<<0) ; PLL Multiplier
PLLCFG_PSEL EQU (0x03<<5) ; PLL Divider
PLLSTAT_PLOCK EQU (1<<10) ; PLL Lock Status
;// <e> PLL Setup
;// <o1.0..4> MSEL: PLL Multiplier Selection
;// <1-32><#-1>
;// <i> M Value
;// <o1.5..6> PSEL: PLL Divider Selection
;// <0=> 1 <1=> 2 <2=> 4 <3=> 8
;// <i> P Value
;// </e>
PLL_SETUP EQU 1
PLLCFG_Val EQU 0x00000024
; Memory Accelerator Module (MAM) definitions
MAM_BASE EQU 0xE01FC000 ; MAM Base Address
MAMCR_OFS EQU 0x00 ; MAM Control Offset
MAMTIM_OFS EQU 0x04 ; MAM Timing Offset
;// <e> MAM Setup
;// <o1.0..1> MAM Control
;// <0=> Disabled
;// <1=> Partially Enabled
;// <2=> Fully Enabled
;// <i> Mode
;// <o2.0..2> MAM Timing
;// <0=> Reserved <1=> 1 <2=> 2 <3=> 3
;// <4=> 4 <5=> 5 <6=> 6 <7=> 7
;// <i> Fetch Cycles
;// </e>
MAM_SETUP EQU 1
MAMCR_Val EQU 0x00000002
MAMTIM_Val EQU 0x00000004
; External Memory Controller (EMC) definitions
EMC_BASE EQU 0xFFE00000 ; EMC Base Address
BCFG0_OFS EQU 0x00 ; BCFG0 Offset
BCFG1_OFS EQU 0x04 ; BCFG1 Offset
BCFG2_OFS EQU 0x08 ; BCFG2 Offset
BCFG3_OFS EQU 0x0C ; BCFG3 Offset
;// <e> External Memory Controller (EMC)
EMC_SETUP EQU 0
;// <e> Bank Configuration 0 (BCFG0)
;// <o1.0..3> IDCY: Idle Cycles <0-15>
;// <o1.5..9> WST1: Wait States 1 <0-31>
;// <o1.11..15> WST2: Wait States 2 <0-31>
;// <o1.10> RBLE: Read Byte Lane Enable
;// <o1.26> WP: Write Protect
;// <o1.27> BM: Burst ROM
;// <o1.28..29> MW: Memory Width <0=> 8-bit <1=> 16-bit
;// <2=> 32-bit <3=> Reserved
;// </e>
BCFG0_SETUP EQU 0
BCFG0_Val EQU 0x0000FBEF
;// <e> Bank Configuration 1 (BCFG1)
;// <o1.0..3> IDCY: Idle Cycles <0-15>
;// <o1.5..9> WST1: Wait States 1 <0-31>
;// <o1.11..15> WST2: Wait States 2 <0-31>
;// <o1.10> RBLE: Read Byte Lane Enable
;// <o1.26> WP: Write Protect
;// <o1.27> BM: Burst ROM
;// <o1.28..29> MW: Memory Width <0=> 8-bit <1=> 16-bit
;// <2=> 32-bit <3=> Reserved
;// </e>
BCFG1_SETUP EQU 0
BCFG1_Val EQU 0x0000FBEF
;// <e> Bank Configuration 2 (BCFG2)
;// <o1.0..3> IDCY: Idle Cycles <0-15>
;// <o1.5..9> WST1: Wait States 1 <0-31>
;// <o1.11..15> WST2: Wait States 2 <0-31>
;// <o1.10> RBLE: Read Byte Lane Enable
;// <o1.26> WP: Write Protect
;// <o1.27> BM: Burst ROM
;// <o1.28..29> MW: Memory Width <0=> 8-bit <1=> 16-bit
;// <2=> 32-bit <3=> Reserved
;// </e>
BCFG2_SETUP EQU 0
BCFG2_Val EQU 0x0000FBEF
;// <e> Bank Configuration 3 (BCFG3)
;// <o1.0..3> IDCY: Idle Cycles <0-15>
;// <o1.5..9> WST1: Wait States 1 <0-31>
;// <o1.11..15> WST2: Wait States 2 <0-31>
;// <o1.10> RBLE: Read Byte Lane Enable
;// <o1.26> WP: Write Protect
;// <o1.27> BM: Burst ROM
;// <o1.28..29> MW: Memory Width <0=> 8-bit <1=> 16-bit
;// <2=> 32-bit <3=> Reserved
;// </e>
BCFG3_SETUP EQU 0
BCFG3_Val EQU 0x0000FBEF
;// </e> End of EMC
; External Memory Pins definitions
PINSEL2 EQU 0xE002C014 ; PINSEL2 Address
PINSEL2_Val EQU 0x0E6149E4 ; CS0..3, OE, WE, BLS0..3,
; D0..31, A2..23, JTAG Pins
PRESERVE8
; Area Definition and Entry Point
; Startup Code must be linked first at Address at which it expects to run.
AREA RESET, CODE, READONLY
ARM
; Exception Vectors
; Mapped to Address 0.
; Absolute addressing mode must be used.
; Dummy Handlers are implemented as infinite loops which can be modified.
IMPORT vPortYieldProcessor
Vectors LDR PC, Reset_Addr
LDR PC, Undef_Addr
LDR PC, SWI_Addr
LDR PC, PAbt_Addr
LDR PC, DAbt_Addr
NOP ; Reserved Vector
; LDR PC, IRQ_Addr
LDR PC, [PC, #-0x0FF0] ; Vector from VicVectAddr
LDR PC, FIQ_Addr
Reset_Addr DCD Reset_Handler
Undef_Addr DCD Undef_Handler
SWI_Addr DCD vPortYieldProcessor
PAbt_Addr DCD PAbt_Handler
DAbt_Addr DCD DAbt_Handler
DCD 0 ; Reserved Address
IRQ_Addr DCD IRQ_Handler
FIQ_Addr DCD FIQ_Handler
Undef_Handler B Undef_Handler
SWI_Handler B SWI_Handler
PAbt_Handler B PAbt_Handler
DAbt_Handler B DAbt_Handler
IRQ_Handler B IRQ_Handler
FIQ_Handler B FIQ_Handler
; Reset Handler
EXPORT Reset_Handler
Reset_Handler
; Setup External Memory Pins
IF :DEF:EXTERNAL_MODE
LDR R0, =PINSEL2
LDR R1, =PINSEL2_Val
STR R1, [R0]
ENDIF
; Setup External Memory Controller
IF EMC_SETUP <> 0
LDR R0, =EMC_BASE
IF BCFG0_SETUP <> 0
LDR R1, =BCFG0_Val
STR R1, [R0, #BCFG0_OFS]
ENDIF
IF BCFG1_SETUP <> 0
LDR R1, =BCFG1_Val
STR R1, [R0, #BCFG1_OFS]
ENDIF
IF BCFG2_SETUP <> 0
LDR R1, =BCFG2_Val
STR R1, [R0, #BCFG2_OFS]
ENDIF
IF BCFG3_SETUP <> 0
LDR R1, =BCFG3_Val
STR R1, [R0, #BCFG3_OFS]
ENDIF
ENDIF ; EMC_SETUP
; Setup VPBDIV
IF VPBDIV_SETUP <> 0
LDR R0, =VPBDIV
LDR R1, =VPBDIV_Val
STR R1, [R0]
ENDIF
; Setup PLL
IF PLL_SETUP <> 0
LDR R0, =PLL_BASE
MOV R1, #0xAA
MOV R2, #0x55
; Configure and Enable PLL
MOV R3, #PLLCFG_Val
STR R3, [R0, #PLLCFG_OFS]
MOV R3, #PLLCON_PLLE
STR R3, [R0, #PLLCON_OFS]
STR R1, [R0, #PLLFEED_OFS]
STR R2, [R0, #PLLFEED_OFS]
; Wait until PLL Locked
PLL_Loop LDR R3, [R0, #PLLSTAT_OFS]
ANDS R3, R3, #PLLSTAT_PLOCK
BEQ PLL_Loop
; Switch to PLL Clock
MOV R3, #(PLLCON_PLLE:OR:PLLCON_PLLC)
STR R3, [R0, #PLLCON_OFS]
STR R1, [R0, #PLLFEED_OFS]
STR R2, [R0, #PLLFEED_OFS]
ENDIF ; PLL_SETUP
; Setup MAM
IF MAM_SETUP <> 0
LDR R0, =MAM_BASE
MOV R1, #MAMTIM_Val
STR R1, [R0, #MAMTIM_OFS]
MOV R1, #MAMCR_Val
STR R1, [R0, #MAMCR_OFS]
ENDIF ; MAM_SETUP
; Memory Mapping (when Interrupt Vectors are in RAM)
MEMMAP EQU 0xE01FC040 ; Memory Mapping Control
IF :DEF:REMAP
LDR R0, =MEMMAP
IF :DEF:EXTMEM_MODE
MOV R1, #3
ELIF :DEF:RAM_MODE
MOV R1, #2
ELSE
MOV R1, #1
ENDIF
STR R1, [R0]
ENDIF
; Initialise Interrupt System
; ...
; Setup Stack for each mode
LDR R0, =Stack_Top
; Enter Undefined Instruction Mode and set its Stack Pointer
MSR CPSR_c, #Mode_UND:OR:I_Bit:OR:F_Bit
MOV SP, R0
SUB R0, R0, #UND_Stack_Size
; Enter Abort Mode and set its Stack Pointer
MSR CPSR_c, #Mode_ABT:OR:I_Bit:OR:F_Bit
MOV SP, R0
SUB R0, R0, #ABT_Stack_Size
; Enter FIQ Mode and set its Stack Pointer
MSR CPSR_c, #Mode_FIQ:OR:I_Bit:OR:F_Bit
MOV SP, R0
SUB R0, R0, #FIQ_Stack_Size
; Enter IRQ Mode and set its Stack Pointer
MSR CPSR_c, #Mode_IRQ:OR:I_Bit:OR:F_Bit
MOV SP, R0
SUB R0, R0, #IRQ_Stack_Size
; Enter Supervisor Mode and set its Stack Pointer
MSR CPSR_c, #Mode_SVC:OR:I_Bit:OR:F_Bit
MOV SP, R0
SUB R0, R0, #SVC_Stack_Size
; Enter the C code
IMPORT __main
LDR R0, =__main
BX R0
IF :DEF:__MICROLIB
EXPORT __heap_base
EXPORT __heap_limit
ELSE
; User Initial Stack & Heap
AREA |.text|, CODE, READONLY
IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR R0, = Heap_Mem
LDR R1, =(Stack_Mem + USR_Stack_Size)
LDR R2, = (Heap_Mem + Heap_Size)
LDR R3, = Stack_Mem
BX LR
ENDIF
END

View File

@@ -1,277 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles the onboard LED. Should any task contain an error at any time
* the LED toggle rate will change from 3 seconds to 500ms.
*
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "partest.h"
#include "flash.h"
#include "integer.h"
#include "comtest2.h"
#include "serial.h"
#include "PollQ.h"
#include "BlockQ.h"
#include "semtest.h"
#include "dynamic.h"
/*-----------------------------------------------------------*/
/* Constants to setup I/O and processor. */
#define mainTX_ENABLE ( ( unsigned portLONG ) 0x00010000 ) /* UART1. */
#define mainRX_ENABLE ( ( unsigned portLONG ) 0x00040000 ) /* UART1. */
#define mainBUS_CLK_FULL ( ( unsigned portCHAR ) 0x01 )
#define mainLED_TO_OUTPUT ( ( unsigned portLONG ) 0xff0000 )
/* Constants for the ComTest demo application tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 115200 )
#define mainCOM_TEST_LED ( 3 )
/* Priorities for the demo application tasks. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
/* Constants used by the "check" task. As described at the head of this file
the check task toggles an LED. The rate at which the LED flashes is used to
indicate whether an error has been detected or not. If the LED toggles every
3 seconds then no errors have been detected. If the rate increases to 500ms
then an error has been detected in at least one of the demo application tasks. */
#define mainCHECK_LED ( 7 )
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
/*-----------------------------------------------------------*/
/*
* Checks that all the demo application tasks are still executing without error
* - as described at the top of the file.
*/
static portLONG prvCheckOtherTasksAreStillRunning( void );
/*
* The task that executes at the highest priority and calls
* prvCheckOtherTasksAreStillRunning(). See the description at the top
* of the file.
*/
static void vErrorChecks( void *pvParameters );
/*
* Configure the processor for use with the Keil demo board. This is very
* minimal as most of the setup is managed by the settings in the project
* file.
*/
static void prvSetupHardware( void );
/*-----------------------------------------------------------*/
/*
* Application entry point:
* Starts all the other tasks, then starts the scheduler.
*/
int main( void )
{
/* Setup the hardware for use with the Keil demo board. */
prvSetupHardware();
/* Start the demo/test application tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartDynamicPriorityTasks();
/* Start the check task - which is defined in this file. This is the task
that periodically checks to see that all the other tasks are executing
without error. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Now all the tasks have been started - start the scheduler.
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used here. */
vTaskStartScheduler();
/* Should never reach here! If you do then there was not enough heap
available for the idle task to be created. */
for( ;; );
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
/* Parameters are not used. */
( void ) pvParameters;
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. If an error is detected then the delay period
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
the on board LED flash rate will increase.
This task runs at the highest priority. */
for( ;; )
{
/* The period of the delay depends on whether an error has been
detected or not. If an error has been detected then the period
is reduced to increase the LED flash rate. */
vTaskDelay( xDelayPeriod );
if( prvCheckOtherTasksAreStillRunning() != pdPASS )
{
/* An error has been detected in one of the tasks - flash faster. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
/* Toggle the LED before going back to wait for the next cycle. */
vParTestToggleLED( mainCHECK_LED );
}
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
/* Perform the hardware setup required. This is minimal as most of the
setup is managed by the settings in the project file. */
/* Configure the UART1 pins. All other pins remain at their default of 0. */
PINSEL0 |= mainTX_ENABLE;
PINSEL0 |= mainRX_ENABLE;
/* LED pins need to be output. */
IODIR1 = mainLED_TO_OUTPUT;
/* Setup the peripheral bus to be the same as the PLL output. */
VPBDIV = mainBUS_CLK_FULL;
}
/*-----------------------------------------------------------*/
static portLONG prvCheckOtherTasksAreStillRunning( void )
{
portLONG lReturn = pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xAreIntegerMathsTaskStillRunning() != pdPASS )
{
lReturn = pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdPASS )
{
lReturn = pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
return lReturn;
}
/*-----------------------------------------------------------*/

View File

@@ -1,326 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
Note this driver is used to test the FreeRTOS port. It is NOT intended to
be an example of an efficient implementation!
*/
/* Standard includes. */
#include <stdlib.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
/* Demo application includes. */
#include "serial.h"
/*-----------------------------------------------------------*/
/* Constants to setup and access the UART. */
#define serDLAB ( ( unsigned portCHAR ) 0x80 )
#define serENABLE_INTERRUPTS ( ( unsigned portCHAR ) 0x03 )
#define serNO_PARITY ( ( unsigned portCHAR ) 0x00 )
#define ser1_STOP_BIT ( ( unsigned portCHAR ) 0x00 )
#define ser8_BIT_CHARS ( ( unsigned portCHAR ) 0x03 )
#define serFIFO_ON ( ( unsigned portCHAR ) 0x01 )
#define serCLEAR_FIFO ( ( unsigned portCHAR ) 0x06 )
#define serWANTED_CLOCK_SCALING ( ( unsigned portLONG ) 16 )
/* Constants to setup and access the VIC. */
#define serU1VIC_CHANNEL ( ( unsigned portLONG ) 0x0007 )
#define serU1VIC_CHANNEL_BIT ( ( unsigned portLONG ) 0x0080 )
#define serU1VIC_ENABLE ( ( unsigned portLONG ) 0x0020 )
/* Misc. */
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serHANDLE ( ( xComPortHandle ) 1 )
#define serNO_BLOCK ( ( portTickType ) 0 )
/* Constant to access the VIC. */
#define serCLEAR_VIC_INTERRUPT ( ( unsigned portLONG ) 0 )
/* Constants to determine the ISR source. */
#define serSOURCE_THRE ( ( unsigned portCHAR ) 0x02 )
#define serSOURCE_RX_TIMEOUT ( ( unsigned portCHAR ) 0x0c )
#define serSOURCE_ERROR ( ( unsigned portCHAR ) 0x06 )
#define serSOURCE_RX ( ( unsigned portCHAR ) 0x04 )
#define serINTERRUPT_SOURCE_MASK ( ( unsigned portCHAR ) 0x0f )
#define serINTERRUPT_IS_PENDING ( ( unsigned portCHAR ) 0x01 )
/*-----------------------------------------------------------*/
/*
* The asm wrapper for the interrupt service routine.
*/
extern void vUART_ISREntry( void );
/*
* The C function called from the asm wrapper.
*/
void vUART_ISRHandler( void );
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
/* Communication flag between the interrupt service routine and serial API. */
static volatile portLONG lTHREEmpty;
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
unsigned portLONG ulDivisor, ulWantedClock;
xComPortHandle xReturn = serHANDLE;
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* Initialise the THRE empty flag. */
lTHREEmpty = pdTRUE;
if(
( xRxedChars != serINVALID_QUEUE ) &&
( xCharsForTx != serINVALID_QUEUE ) &&
( ulWantedBaud != ( unsigned portLONG ) 0 )
)
{
portENTER_CRITICAL()
{
/* Setup the baud rate: Calculate the divisor value. */
ulWantedClock = ulWantedBaud * serWANTED_CLOCK_SCALING;
ulDivisor = configCPU_CLOCK_HZ / ulWantedClock;
/* Set the DLAB bit so we can access the divisor. */
U1LCR |= serDLAB;
/* Setup the divisor. */
U1DLL = ( unsigned portCHAR ) ( ulDivisor & ( unsigned portLONG ) 0xff );
ulDivisor >>= 8;
U1DLM = ( unsigned portCHAR ) ( ulDivisor & ( unsigned portLONG ) 0xff );
/* Turn on the FIFO's and clear the buffers. */
U1FCR = ( serFIFO_ON | serCLEAR_FIFO );
/* Setup transmission format. */
U1LCR = serNO_PARITY | ser1_STOP_BIT | ser8_BIT_CHARS;
/* Setup the VIC for the UART. */
VICIntSelect &= ~( serU1VIC_CHANNEL_BIT );
VICIntEnable |= serU1VIC_CHANNEL_BIT;
VICVectAddr1 = ( unsigned portLONG ) vUART_ISREntry;
VICVectCntl1 = serU1VIC_CHANNEL | serU1VIC_ENABLE;
/* Enable UART0 interrupts. */
U1IER |= serENABLE_INTERRUPTS;
}
portEXIT_CRITICAL();
}
else
{
xReturn = ( xComPortHandle ) 0;
}
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
( void ) usStringLength;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
signed portBASE_TYPE xReturn;
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
portENTER_CRITICAL();
{
/* Is there space to write directly to the UART? */
if( lTHREEmpty == ( portLONG ) pdTRUE )
{
/* We wrote the character directly to the UART, so was
successful. */
lTHREEmpty = pdFALSE;
U1THR = cOutChar;
xReturn = pdPASS;
}
else
{
/* We cannot write directly to the UART, so queue the character.
Block for a maximum of xBlockTime if there is no space in the
queue. It is ok to block within a critical section as each
task has it's own critical section management. */
xReturn = xQueueSend( xCharsForTx, &cOutChar, xBlockTime );
/* Depending on queue sizing and task prioritisation: While we
were blocked waiting to post interrupts were not disabled. It is
possible that the serial ISR has emptied the Tx queue, in which
case we need to start the Tx off again. */
if( lTHREEmpty == ( portLONG ) pdTRUE )
{
xQueueReceive( xCharsForTx, &cOutChar, serNO_BLOCK );
lTHREEmpty = pdFALSE;
U1THR = cOutChar;
}
}
}
portEXIT_CRITICAL();
return xReturn;
}
/*-----------------------------------------------------------*/
void vUART_ISRHandler( void )
{
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
unsigned portCHAR ucInterrupt;
ucInterrupt = U1IIR;
/* The interrupt pending bit is active low. */
while( ( ucInterrupt & serINTERRUPT_IS_PENDING ) == 0 )
{
/* What caused the interrupt? */
switch( ucInterrupt & serINTERRUPT_SOURCE_MASK )
{
case serSOURCE_ERROR : /* Not handling this, but clear the interrupt. */
cChar = U1LSR;
break;
case serSOURCE_THRE : /* The THRE is empty. If there is another
character in the Tx queue, send it now. */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
U1THR = cChar;
}
else
{
/* There are no further characters
queued to send so we can indicate
that the THRE is available. */
lTHREEmpty = pdTRUE;
}
break;
case serSOURCE_RX_TIMEOUT :
case serSOURCE_RX : /* A character was received. Place it in
the queue of received characters. */
cChar = U1RBR;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
break;
default : /* There is nothing to do, leave the ISR. */
break;
}
ucInterrupt = U1IIR;
}
/* Clear the ISR in the VIC. */
VICVectAddr = serCLEAR_VIC_INTERRUPT;
/* Exit the ISR. If a task was woken by either a character being received
or transmitted then a context switch will occur. */
portEXIT_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/

View File

@@ -1,83 +0,0 @@
;/*
; FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
;
; 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 exception 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.
; Alternative commercial license and support terms are also available upon
; request. See the licensing section of http://www.FreeRTOS.org for full
; license details.
;
; 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. See the GNU General Public License for
; more details.
;
; You should have received a copy of the GNU General Public License along
; with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
; Temple Place, Suite 330, Boston, MA 02111-1307 USA.
;
;
; ***************************************************************************
; * *
; * Looking for a quick start? Then check out the FreeRTOS eBook! *
; * See http://www.FreeRTOS.org/Documentation for details *
; * *
; ***************************************************************************
;
; 1 tab == 4 spaces!
;
; Please ensure to read the configuration and relevant port sections of the
; online documentation.
;
; http://www.FreeRTOS.org - Documentation, latest information, license and
; contact details.
;
; http://www.SafeRTOS.com - A version that is certified for use in safety
; critical systems.
;
; http://www.OpenRTOS.com - Commercial support, development, porting,
; licensing and training services.
;*/
INCLUDE portmacro.inc
;The UART interrupt entry point is defined within an assembly wrapper
;within this file. This takes care of the task context saving before it
;calls the main handler (vUART_ISRHandler()) which is written in C within
;serial.c. The execution of the handler can unblock tasks that were blocked
;waiting for UART events. Once the handler completes the asm wrapper
;finishes off by restoring the context of whichever task is now selected to
;enter the RUNNING state (which might now be a different task to that which
;was originally interrupted.
IMPORT vUART_ISRHandler
EXPORT vUART_ISREntry
;/* Interrupt entry must always be in ARM mode. */
ARM
AREA |.text|, CODE, READONLY
vUART_ISREntry
PRESERVE8
; Save the context of the interrupted task.
portSAVE_CONTEXT
; Call the C handler function - defined within serial.c.
LDR R0, =vUART_ISRHandler
MOV LR, PC
BX R0
; Finish off by restoring the context of the task that has been chosen to
; run next - which might be a different task to that which was originally
; interrupted.
portRESTORE_CONTEXT
END

View File

@@ -1,108 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <LPC21xx.h>
#define vPortYieldProcessor swi_handler
/* For compatability with the LPC2106 header. */
#define T0_IR T0IR
#define T0_PR T0PR
#define T0_MR0 T0MR0
#define T0_MCR T0MCR
#define T0_TCR T0TCR
/*-----------------------------------------------------------
* 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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
/* In this case configCPU_CLOCK_HZ is actually set to the pclk frequency, not
the CPU frequency. */
#define configCPU_CLOCK_HZ ( 58982400UL ) /* =14.7456MHz xtal multiplied by 4 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 6 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 15 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,56 +0,0 @@
<!DOCTYPE CrossStudio_Project_File>
<solution Name="RTOSDemo" version="1">
<project Name="RTOSDemo">
<configuration Name="Common" Target="LPC2138" arm_architecture="v4T" arm_core_type="ARM7TDMI-S" arm_simulator_memory_simulation_filename="$(StudioDir)/targets/Philips_LPC210X/LPC2000SimulatorMemory.dll" arm_simulator_memory_simulation_parameter="LPC21;0x80000;0x10000" arm_target_debug_interface_type="ARM7TDI" arm_target_loader_parameter="14745600" gcc_entry_point="reset_handler" link_include_startup_code="No" linker_additional_files="$(StudioDir)/lib/liblpc2000$(LibExt)$(LIB)" linker_memory_map_file="$(StudioDir)/targets/Philips_LPC210X/Philips_LPC2138_MemoryMap.xml" oscillator_frequency="14.7456MHz" project_directory="" project_type="Executable" property_groups_file_path="$(StudioDir)/targets/Philips_LPC210X/propertyGroups.xml"/>
<configuration Name="RAM" Placement="RAM" linker_section_placement_file="$(StudioDir)/targets/sram_placement.xml" target_reset_script="SRAMReset()"/>
<configuration Name="Flash" Placement="Flash" arm_target_flash_loader_file_path="$(StudioDir)/targets/Philips_LPC210X/Release/Loader.elf" arm_target_flash_loader_type="Comms Channel Loader" linker_section_placement_file="$(StudioDir)/targets/flash_placement.xml" target_reset_script="FLASHReset()"/>
<folder Name="Source Files">
<configuration Name="Common" filter="c;cpp;cxx;cc;h;s;asm;inc"/>
<folder Name="RTOS Source">
<file Name="tasks.c" file_name="../../Source/tasks.c">
<configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
</file>
<file Name="list.c" file_name="../../Source/list.c"/>
<file Name="queue.c" file_name="../../Source/queue.c"/>
<file Name="heap_1.c" file_name="../../Source/portable/MemMang/heap_1.c"/>
<file Name="portISR.c" file_name="../../Source/portable/GCC/ARM7_LPC2000/portISR.c">
<configuration Name="THUMB" arm_instruction_set="ARM"/>
</file>
<file Name="port.c" file_name="../../Source/portable/GCC/ARM7_LPC2000/port.c"/>
</folder>
<folder Name="Demo Source">
<file Name="main.c" file_name="main.c"/>
<file Name="PollQ.c" file_name="../Common/Minimal/PollQ.c"/>
<file Name="BlockQ.c" file_name="../Common/Minimal/BlockQ.c"/>
<file Name="death.c" file_name="../Common/Minimal/death.c"/>
<file Name="dynamic.c" file_name="../Common/Minimal/dynamic.c"/>
<file Name="integer.c" file_name="../Common/Minimal/integer.c"/>
<file Name="semtest.c" file_name="../Common/Minimal/semtest.c"/>
<file Name="mainISR.c" file_name="mainISR.c">
<configuration Name="THUMB" arm_instruction_set="ARM"/>
</file>
<file Name="blocktim.c" file_name="../Common/Minimal/blocktim.c"/>
<file Name="recmutex.c" file_name="../Common/Minimal/recmutex.c"/>
</folder>
</folder>
<folder Name="System Files">
<file Name="crt0.s" file_name="$(StudioDir)/source/crt0.s"/>
<file Name="Philips_LPC210X_Startup.s" file_name="$(StudioDir)/targets/Philips_LPC210X/Philips_LPC210X_Startup.s"/>
<file Name="Philips_LPC210X_Target.js" file_name="$(StudioDir)/targets/Philips_LPC210X/Philips_LPC210X_Target.js">
<configuration Name="Common" file_type="Reset Script"/>
</file>
</folder>
<file Name="threads.js" file_name="threads.js"/>
<configuration Name="THUMB Flash Debug" build_quietly="No"/>
</project>
<configuration Name="ARM Flash Debug" inherited_configurations="ARM;Flash;Debug"/>
<configuration Name="ARM" arm_instruction_set="ARM" arm_library_instruction_set="ARM" c_preprocessor_definitions="__ARM" hidden="Yes"/>
<configuration Name="Flash" c_preprocessor_definitions="__FLASH_BUILD" hidden="Yes"/>
<configuration Name="Debug" build_debug_information="Yes" c_preprocessor_definitions="DEBUG" gcc_optimization_level="None" hidden="Yes" link_include_startup_code="No"/>
<configuration Name="ARM Flash Release" inherited_configurations="ARM;Flash;Release"/>
<configuration Name="Release" build_debug_information="No" c_preprocessor_definitions="NDEBUG;STARTUP_FROM_RESET" gcc_optimization_level="Level 1" hidden="Yes" link_include_startup_code="No"/>
<configuration Name="THUMB Flash Debug" inherited_configurations="THUMB;Flash;Debug"/>
<configuration Name="THUMB" arm_instruction_set="THUMB" arm_library_instruction_set="THUMB" c_preprocessor_definitions="__THUMB;THUMB_INTERWORK" hidden="Yes"/>
<configuration Name="THUMB Flash Release" inherited_configurations="THUMB;Flash;Release"/>
<configuration Name="Common" c_additional_options="-fomit-frame-pointer" c_preprocessor_definitions="GCC_ARM7;SUPERVISOR_START;VECTORED_IRQ_INTERRUPTS" c_system_include_directories="$(StudioDir)/include;$(StudioDir)/include/targets" c_user_include_directories=".;..\\..\\Source\\include;..\\..\\Source\\GCC\\ARM7_LPC2000;..\\Common\\Include"/>
</solution>

View File

@@ -1,101 +0,0 @@
<!DOCTYPE CrossStudio_for_ARM_Session_File>
<session>
<Autos>
<Watches active="0" />
</Autos>
<Bookmarks/>
<Breakpoints>
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="D_Abort" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="FIQ" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="IRQ" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="P_Abort" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="Reset" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="SWI" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="Undef" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="BusFault" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="ExceptionEntryReturnFault" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="HardFault" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="MemManage" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="Reset" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="UsageFault_CheckingError" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="UsageFault_Coprocessor" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="UsageFault_StateError" filename="" />
</Breakpoints>
<ExecutionCountWindow/>
<Memory1>
<MemoryWindow autoEvaluate="0" addressText="0x102248" numColumns="8" sizeText="128" dataSize="1" radix="16" addressSpace="" />
</Memory1>
<Memory2>
<MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
</Memory2>
<Memory3>
<MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
</Memory3>
<Memory4>
<MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
</Memory4>
<MemoryUsageWindow>
<ProjectSessionItem path="RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;Demo Source" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;RTOS Source" name="unnamed" />
</MemoryUsageWindow>
<Project>
<ProjectSessionItem path="RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;Demo Source" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;RTOS Source" name="unnamed" />
</Project>
<Register1>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="CPU - Current Mode" decimalNodes="" octalNodes="" asciiNodes="" />
</Register1>
<Register2>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
</Register2>
<Register3>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
</Register3>
<Register4>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
</Register4>
<SourceNavigatorWindow/>
<TraceWindow>
<Trace wrap="Yes" type="1" enabled="Yes" />
</TraceWindow>
<Watch1>
<Watches active="0" >
<Watchpoint evalMode="1" linenumber="0" evalType="1" radix="-1" name="pxCurrentTCB" expression="pxCurrentTCB" filename="" />
</Watches>
</Watch1>
<Watch2>
<Watches active="0" />
</Watch2>
<Watch3>
<Watches active="0" />
</Watch3>
<Watch4>
<Watches active="1" >
<Watchpoint evalMode="1" linenumber="0" evalType="1" radix="16" name="pxMutex" expression="pxMutex" filename="" />
<Watchpoint evalMode="1" linenumber="0" evalType="1" radix="-1" name="pxCurrentTCB" expression="pxCurrentTCB" filename="" />
<Watchpoint evalMode="1" linenumber="0" evalType="1" radix="-1" name="(xQUEUE *)xMutex" expression="(xQUEUE *)xMutex" filename="" />
</Watches>
</Watch4>
<Files>
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Demo\ARM7_LPC2138_Rowley\main.c" y="156" path="C:\E\Dev\FreeRTOS\Demo\ARM7_LPC2138_Rowley\main.c" left="0" selected="0" name="unnamed" top="151" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\recmutex.c" y="223" path="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\recmutex.c" left="0" selected="1" name="unnamed" top="219" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="31" debugPath="C:\E\Dev\FreeRTOS\Demo\ARM7_LPC2138_Rowley\FreeRTOSConfig.h" y="60" path="C:\E\Dev\FreeRTOS\Demo\ARM7_LPC2138_Rowley\FreeRTOSConfig.h" left="0" selected="0" name="unnamed" top="55" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Source\queue.c" y="336" path="C:\E\Dev\FreeRTOS\Source\queue.c" left="0" selected="0" name="unnamed" top="303" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="128" debugPath="C:\E\Dev\FreeRTOS\\Source\\include\semphr.h" y="156" path="C:\E\Dev\FreeRTOS\\Source\\include\semphr.h" left="0" selected="0" name="unnamed" top="137" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Source\tasks.c" y="1226" path="C:\E\Dev\FreeRTOS\Source\tasks.c" left="0" selected="0" name="unnamed" top="1199" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" y="123" path="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\blocktim.c" left="0" selected="0" name="unnamed" top="94" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM7_LPC2000\port.c" y="237" path="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM7_LPC2000\port.c" left="0" selected="0" name="unnamed" top="218" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM7_LPC2000\portISR.c" y="223" path="C:\E\Dev\FreeRTOS\Source\portable\GCC\ARM7_LPC2000\portISR.c" left="0" selected="0" name="unnamed" top="190" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\integer.c" y="141" path="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\integer.c" left="0" selected="0" name="unnamed" top="118" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="20" debugPath="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\dynamic.c" y="351" path="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\dynamic.c" left="0" selected="0" name="unnamed" top="342" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\semtest.c" y="193" path="C:\E\Dev\FreeRTOS\Demo\Common\Minimal\semtest.c" left="0" selected="0" name="unnamed" top="173" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\Source\list.c" y="163" path="C:\E\Dev\FreeRTOS\Source\list.c" left="0" selected="0" name="unnamed" top="130" />
</Files>
<ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="/USB CrossConnect for ARM" debugSearchFileMap="" fileDialogInitialDirectory="C:\E\Dev\FreeRTOS\Demo\Common\Minimal" fileDialogDefaultFilter="*.cpp;*.cxx;*.cc;*.c;*.h;*.hpp;*.hxx" autoConnectCapabilities="1407" debugSearchPath="" buildConfiguration="THUMB Flash Debug" />
</session>

View File

@@ -1,380 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
* This file contains a demo created to execute on the Rowley Associates
* LPC2138 CrossFire development board.
*
* main() creates all the demo application tasks, then starts the scheduler.
* The WEB documentation provides more details of the standard demo application
* tasks.
*
* Main.c also creates a task called "Check". This only executes every few
* seconds but has a high priority so is guaranteed to get processor time.
* Its function is to check that all the other tasks are still operational.
* Each standard demo task maintains a unique count that is incremented each
* time the task successfully completes its function. Should any error occur
* within such a task the count is permanently halted. The check task inspects
* the count of each task to ensure it has changed since the last time the
* check task executed. If all the count variables have changed all the tasks
* are still executing error free, and the check task writes "PASS" to the
* CrossStudio terminal IO window. Should any task contain an error at any time
* the error is latched and "FAIL" written to the terminal IO window.
*
* Finally, main() sets up an interrupt service routine and task to handle
* pushes of the button that is built into the CrossFire board. When the button
* is pushed the ISR wakes the button task - which generates a table of task
* status information which is also displayed on the terminal IO window.
*
* A print task is defined to ensure exclusive and consistent access to the
* terminal IO. This is the only task that is allowed to access the terminal.
* The check and button task therefore do not access the terminal directly but
* instead pass a pointer to the message they wish to display to the print task.
*/
/* Standard includes. */
#include <__cross_studio_io.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
/* Demo app includes. */
#include "BlockQ.h"
#include "death.h"
#include "dynamic.h"
#include "integer.h"
#include "PollQ.h"
#include "blocktim.h"
#include "recmutex.h"
#include "semtest.h"
/* Hardware configuration definitions. */
#define mainBUS_CLK_FULL ( ( unsigned portCHAR ) 0x01 )
#define mainLED_BIT 0x80000000
#define mainP0_14__EINT_1 ( 2 << 28 )
#define mainEINT_1_EDGE_SENSITIVE 2
#define mainEINT_1_FALLING_EDGE_SENSITIVE 0
#define mainEINT_1_CHANNEL 15
#define mainEINT_1_VIC_CHANNEL_BIT ( 1 << mainEINT_1_CHANNEL )
#define mainEINT_1_ENABLE_BIT ( 1 << 5 )
/* Demo application definitions. */
#define mainQUEUE_SIZE ( 3 )
#define mainLED_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainERROR_LED_DELAY ( ( portTickType ) 50 / portTICK_RATE_MS )
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
#define mainLIST_BUFFER_SIZE 2048
#define mainNO_DELAY ( 0 )
#define mainSHORT_DELAY ( 150 / portTICK_RATE_MS )
/* Task priorities. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainPRINT_TASK_PRIORITY ( tskIDLE_PRIORITY + 0 )
/*-----------------------------------------------------------*/
/* The semaphore used to wake the button task from within the external interrupt
handler. */
xSemaphoreHandle xButtonSemaphore;
/* The queue that is used to send message to vPrintTask for display in the
terminal output window. */
xQueueHandle xPrintQueue;
/* The rate at which the LED will toggle. The toggle rate increases if an
error is detected in any task. */
static portTickType xLED_Delay = mainLED_DELAY;
/*-----------------------------------------------------------*/
/*
* Simply flashes the on board LED every mainLED_DELAY milliseconds.
*/
static void vLEDTask( void *pvParameters );
/*
* Checks the status of all the demo tasks then prints a message to the
* CrossStudio terminal IO windows. The message will be either PASS or FAIL
* depending on the status of the demo applications tasks. A FAIL status will
* be latched.
*
* Messages are not written directly to the terminal, but passed to vPrintTask
* via a queue.
*/
static void vCheckTask( void *pvParameters );
/*
* Controls all terminal output. If a task wants to send a message to the
* terminal IO it posts a pointer to the text to vPrintTask via a queue. This
* ensures serial access to the terminal IO.
*/
static void vPrintTask( void *pvParameter );
/*
* Simply waits for an interrupt to be generated from the built in button, then
* generates a table of tasks states that is then written by vPrintTask to the
* terminal output window within CrossStudio.
*/
static void vButtonHandlerTask( void *pvParameters );
/*-----------------------------------------------------------*/
int main( void )
{
/* Setup the peripheral bus to be the same as the PLL output. */
VPBDIV = mainBUS_CLK_FULL;
/* Create the queue used to pass message to vPrintTask. */
xPrintQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( portCHAR * ) );
/* Create the semaphore used to wake vButtonHandlerTask(). */
vSemaphoreCreateBinary( xButtonSemaphore );
xSemaphoreTake( xButtonSemaphore, 0 );
/* Start the standard demo tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartDynamicPriorityTasks();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
#if configUSE_PREEMPTION == 1
{
/* The timing of console output when not using the preemptive
scheduler causes the block time tests to detect a timing problem. */
vCreateBlockTimeTasks();
}
#endif
vStartRecursiveMutexTasks();
/* Start the tasks defined within this file. */
xTaskCreate( vLEDTask, "LED", configMINIMAL_STACK_SIZE, NULL, mainLED_TASK_PRIORITY, NULL );
xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
xTaskCreate( vPrintTask, "Print", configMINIMAL_STACK_SIZE, NULL, mainPRINT_TASK_PRIORITY, NULL );
xTaskCreate( vButtonHandlerTask, "Button", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler. */
vTaskStartScheduler();
/* The scheduler should now be running, so we will only ever reach here if we
ran out of heap space. */
return 0;
}
/*-----------------------------------------------------------*/
static void vLEDTask( void *pvParameters )
{
/* Configure IO. */
IO0DIR |= mainLED_BIT;
IO0SET = mainLED_BIT;
for( ;; )
{
/* Not very exiting - just delay... */
vTaskDelay( xLED_Delay );
/* ...set the IO ... */
IO0CLR = mainLED_BIT;
/* ...delay again... */
vTaskDelay( xLED_Delay );
/* ...then clear the IO. */
IO0SET = mainLED_BIT;
}
}
/*-----------------------------------------------------------*/
static void vCheckTask( void *pvParameters )
{
portBASE_TYPE xErrorOccurred = pdFALSE;
portTickType xLastExecutionTime;
const portCHAR * const pcPassMessage = "PASS\n";
const portCHAR * const pcFailMessage = "FAIL\n";
/* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
works correctly. */
xLastExecutionTime = xTaskGetTickCount();
for( ;; )
{
/* Perform this check every mainCHECK_DELAY milliseconds. */
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_DELAY );
/* Has an error been found in any task? */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
#if configUSE_PREEMPTION == 1
{
/* The timing of console output when not using the preemptive
scheduler causes the block time tests to detect a timing problem. */
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
}
#endif
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
/* Send either a pass or fail message. If an error is found it is
never cleared again. */
if( xErrorOccurred == pdTRUE )
{
xLED_Delay = mainERROR_LED_DELAY;
xQueueSend( xPrintQueue, &pcFailMessage, portMAX_DELAY );
}
else
{
xQueueSend( xPrintQueue, &pcPassMessage, portMAX_DELAY );
}
}
}
/*-----------------------------------------------------------*/
static void vPrintTask( void *pvParameters )
{
portCHAR *pcMessage;
for( ;; )
{
/* Wait for a message to arrive. */
while( xQueueReceive( xPrintQueue, &pcMessage, portMAX_DELAY ) != pdPASS );
/* Write the message to the terminal IO. */
#ifndef NDEBUG
debug_printf( "%s", pcMessage );
#endif
}
}
/*-----------------------------------------------------------*/
static void vButtonHandlerTask( void *pvParameters )
{
static portCHAR cListBuffer[ mainLIST_BUFFER_SIZE ];
const portCHAR *pcList = &( cListBuffer[ 0 ] );
const portCHAR * const pcHeader = "\nTask State Priority Stack #\n************************************************";
extern void (vButtonISRWrapper) ( void );
/* Configure the interrupt. */
portENTER_CRITICAL();
{
/* Configure P0.14 to generate interrupts. */
PINSEL0 |= mainP0_14__EINT_1;
EXTMODE = mainEINT_1_EDGE_SENSITIVE;
EXTPOLAR = mainEINT_1_FALLING_EDGE_SENSITIVE;
/* Setup the VIC for EINT 1. */
VICIntSelect &= ~mainEINT_1_VIC_CHANNEL_BIT;
VICIntEnable |= mainEINT_1_VIC_CHANNEL_BIT;
VICVectAddr1 = ( portLONG ) vButtonISRWrapper;
VICVectCntl1 = mainEINT_1_ENABLE_BIT | mainEINT_1_CHANNEL;
}
portEXIT_CRITICAL();
for( ;; )
{
/* For debouncing, wait a while then clear the semaphore. */
vTaskDelay( mainSHORT_DELAY );
xSemaphoreTake( xButtonSemaphore, mainNO_DELAY );
/* Wait for an interrupt. */
xSemaphoreTake( xButtonSemaphore, portMAX_DELAY );
/* Send the column headers to the print task for display. */
xQueueSend( xPrintQueue, &pcHeader, portMAX_DELAY );
/* Create the list of task states. */
vTaskList( cListBuffer );
/* Send the task status information to the print task for display. */
xQueueSend( xPrintQueue, &pcList, portMAX_DELAY );
}
}
/*-----------------------------------------------------------*/

View File

@@ -1,97 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#include "FreeRTOS.h"
#include "semphr.h"
#define isrCLEAR_EINT_1 2
/*
* Interrupt routine that simply wakes vButtonHandlerTask on each interrupt
* generated by a push of the built in button. The wrapper takes care of
* the ISR entry. This then calls the actual handler function to perform
* the work. This work should not be done in the wrapper itself unless
* you are absolutely sure that no stack space is used.
*/
void vButtonISRWrapper( void ) __attribute__ ((naked));
void vButtonHandler( void );
void vButtonHandler( void )
{
extern xSemaphoreHandle xButtonSemaphore;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
if( xHigherPriorityTaskWoken )
{
/* We have woken a task. Calling "yield from ISR" here will ensure
the interrupt returns to the woken task if it has a priority higher
than the interrupted task. */
portYIELD_FROM_ISR();
}
EXTINT = isrCLEAR_EINT_1;
VICVectAddr = 0;
}
/*-----------------------------------------------------------*/
void vButtonISRWrapper( void )
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler to do the work. This must be a separate function to
the wrapper to ensure the correct stack frame is set up. */
vButtonHandler();
/* Restore the context of whichever task is going to run once the interrupt
completes. */
portRESTORE_CONTEXT();
}

View File

@@ -1,136 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <stdio.h>
#include "lpc23xx.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.
*----------------------------------------------------------*/
/* Value to use on old rev '-' devices. */
//#define configPINSEL2_VALUE 0x50151105
/* Value to use on rev 'A' and newer devices. */
//#define configPINSEL2_VALUE 0x50150105
#ifndef configPINSEL2_VALUE
#error Please uncomment one of the two configPINSEL2_VALUE definitions above, depending on the revision of the LPC2000 device being used.
#endif
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 1
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 48000000 ) /* =12Mhz xtal multiplied by 5 using the PLL. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 104 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_xTaskGetCurrentTaskHandle 1
#endif /* FREERTOS_CONFIG_H */
#ifndef sbi
#define sbi(x,y) x|=(1 << (y))
#endif
#ifndef cbi
#define cbi(x,y) x&=~(1 << (y))
#endif
#ifndef tstb
#define tstb(x,y) (x & (1 << (y)) ? 1 : 0)
#endif
#ifndef toggle
#define toggle(x,y) x^=(1 << (y))
#endif
#ifndef BIT
#define BIT(x) (1 << (x))
typedef struct
{
long xColumn;
char *pcMessage;
} xLCDMessage;
#endif

View File

@@ -1,145 +0,0 @@
#/*
# FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
#
# 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 exception 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.
# Alternative commercial license and support terms are also available upon
# request. See the licensing section of http://www.FreeRTOS.org for full
# license details.
#
# 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. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
# Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#
#
# ***************************************************************************
# * *
# * Looking for a quick start? Then check out the FreeRTOS eBook! *
# * See http://www.FreeRTOS.org/Documentation for details *
# * *
# ***************************************************************************
#
# 1 tab == 4 spaces!
#
# Please ensure to read the configuration and relevant port sections of the
# online documentation.
#
# http://www.FreeRTOS.org - Documentation, latest information, license and
# contact details.
#
# http://www.SafeRTOS.com - A version that is certified for use in safety
# critical systems.
#
# http://www.OpenRTOS.com - Commercial support, development, porting,
# licensing and training services.
#*/
RTOS_SOURCE_DIR=../../../Source
DEMO_COMMON_DIR=../../Common/Minimal
DEMO_INCLUDE_DIR=../../Common/include
UIP_COMMON_DIR=../../Common/ethernet/uIP/uip-1.0/uip
CC=arm-elf-gcc
OBJCOPY=arm-elf-objcopy
LDSCRIPT=lpc2368.ld
LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
DEBUG=-g
OPTIM=-O1
CFLAGS= $(DEBUG) \
$(OPTIM) \
-T$(LDSCRIPT) \
-I . \
-I $(RTOS_SOURCE_DIR)/include \
-I $(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC23xx \
-I $(DEMO_INCLUDE_DIR) \
-I ./webserver \
-I $(UIP_COMMON_DIR) \
-D ROWLEY_LPC23xx \
-D THUMB_INTERWORK \
-mcpu=arm7tdmi \
-D PACK_STRUCT_END=__attribute\(\(packed\)\) \
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) \
-fomit-frame-pointer \
-mthumb-interwork
THUMB_SOURCE= \
main.c \
./ParTest/ParTest.c \
./LCD/portlcd.c \
$(DEMO_COMMON_DIR)/BlockQ.c \
$(DEMO_COMMON_DIR)/blocktim.c \
$(DEMO_COMMON_DIR)/flash.c \
$(DEMO_COMMON_DIR)/integer.c \
$(DEMO_COMMON_DIR)/GenQTest.c \
$(DEMO_COMMON_DIR)/QPeek.c \
$(DEMO_COMMON_DIR)/dynamic.c \
./webserver/uIP_Task.c \
./webserver/emac.c \
./webserver/httpd.c \
./webserver/httpd-cgi.c \
./webserver/httpd-fs.c \
./webserver/http-strings.c \
$(UIP_COMMON_DIR)/uip_arp.c \
$(UIP_COMMON_DIR)/psock.c \
$(UIP_COMMON_DIR)/timer.c \
$(UIP_COMMON_DIR)/uip.c \
$(RTOS_SOURCE_DIR)/list.c \
$(RTOS_SOURCE_DIR)/queue.c \
$(RTOS_SOURCE_DIR)/tasks.c \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC23xx/port.c \
$(RTOS_SOURCE_DIR)/portable/MemMang/heap_2.c
ARM_SOURCE= \
$(RTOS_SOURCE_DIR)/portable/GCC/ARM7_LPC23xx/portISR.c \
./webserver/EMAC_ISR.c
THUMB_OBJS = $(THUMB_SOURCE:.c=.o)
ARM_OBJS = $(ARM_SOURCE:.c=.o)
all: RTOSDemo.bin
RTOSDemo.bin : RTOSDemo.hex
$(OBJCOPY) RTOSDemo.elf -O binary RTOSDemo.bin
RTOSDemo.hex : RTOSDemo.elf
$(OBJCOPY) RTOSDemo.elf -O ihex RTOSDemo.hex
RTOSDemo.elf : $(THUMB_OBJS) $(ARM_OBJS) boot.s Makefile
$(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) boot.s $(LINKER_FLAGS)
$(THUMB_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) -mthumb $< -o $@
$(ARM_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) $< -o $@
clean :
rm $(THUMB_OBJS)
rm $(ARM_OBJS)
touch Makefile
rm RTOSDemo.elf
rm RTOSDemo.hex

View File

@@ -1,129 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* FreeRTOS.org includes. */
#include "FreeRTOS.h"
/* Demo application includes. */
#include "partest.h"
#define partstFIRST_IO ( ( unsigned portLONG ) 0x01 )
#define partstNUM_LEDS ( 8 )
#define partstALL_OUTPUTS_OFF ( ( unsigned portLONG ) 0xff )
/*-----------------------------------------------------------
* Simple parallel port IO routines.
*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
PINSEL10 = 0;
FIO2DIR = 0x000000FF;
FIO2MASK = 0x00000000;
FIO2CLR = 0xFF;
SCS |= (1<<0); //fast mode for port 0 and 1
FIO2CLR = partstALL_OUTPUTS_OFF;
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned portLONG ulLED = partstFIRST_IO;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port */
ulLED <<= ( unsigned portLONG ) uxLED;
/* Set of clear the output. */
if( xValue )
{
FIO2CLR = ulLED;
}
else
{
FIO2SET = ulLED;
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 0. Only P10 to P13 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* If this bit is already set, clear it, and visa versa. */
ulCurrentState = FIO2PIN;
if( ulCurrentState & ulLED )
{
FIO2CLR = ulLED;
}
else
{
FIO2SET = ulLED;
}
}
}
/*-----------------------------------------------------------*/
unsigned portBASE_TYPE uxParTextGetLED( unsigned portBASE_TYPE uxLED )
{
unsigned portLONG ulLED = partstFIRST_IO;
ulLED <<= ( unsigned portLONG ) uxLED;
return ( FIO2PIN & ulLED );
}

View File

@@ -1,304 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the standard demo application tasks.
* In addition to the standard demo tasks, the following tasks and tests are
* defined and/or created within this file:
*
* "LCD" task - the LCD task is a 'gatekeeper' task. It is the only task that
* is permitted to access the display directly. Other tasks wishing to write a
* message to the LCD send the message on a queue to the LCD task instead of
* accessing the LCD themselves. The LCD task just blocks on the queue waiting
* for messages - waking and displaying the messages as they arrive.
*
* "Check" hook - This only executes every five seconds from the tick hook.
* Its main function is to check that all the standard demo tasks are still
* operational. Should any unexpected behaviour within a demo task be discovered
* the tick hook will write an error to the LCD (via the LCD task). If all the
* demo tasks are executing with their expected behaviour then the check task
* writes PASS to the LCD (again via the LCD task), as described above.
*
* "uIP" task - This is the task that handles the uIP stack. All TCP/IP
* processing is performed in this task.
*/
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
/* Demo app includes. */
#include "BlockQ.h"
#include "death.h"
#include "blocktim.h"
#include "LCD/portlcd.h"
#include "flash.h"
#include "partest.h"
#include "GenQTest.h"
#include "QPeek.h"
#include "dynamic.h"
/* Demo application definitions. */
#define mainQUEUE_SIZE ( 3 )
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
#define mainBASIC_WEB_STACK_SIZE ( configMINIMAL_STACK_SIZE * 6 )
/* Task priorities. */
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainFLASH_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
/* Constants to setup the PLL. */
#define mainPLL_MUL ( ( unsigned portLONG ) ( 8 - 1 ) )
#define mainPLL_DIV ( ( unsigned portLONG ) 0x0000 )
#define mainCPU_CLK_DIV ( ( unsigned portLONG ) 0x0003 )
#define mainPLL_ENABLE ( ( unsigned portLONG ) 0x0001 )
#define mainPLL_CONNECT ( ( ( unsigned portLONG ) 0x0002 ) | mainPLL_ENABLE )
#define mainPLL_FEED_BYTE1 ( ( unsigned portLONG ) 0xaa )
#define mainPLL_FEED_BYTE2 ( ( unsigned portLONG ) 0x55 )
#define mainPLL_LOCK ( ( unsigned portLONG ) 0x4000000 )
#define mainPLL_CONNECTED ( ( unsigned portLONG ) 0x2000000 )
#define mainOSC_ENABLE ( ( unsigned portLONG ) 0x20 )
#define mainOSC_STAT ( ( unsigned portLONG ) 0x40 )
#define mainOSC_SELECT ( ( unsigned portLONG ) 0x01 )
/* Constants to setup the MAM. */
#define mainMAM_TIM_3 ( ( unsigned portCHAR ) 0x03 )
#define mainMAM_MODE_FULL ( ( unsigned portCHAR ) 0x02 )
/*
* The task that handles the uIP stack. All TCP/IP processing is performed in
* this task.
*/
extern void vuIP_Task( void *pvParameters );
/*
* The LCD is written two by more than one task so is controlled by a
* 'gatekeeper' task. This is the only task that is actually permitted to
* access the LCD directly. Other tasks wanting to display a message send
* the message to the gatekeeper.
*/
static void vLCDTask( void *pvParameters );
/* Configure the hardware as required by the demo. */
static void prvSetupHardware( void );
/* The queue used to send messages to the LCD task. */
xQueueHandle xLCDQueue;
/*-----------------------------------------------------------*/
int main( void )
{
prvSetupHardware();
/* Create the queue used by the LCD task. Messages for display on the LCD
are received via this queue. */
xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );
/* Create the uIP task. This uses the lwIP RTOS abstraction layer.*/
xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
/* Start the standard demo tasks. */
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vCreateBlockTimeTasks();
vStartLEDFlashTasks( mainFLASH_PRIORITY );
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
vStartQueuePeekTasks();
vStartDynamicPriorityTasks();
/* Start the tasks defined within this file/specific to this demo. */
xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
/* Start the scheduler. */
vTaskStartScheduler();
/* Will only get here if there was insufficient memory to create the idle
task. */
return 0;
}
/*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
unsigned portBASE_TYPE uxColumn = 0;
static xLCDMessage xMessage = { 0, "PASS" };
static unsigned portLONG ulTicksSinceLastDisplay = 0;
static portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Called from every tick interrupt. Have enough ticks passed to make it
time to perform our health status check again? */
ulTicksSinceLastDisplay++;
if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )
{
ulTicksSinceLastDisplay = 0;
/* Has an error been found in any task? */
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR - BLOCKQ";
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR - BLOCKTIM";
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR - GENQ";
}
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR - PEEKQ";
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR - DYNAMIC";
}
xMessage.xColumn++;
/* Send the message to the LCD gatekeeper for display. */
xHigherPriorityTaskWoken = pdFALSE;
xQueueSendToBackFromISR( xLCDQueue, &xMessage, &xHigherPriorityTaskWoken );
}
}
/*-----------------------------------------------------------*/
void vLCDTask( void *pvParameters )
{
xLCDMessage xMessage;
/* Initialise the LCD and display a startup message. */
LCD_init();
LCD_cur_off();
LCD_cls();
LCD_gotoxy( 1, 1 );
LCD_puts( "www.FreeRTOS.org" );
for( ;; )
{
/* Wait for a message to arrive that requires displaying. */
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
/* Display the message. Print each message to a different position. */
LCD_cls();
LCD_gotoxy( ( xMessage.xColumn & 0x07 ) + 1, ( xMessage.xColumn & 0x01 ) + 1 );
LCD_puts( xMessage.pcMessage );
}
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
#ifdef RUN_FROM_RAM
/* Remap the interrupt vectors to RAM if we are are running from RAM. */
SCB_MEMMAP = 2;
#endif
/* Disable the PLL. */
PLLCON = 0;
PLLFEED = mainPLL_FEED_BYTE1;
PLLFEED = mainPLL_FEED_BYTE2;
/* Configure clock source. */
SCS |= mainOSC_ENABLE;
while( !( SCS & mainOSC_STAT ) );
CLKSRCSEL = mainOSC_SELECT;
/* Setup the PLL to multiply the XTAL input by 4. */
PLLCFG = ( mainPLL_MUL | mainPLL_DIV );
PLLFEED = mainPLL_FEED_BYTE1;
PLLFEED = mainPLL_FEED_BYTE2;
/* Turn on and wait for the PLL to lock... */
PLLCON = mainPLL_ENABLE;
PLLFEED = mainPLL_FEED_BYTE1;
PLLFEED = mainPLL_FEED_BYTE2;
CCLKCFG = mainCPU_CLK_DIV;
while( !( PLLSTAT & mainPLL_LOCK ) );
/* Connecting the clock. */
PLLCON = mainPLL_CONNECT;
PLLFEED = mainPLL_FEED_BYTE1;
PLLFEED = mainPLL_FEED_BYTE2;
while( !( PLLSTAT & mainPLL_CONNECTED ) );
/*
This code is commented out as the MAM does not work on the original revision
LPC2368 chips. If using Rev B chips then you can increase the speed though
the use of the MAM.
Setup and turn on the MAM. Three cycle access is used due to the fast
PLL used. It is possible faster overall performance could be obtained by
tuning the MAM and PLL settings.
MAMCR = 0;
MAMTIM = mainMAM_TIM_3;
MAMCR = mainMAM_MODE_FULL;
*/
/* Setup the led's on the MCB2300 board */
vParTestInitialise();
}

View File

@@ -1,45 +0,0 @@
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
/* The handler that does the actual work. */
void vEMAC_ISR_Handler( void );
extern xSemaphoreHandle xEMACSemaphore;
void vEMAC_ISR_Handler( void )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Clear the interrupt. */
MAC_INTCLEAR = 0xffff;
VICVectAddr = 0;
/* Ensure the uIP task is not blocked as data has arrived. */
xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken );
if( xHigherPriorityTaskWoken )
{
/* Giving the semaphore woke a task. */
portYIELD_FROM_ISR();
}
}
/*-----------------------------------------------------------*/
void vEMAC_ISR_Wrapper( void )
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler. This must be a separate function unless you can
guarantee that no stack will be used. */
vEMAC_ISR_Handler();
/* Restore the context of whichever task is going to run next. */
portRESTORE_CONTEXT();
}

View File

@@ -1,411 +0,0 @@
/******************************************************************
***** *****
***** Name: cs8900.c *****
***** Ver.: 1.0 *****
***** Date: 07/05/2001 *****
***** Auth: Andreas Dannenberg *****
***** HTWK Leipzig *****
***** university of applied sciences *****
***** Germany *****
***** Func: ethernet packet-driver for use with LAN- *****
***** controller CS8900 from Crystal/Cirrus Logic *****
***** *****
***** Keil: Module modified for use with Philips *****
***** LPC2378 EMAC Ethernet controller *****
***** *****
******************************************************************/
/* Adapted from file originally written by Andreas Dannenberg. Supplied with permission. */
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
#include "emac.h"
/* The semaphore used to wake the uIP task when data arives. */
xSemaphoreHandle xEMACSemaphore = NULL;
static unsigned short *rptr;
static unsigned short *tptr;
// easyWEB internal function
// help function to swap the byte order of a WORD
static unsigned short SwapBytes(unsigned short Data)
{
return (Data >> 8) | (Data << 8);
}
// Keil: function added to write PHY
void write_PHY (int PhyReg, int Value)
{
unsigned int tout;
MAC_MADR = DP83848C_DEF_ADR | PhyReg;
MAC_MWTD = Value;
/* Wait utill operation completed */
tout = 0;
for (tout = 0; tout < MII_WR_TOUT; tout++) {
if ((MAC_MIND & MIND_BUSY) == 0) {
break;
}
}
}
// Keil: function added to read PHY
unsigned short read_PHY (unsigned char PhyReg)
{
unsigned int tout;
MAC_MADR = DP83848C_DEF_ADR | PhyReg;
MAC_MCMD = MCMD_READ;
/* Wait until operation completed */
tout = 0;
for (tout = 0; tout < MII_RD_TOUT; tout++) {
if ((MAC_MIND & MIND_BUSY) == 0) {
break;
}
}
MAC_MCMD = 0;
return (MAC_MRDD);
}
// Keil: function added to initialize Rx Descriptors
void rx_descr_init (void)
{
unsigned int i;
for (i = 0; i < NUM_RX_FRAG; i++) {
RX_DESC_PACKET(i) = RX_BUF(i);
RX_DESC_CTRL(i) = RCTRL_INT | (ETH_FRAG_SIZE-1);
RX_STAT_INFO(i) = 0;
RX_STAT_HASHCRC(i) = 0;
}
/* Set EMAC Receive Descriptor Registers. */
MAC_RXDESCRIPTOR = RX_DESC_BASE;
MAC_RXSTATUS = RX_STAT_BASE;
MAC_RXDESCRIPTORNUM = NUM_RX_FRAG-1;
/* Rx Descriptors Point to 0 */
MAC_RXCONSUMEINDEX = 0;
}
// Keil: function added to initialize Tx Descriptors
void tx_descr_init (void) {
unsigned int i;
for (i = 0; i < NUM_TX_FRAG; i++) {
TX_DESC_PACKET(i) = TX_BUF(i);
TX_DESC_CTRL(i) = 0;
TX_STAT_INFO(i) = 0;
}
/* Set EMAC Transmit Descriptor Registers. */
MAC_TXDESCRIPTOR = TX_DESC_BASE;
MAC_TXSTATUS = TX_STAT_BASE;
MAC_TXDESCRIPTORNUM = NUM_TX_FRAG-1;
/* Tx Descriptors Point to 0 */
MAC_TXPRODUCEINDEX = 0;
}
// configure port-pins for use with LAN-controller,
// reset it and send the configuration-sequence
portBASE_TYPE Init_EMAC(void)
{
portBASE_TYPE xReturn = pdPASS;
// Keil: function modified to access the EMAC
// Initializes the EMAC ethernet controller
volatile unsigned int regv,tout,id1,id2;
/* Enable P1 Ethernet Pins. */
PINSEL2 = configPINSEL2_VALUE;
PINSEL3 = (PINSEL3 & ~0x0000000F) | 0x00000005;
/* Power Up the EMAC controller. */
PCONP |= 0x40000000;
vTaskDelay( 1 );
/* Reset all EMAC internal modules. */
MAC_MAC1 = MAC1_RES_TX | MAC1_RES_MCS_TX | MAC1_RES_RX | MAC1_RES_MCS_RX | MAC1_SIM_RES | MAC1_SOFT_RES;
MAC_COMMAND = CR_REG_RES | CR_TX_RES | CR_RX_RES;
/* A short delay after reset. */
vTaskDelay( 1 );
/* Initialize MAC control registers. */
MAC_MAC1 = MAC1_PASS_ALL;
MAC_MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;
MAC_MAXF = ETH_MAX_FLEN;
MAC_CLRT = CLRT_DEF;
MAC_IPGR = IPGR_DEF;
/* Enable Reduced MII interface. */
MAC_COMMAND = CR_RMII | CR_PASS_RUNT_FRM;
/* Reset Reduced MII Logic. */
MAC_SUPP = SUPP_RES_RMII;
MAC_SUPP = 0;
/* Put the DP83848C in reset mode */
write_PHY (PHY_REG_BMCR, 0x8000);
write_PHY (PHY_REG_BMCR, 0x8000);
/* Wait for hardware reset to end. */
for (tout = 0; tout < 100; tout++) {
vTaskDelay( 10 );
regv = read_PHY (PHY_REG_BMCR);
if (!(regv & 0x8000)) {
/* Reset complete */
break;
}
}
/* Check if this is a DP83848C PHY. */
id1 = read_PHY (PHY_REG_IDR1);
id2 = read_PHY (PHY_REG_IDR2);
if (((id1 << 16) | (id2 & 0xFFF0)) == DP83848C_ID) {
/* Configure the PHY device */
/* Use autonegotiation about the link speed. */
write_PHY (PHY_REG_BMCR, PHY_AUTO_NEG);
/* Wait to complete Auto_Negotiation. */
for (tout = 0; tout < 10; tout++) {
vTaskDelay( 100 );
regv = read_PHY (PHY_REG_BMSR);
if (regv & 0x0020) {
/* Autonegotiation Complete. */
break;
}
}
}
else
{
xReturn = pdFAIL;
}
/* Check the link status. */
if( xReturn == pdPASS )
{
xReturn = pdFAIL;
for (tout = 0; tout < 10; tout++) {
vTaskDelay( 100 );
regv = read_PHY (PHY_REG_STS);
if (regv & 0x0001) {
/* Link is on. */
xReturn = pdPASS;
break;
}
}
}
if( xReturn == pdPASS )
{
/* Configure Full/Half Duplex mode. */
if (regv & 0x0004) {
/* Full duplex is enabled. */
MAC_MAC2 |= MAC2_FULL_DUP;
MAC_COMMAND |= CR_FULL_DUP;
MAC_IPGT = IPGT_FULL_DUP;
}
else {
/* Half duplex mode. */
MAC_IPGT = IPGT_HALF_DUP;
}
/* Configure 100MBit/10MBit mode. */
if (regv & 0x0002) {
/* 10MBit mode. */
MAC_SUPP = 0;
}
else {
/* 100MBit mode. */
MAC_SUPP = SUPP_SPEED;
}
/* Set the Ethernet MAC Address registers */
MAC_SA0 = (emacETHADDR0 << 8) | emacETHADDR1;
MAC_SA1 = (emacETHADDR2 << 8) | emacETHADDR3;
MAC_SA2 = (emacETHADDR4 << 8) | emacETHADDR5;
/* Initialize Tx and Rx DMA Descriptors */
rx_descr_init ();
tx_descr_init ();
/* Receive Broadcast and Perfect Match Packets */
MAC_RXFILTERCTRL = RFC_UCAST_EN | RFC_BCAST_EN | RFC_PERFECT_EN;
/* Create the semaphore used ot wake the uIP task. */
vSemaphoreCreateBinary( xEMACSemaphore );
/* Reset all interrupts */
MAC_INTCLEAR = 0xFFFF;
/* Enable receive and transmit mode of MAC Ethernet core */
MAC_COMMAND |= (CR_RX_EN | CR_TX_EN);
MAC_MAC1 |= MAC1_REC_EN;
}
return xReturn;
}
// reads a word in little-endian byte order from RX_BUFFER
unsigned short ReadFrame_EMAC(void)
{
return (*rptr++);
}
// reads a word in big-endian byte order from RX_FRAME_PORT
// (useful to avoid permanent byte-swapping while reading
// TCP/IP-data)
unsigned short ReadFrameBE_EMAC(void)
{
unsigned short ReturnValue;
ReturnValue = SwapBytes (*rptr++);
return (ReturnValue);
}
// copies bytes from frame port to MCU-memory
// NOTES: * an odd number of byte may only be transfered
// if the frame is read to the end!
// * MCU-memory MUST start at word-boundary
void CopyFromFrame_EMAC(void *Dest, unsigned short Size)
{
unsigned short * piDest; // Keil: Pointer added to correct expression
piDest = Dest; // Keil: Line added
while (Size > 1) {
*piDest++ = ReadFrame_EMAC();
Size -= 2;
}
if (Size) { // check for leftover byte...
*(unsigned char *)piDest = (char)ReadFrame_EMAC();// the LAN-Controller will return 0
} // for the highbyte
}
// does a dummy read on frame-I/O-port
// NOTE: only an even number of bytes is read!
void DummyReadFrame_EMAC(unsigned short Size) // discards an EVEN number of bytes
{ // from RX-fifo
while (Size > 1) {
ReadFrame_EMAC();
Size -= 2;
}
}
// Reads the length of the received ethernet frame and checks if the
// destination address is a broadcast message or not
// returns the frame length
unsigned short StartReadFrame(void) {
unsigned short RxLen;
unsigned int idx;
idx = MAC_RXCONSUMEINDEX;
RxLen = (RX_STAT_INFO(idx) & RINFO_SIZE) - 3;
rptr = (unsigned short *)RX_DESC_PACKET(idx);
return(RxLen);
}
void EndReadFrame(void) {
unsigned int idx;
/* DMA free packet. */
idx = MAC_RXCONSUMEINDEX;
if (++idx == NUM_RX_FRAG)
idx = 0;
MAC_RXCONSUMEINDEX = idx;
}
unsigned int CheckFrameReceived(void) { // Packet received ?
if (MAC_RXPRODUCEINDEX != MAC_RXCONSUMEINDEX) // more packets received ?
return(1);
else
return(0);
}
unsigned int uiGetEMACRxData( unsigned char *ucBuffer )
{
unsigned int uiLen = 0;
if( MAC_RXPRODUCEINDEX != MAC_RXCONSUMEINDEX )
{
uiLen = StartReadFrame();
CopyFromFrame_EMAC( ucBuffer, uiLen );
EndReadFrame();
}
return uiLen;
}
// requests space in EMAC memory for storing an outgoing frame
void RequestSend(void)
{
unsigned int idx;
idx = MAC_TXPRODUCEINDEX;
tptr = (unsigned short *)TX_DESC_PACKET(idx);
}
// check if ethernet controller is ready to accept the
// frame we want to send
unsigned int Rdy4Tx(void)
{
return (1); // the ethernet controller transmits much faster
} // than the CPU can load its buffers
// writes a word in little-endian byte order to TX_BUFFER
void WriteFrame_EMAC(unsigned short Data)
{
*tptr++ = Data;
}
// copies bytes from MCU-memory to frame port
// NOTES: * an odd number of byte may only be transfered
// if the frame is written to the end!
// * MCU-memory MUST start at word-boundary
void CopyToFrame_EMAC(void *Source, unsigned int Size)
{
unsigned short * piSource;
piSource = Source;
Size = (Size + 1) & 0xFFFE; // round Size up to next even number
while (Size > 0) {
WriteFrame_EMAC(*piSource++);
Size -= 2;
}
}
void DoSend_EMAC(unsigned short FrameSize)
{
unsigned int idx;
idx = MAC_TXPRODUCEINDEX;
TX_DESC_CTRL(idx) = FrameSize | TCTRL_LAST;
if (++idx == NUM_TX_FRAG) idx = 0;
MAC_TXPRODUCEINDEX = idx;
}

View File

@@ -1,276 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* Web server script interface
* \author
* Adam Dunkels <adam@sics.se>
*
*/
/*
* Copyright (c) 2001-2006, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd-cgi.c,v 1.2 2006/06/11 21:46:37 adam Exp $
*
*/
#include "uip.h"
#include "psock.h"
#include "httpd.h"
#include "httpd-cgi.h"
#include "httpd-fs.h"
#include <stdio.h>
#include <string.h>
HTTPD_CGI_CALL(file, "file-stats", file_stats);
HTTPD_CGI_CALL(tcp, "tcp-connections", tcp_stats);
HTTPD_CGI_CALL(net, "net-stats", net_stats);
HTTPD_CGI_CALL(rtos, "rtos-stats", rtos_stats );
HTTPD_CGI_CALL(io, "led-io", led_io );
static const struct httpd_cgi_call *calls[] = { &file, &tcp, &net, &rtos, &io, NULL };
/*---------------------------------------------------------------------------*/
static
PT_THREAD(nullfunction(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
httpd_cgifunction
httpd_cgi(char *name)
{
const struct httpd_cgi_call **f;
/* Find the matching name in the table, return the function. */
for(f = calls; *f != NULL; ++f) {
if(strncmp((*f)->name, name, strlen((*f)->name)) == 0) {
return (*f)->function;
}
}
return nullfunction;
}
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
char *f = (char *)arg;
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u", httpd_fs_count(f));
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(file_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static const char closed[] = /* "CLOSED",*/
{0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0};
static const char syn_rcvd[] = /* "SYN-RCVD",*/
{0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56,
0x44, 0};
static const char syn_sent[] = /* "SYN-SENT",*/
{0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e,
0x54, 0};
static const char established[] = /* "ESTABLISHED",*/
{0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48,
0x45, 0x44, 0};
static const char fin_wait_1[] = /* "FIN-WAIT-1",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x31, 0};
static const char fin_wait_2[] = /* "FIN-WAIT-2",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x32, 0};
static const char closing[] = /* "CLOSING",*/
{0x43, 0x4c, 0x4f, 0x53, 0x49,
0x4e, 0x47, 0};
static const char time_wait[] = /* "TIME-WAIT,"*/
{0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41,
0x49, 0x54, 0};
static const char last_ack[] = /* "LAST-ACK"*/
{0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43,
0x4b, 0};
static const char *states[] = {
closed,
syn_rcvd,
syn_sent,
established,
fin_wait_1,
fin_wait_2,
closing,
time_wait,
last_ack};
static unsigned short
generate_tcp_stats(void *arg)
{
struct uip_conn *conn;
struct httpd_state *s = (struct httpd_state *)arg;
conn = &uip_conns[s->count];
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
"<tr><td>%d</td><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
htons(conn->lport),
htons(conn->ripaddr[0]) >> 8,
htons(conn->ripaddr[0]) & 0xff,
htons(conn->ripaddr[1]) >> 8,
htons(conn->ripaddr[1]) & 0xff,
htons(conn->rport),
states[conn->tcpstateflags & UIP_TS_MASK],
conn->nrtx,
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' ');
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {
if((uip_conns[s->count].tcpstateflags & UIP_TS_MASK) != UIP_CLOSED) {
PSOCK_GENERATOR_SEND(&s->sout, generate_tcp_stats, s);
}
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static unsigned short
generate_net_stats(void *arg)
{
struct httpd_state *s = (struct httpd_state *)arg;
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
"%5u\n", ((uip_stats_t *)&uip_stat)[s->count]);
}
static
PT_THREAD(net_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
#if UIP_STATISTICS
for(s->count = 0; s->count < sizeof(uip_stat) / sizeof(uip_stats_t);
++s->count) {
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);
}
#endif /* UIP_STATISTICS */
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
extern void vTaskList( signed char *pcWriteBuffer );
static char cCountBuf[ 32 ];
long lRefreshCount = 0;
static unsigned short
generate_rtos_stats(void *arg)
{
lRefreshCount++;
sprintf( cCountBuf, "<p><br>Refresh count = %ld", lRefreshCount );
vTaskList( uip_appdata );
strcat( uip_appdata, cCountBuf );
return strlen( uip_appdata );
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(rtos_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
char *pcStatus[ 3 ];
unsigned long ulString;
extern unsigned long uxParTextGetLED( unsigned long uxLED );
static unsigned short generate_io_state( void *arg )
{
for( ulString = 0; ulString < 3; ulString++ )
{
if( uxParTextGetLED( ulString + 5 ) )
{
pcStatus[ ulString ] = "checked";
}
else
{
pcStatus[ ulString ] = "";
}
}
sprintf( uip_appdata,
"<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED 2.5,"\
"<input type=\"checkbox\" name=\"LED1\" value=\"1\" %s>LED 2.6,"\
"<input type=\"checkbox\" name=\"LED2\" value=\"1\" %s>LED 2.7"\
"<p>"\
"<input type=\"text\" name=\"LCD\" value=\"Enter LCD text\" size=\"16\">",
pcStatus[ 0 ],
pcStatus[ 1 ],
pcStatus[ 2 ] );
return strlen( uip_appdata );
}
static PT_THREAD(led_io(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_io_state, NULL);
PSOCK_END(&s->sout);
}
/** @} */

View File

@@ -1,333 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Standard includes. */
#include <string.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* uip includes. */
#include "uip.h"
#include "uip_arp.h"
#include "httpd.h"
#include "timer.h"
#include "clock-arch.h"
/* Demo includes. */
#include "emac.h"
#include "partest.h"
/*-----------------------------------------------------------*/
/* MAC address configuration. */
#define uipMAC_ADDR0 0x00
#define uipMAC_ADDR1 0x12
#define uipMAC_ADDR2 0x13
#define uipMAC_ADDR3 0x10
#define uipMAC_ADDR4 0x15
#define uipMAC_ADDR5 0x11
/* IP address configuration. */
#define uipIP_ADDR0 172
#define uipIP_ADDR1 25
#define uipIP_ADDR2 218
#define uipIP_ADDR3 16
/* How long to wait before attempting to connect the MAC again. */
#define uipINIT_WAIT 100
/* Shortcut to the header within the Rx buffer. */
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
/* Standard constant. */
#define uipTOTAL_FRAME_HEADER_SIZE 54
/*-----------------------------------------------------------*/
/*
* Send the uIP buffer to the MAC.
*/
static void prvENET_Send(void);
/*
* Setup the MAC address in the MAC itself, and in the uIP stack.
*/
static void prvSetMACAddress( void );
/*
* Port functions required by the uIP stack.
*/
void clock_init( void );
clock_time_t clock_time( void );
/*-----------------------------------------------------------*/
/* The semaphore used by the ISR to wake the uIP task. */
extern xSemaphoreHandle xEMACSemaphore;
/*-----------------------------------------------------------*/
void clock_init(void)
{
/* This is done when the scheduler starts. */
}
/*-----------------------------------------------------------*/
clock_time_t clock_time( void )
{
return xTaskGetTickCount();
}
/*-----------------------------------------------------------*/
void vuIP_Task( void *pvParameters )
{
portBASE_TYPE i;
uip_ipaddr_t xIPAddr;
struct timer periodic_timer, arp_timer;
extern void ( vEMAC_ISR_Wrapper )( void );
/* Create the semaphore used by the ISR to wake this task. */
vSemaphoreCreateBinary( xEMACSemaphore );
/* Initialise the uIP stack. */
timer_set( &periodic_timer, configTICK_RATE_HZ / 2 );
timer_set( &arp_timer, configTICK_RATE_HZ * 10 );
uip_init();
uip_ipaddr( xIPAddr, uipIP_ADDR0, uipIP_ADDR1, uipIP_ADDR2, uipIP_ADDR3 );
uip_sethostaddr( xIPAddr );
httpd_init();
/* Initialise the MAC. */
while( Init_EMAC() != pdPASS )
{
vTaskDelay( uipINIT_WAIT );
}
portENTER_CRITICAL();
{
MAC_INTENABLE = INT_RX_DONE;
VICIntEnable |= 0x00200000;
VICVectAddr21 = ( portLONG ) vEMAC_ISR_Wrapper;
prvSetMACAddress();
}
portEXIT_CRITICAL();
for( ;; )
{
/* Is there received data ready to be processed? */
uip_len = uiGetEMACRxData( uip_buf );
if( uip_len > 0 )
{
/* Standard uIP loop taken from the uIP manual. */
if( xHeader->type == htons( UIP_ETHTYPE_IP ) )
{
uip_arp_ipin();
uip_input();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
prvENET_Send();
}
}
else if( xHeader->type == htons( UIP_ETHTYPE_ARP ) )
{
uip_arp_arpin();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
prvENET_Send();
}
}
}
else
{
if( timer_expired( &periodic_timer ) )
{
timer_reset( &periodic_timer );
for( i = 0; i < UIP_CONNS; i++ )
{
uip_periodic( i );
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
prvENET_Send();
}
}
/* Call the ARP timer function every 10 seconds. */
if( timer_expired( &arp_timer ) )
{
timer_reset( &arp_timer );
uip_arp_timer();
}
}
else
{
/* We did not receive a packet, and there was no periodic
processing to perform. Block for a fixed period. If a packet
is received during this period we will be woken by the ISR
giving us the Semaphore. */
xSemaphoreTake( xEMACSemaphore, configTICK_RATE_HZ / 2 );
}
}
}
}
/*-----------------------------------------------------------*/
static void prvENET_Send(void)
{
RequestSend();
/* Copy the header into the Tx buffer. */
CopyToFrame_EMAC( uip_buf, uipTOTAL_FRAME_HEADER_SIZE );
if( uip_len > uipTOTAL_FRAME_HEADER_SIZE )
{
CopyToFrame_EMAC( uip_appdata, ( uip_len - uipTOTAL_FRAME_HEADER_SIZE ) );
}
DoSend_EMAC( uip_len );
}
/*-----------------------------------------------------------*/
static void prvSetMACAddress( void )
{
struct uip_eth_addr xAddr;
/* Configure the MAC address in the uIP stack. */
xAddr.addr[ 0 ] = uipMAC_ADDR0;
xAddr.addr[ 1 ] = uipMAC_ADDR1;
xAddr.addr[ 2 ] = uipMAC_ADDR2;
xAddr.addr[ 3 ] = uipMAC_ADDR3;
xAddr.addr[ 4 ] = uipMAC_ADDR4;
xAddr.addr[ 5 ] = uipMAC_ADDR5;
uip_setethaddr( xAddr );
}
/*-----------------------------------------------------------*/
void vApplicationProcessFormInput( portCHAR *pcInputString, portBASE_TYPE xInputLength )
{
char *c, *pcText;
static portCHAR cMessageForDisplay[ 32 ];
extern xQueueHandle xLCDQueue;
xLCDMessage xLCDMessage;
/* Process the form input sent by the IO page of the served HTML. */
c = strstr( pcInputString, "?" );
if( c )
{
/* Turn LED's on or off in accordance with the check box status. */
if( strstr( c, "LED0=1" ) != NULL )
{
vParTestSetLED( 5, 0 );
}
else
{
vParTestSetLED( 5, 1 );
}
if( strstr( c, "LED1=1" ) != NULL )
{
vParTestSetLED( 6, 0 );
}
else
{
vParTestSetLED( 6, 1 );
}
if( strstr( c, "LED2=1" ) != NULL )
{
vParTestSetLED( 7, 0 );
}
else
{
vParTestSetLED( 7, 1 );
}
/* Find the start of the text to be displayed on the LCD. */
pcText = strstr( c, "LCD=" );
pcText += strlen( "LCD=" );
/* Terminate the file name for further processing within uIP. */
*c = 0x00;
/* Terminate the LCD string. */
c = strstr( pcText, " " );
if( c != NULL )
{
*c = 0x00;
}
/* Add required spaces. */
while( ( c = strstr( pcText, "+" ) ) != NULL )
{
*c = ' ';
}
/* Write the message to the LCD. */
strcpy( cMessageForDisplay, pcText );
xLCDMessage.xColumn = 0;
xLCDMessage.pcMessage = cMessageForDisplay;
xQueueSend( xLCDQueue, &xLCDMessage, portMAX_DELAY );
}
}

View File

@@ -1,140 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <stdio.h>
#include <targets/LPC2368.h>
#define vPortYieldProcessor swi_handler
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
/* Value to use on old rev '-' devices. */
//#define configPINSEL2_VALUE 0x50151105
/* Value to use on rev 'A' and newer devices. */
//#define configPINSEL2_VALUE 0x50150105
#ifndef configPINSEL2_VALUE
#error Please uncomment one of the two configPINSEL2_VALUE definitions above, depending on the revision of the LPC2000 device being used.
#endif
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 57600000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 120 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_xTaskGetCurrentTaskHandle 1
#endif /* FREERTOS_CONFIG_H */
#ifndef sbi
#define sbi(x,y) x|=(1 << (y))
#endif
#ifndef cbi
#define cbi(x,y) x&=~(1 << (y))
#endif
#ifndef tstb
#define tstb(x,y) (x & (1 << (y)) ? 1 : 0)
#endif
#ifndef toggle
#define toggle(x,y) x^=(1 << (y))
#endif
#ifndef BIT
#define BIT(x) (1 << (x))
#define VICVectAddr VICAddress
#define VICVectCntl4 VICVectPriority4
typedef struct
{
long xColumn;
signed char *pcMessage;
} xLCDMessage;
#endif

View File

@@ -1,129 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* FreeRTOS.org includes. */
#include "FreeRTOS.h"
/* Demo application includes. */
#include "partest.h"
#define partstFIRST_IO ( ( unsigned portLONG ) 0x01 )
#define partstNUM_LEDS ( 8 )
#define partstALL_OUTPUTS_OFF ( ( unsigned portLONG ) 0xff )
/*-----------------------------------------------------------
* Simple parallel port IO routines.
*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
PINSEL10 = 0;
FIO2DIR = 0x000000FF;
FIO2MASK = 0x00000000;
FIO2CLR = 0xFF;
SCS |= (1<<0); //fast mode for port 0 and 1
FIO2CLR = partstALL_OUTPUTS_OFF;
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned portLONG ulLED = partstFIRST_IO;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port */
ulLED <<= ( unsigned portLONG ) uxLED;
/* Set of clear the output. */
if( xValue )
{
FIO2CLR = ulLED;
}
else
{
FIO2SET = ulLED;
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState;
if( uxLED < partstNUM_LEDS )
{
/* Rotate to the wanted bit of port 0. Only P10 to P13 have an LED
attached. */
ulLED <<= ( unsigned portLONG ) uxLED;
/* If this bit is already set, clear it, and visa versa. */
ulCurrentState = FIO2PIN;
if( ulCurrentState & ulLED )
{
FIO2CLR = ulLED;
}
else
{
FIO2SET = ulLED;
}
}
}
/*-----------------------------------------------------------*/
unsigned portBASE_TYPE uxParTextGetLED( unsigned portBASE_TYPE uxLED )
{
unsigned portLONG ulLED = partstFIRST_IO;
ulLED <<= ( unsigned portLONG ) uxLED;
return ( FIO2PIN & ulLED );
}

View File

@@ -1,103 +0,0 @@
<!DOCTYPE CrossStudio_Project_File>
<solution version="1" Name="RTOSDemo" >
<project Name="RTOSDemo" >
<configuration arm_target_loader_parameter="12000000" Target="LPC2368" arm_target_flash_loader_file_path="$(StudioDir)/targets/Philips_LPC210X/Release/Loader_lpc2300.elf" arm_simulator_memory_simulation_parameter="LPC23;0x80000;0x8000;0x10000;0x10000" property_groups_file_path="$(StudioDir)/targets/Philips_LPC210X/propertyGroups23xx.xml" oscillator_frequency="12MHz" linker_memory_map_file="$(StudioDir)/targets/Philips_LPC210X/Philips_LPC2368_MemoryMap.xml" gcc_entry_point="reset_handler" build_remove_unused_symbols="No" c_preprocessor_definitions="GCC_ARM7;SUPERVISOR_START;VECTORED_IRQ_INTERRUPTS;PACK_STRUCT_END=__attribute__((packed));ALIGN_STRUCT_END=__attribute__((aligned(4)))" arm_architecture="v4T" linker_additional_files="$(StudioDir)/lib/liblpc2000$(LibExt)$(LIB)" c_user_include_directories=".;$(ProjectDir)\\..\\..\\Source\\include;$(ProjectDir)\\..\\..\\Source\\GCC\\ARM7_LPC2000;$(ProjectDir)\\..\\Common\\Include;$(ProjectDir)\\LCD;$(ProjectDir)\\webserver;$(ProjectDir)\\..\\Common\\ethernet\\uIP\\uip-1.0\\uip" project_directory="" link_include_startup_code="No" gcc_optimization_level="Level 1" arm_target_flash_loader_type="LIBMEM RPC Loader" project_type="Executable" c_additional_options="" linker_printf_fmt_level="long" arm_linker_stack_size="10" Name="Common" c_system_include_directories="$(StudioDir)\include" arm_target_debug_interface_type="ARM7TDI" arm_core_type="ARM7TDMI-S" arm_simulator_memory_simulation_filename="$(StudioDir)/targets/Philips_LPC210X/LPC2000SimulatorMemory.dll" arm_linker_svc_stack_size="1024" />
<configuration linker_section_placement_file="$(StudioDir)/targets/sram_placement.xml" target_reset_script="SRAMReset()" Name="RAM" Placement="RAM" />
<configuration arm_target_flash_loader_file_path="$(StudioDir)/targets/Philips_LPC210X/Release/Loader_lpc2300.elf" linker_section_placement_file="$(StudioDir)/targets/flash_placement.xml" target_reset_script="FLASHReset()" arm_target_flash_loader_type="LIBMEM RPC Loader" Name="Flash" Placement="Flash" />
<folder Name="Demo Source" >
<configuration filter="c;cpp;cxx;cc;h;s;asm;inc" Name="Common" />
<file file_name="main.c" Name="main.c" />
<file file_name="LCD/portlcd.c" Name="portlcd.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/Minimal/blocktim.c" Name="blocktim.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/Minimal/integer.c" Name="integer.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/Minimal/BlockQ.c" Name="BlockQ.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="ParTest/ParTest.c" Name="ParTest.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/Minimal/flash.c" Name="flash.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="webserver/EMAC_ISR.c" Name="EMAC_ISR.c" >
<configuration arm_instruction_set="ARM" Name="THUMB" />
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="webserver/emac.c" Name="emac.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
<configuration asm_additional_options="" Name="Common" />
</file>
<file file_name="../Common/Minimal/death.c" Name="death.c" />
<file file_name="../Common/Minimal/PollQ.c" Name="PollQ.c" />
<file file_name="../Common/Minimal/semtest.c" Name="semtest.c" />
</folder>
<folder Name="System Files" >
<file file_name="$(StudioDir)/source/crt0.s" Name="crt0.s" />
<file file_name="$(StudioDir)/targets/Philips_LPC210X/Philips_LPC230X_Startup.s" Name="Philips_LPC230X_Startup.s" />
<file file_name="$(StudioDir)/targets/Philips_LPC210X/LPC230x.c" Name="LPC230x.c" />
<file file_name="$(StudioDir)/targets/Philips_LPC210X/Philips_LPC210X_Target.js" Name="Philips_LPC210X_Target.js" >
<configuration Name="Common" file_type="Reset Script" />
</file>
<file file_name="$(StudioDir)/targets/Philips_LPC210X/VIC_PL192.c" Name="VIC_PL192.c" />
<file file_name="$(StudioDir)/targets/Philips_LPC210X/VIC_PL192_irq_handler.s" Name="VIC_PL192_irq_handler.s" />
</folder>
<folder Name="FreeRTOS.org Source" >
<file file_name="../../Source/tasks.c" Name="tasks.c" />
<file file_name="../../Source/list.c" Name="list.c" />
<file file_name="../../Source/queue.c" Name="queue.c" />
<file file_name="../../Source/portable/GCC/ARM7_LPC23xx/port.c" Name="port.c" />
<file file_name="../../Source/portable/GCC/ARM7_LPC23xx/portISR.c" Name="portISR.c" >
<configuration arm_instruction_set="ARM" Name="Common" />
</file>
<file file_name="../../Source/portable/MemMang/heap_2.c" Name="heap_2.c" />
</folder>
<configuration linker_scanf_fmt_level="int" linker_keep_symbols="_vectors" c_preprocessor_definitions="" gcc_optimization_level="Level 1" arm_target_flash_loader_type="LIBMEM RPC Loader" linker_scanf_character_group_matching_enabled="No" linker_printf_fmt_level="int" Name="ARM Flash Debug" />
<folder Name="uIP Source" >
<file file_name="webserver/uIP_Task.c" Name="uIP_Task.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="webserver/httpd.c" Name="httpd.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="webserver/httpd-cgi.c" Name="httpd-cgi.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="webserver/httpd-fs.c" Name="httpd-fs.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="webserver/http-strings.c" Name="http-strings.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/ethernet/uIP/uip-1.0/uip/uip_arp.c" Name="uip_arp.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/ethernet/uIP/uip-1.0/uip/psock.c" Name="psock.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/ethernet/uIP/uip-1.0/uip/timer.c" Name="timer.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
<file file_name="../Common/ethernet/uIP/uip-1.0/uip/uip.c" Name="uip.c" >
<configuration build_exclude_from_build="No" Name="ARM Flash Debug" />
</file>
</folder>
<configuration c_preprocessor_definitions="THUMB_INTERWORK" Name="THUMB" />
<configuration c_preprocessor_definitions="STARTUP_FROM_RESET" gcc_optimization_level="Optimize For Size" Name="ARM Flash Release" />
<configuration arm_linker_fiq_stack_size="0" arm_linker_stack_size="0" Name="THUMB Flash Debug" arm_linker_svc_stack_size="512" arm_linker_heap_size="0" />
</project>
<configuration inherited_configurations="ARM;Flash;Debug" Name="ARM Flash Debug" />
<configuration arm_library_instruction_set="ARM" c_preprocessor_definitions="__ARM" arm_instruction_set="ARM" hidden="Yes" Name="ARM" />
<configuration c_preprocessor_definitions="__FLASH_BUILD" hidden="Yes" Name="Flash" />
<configuration c_preprocessor_definitions="DEBUG" link_include_startup_code="No" gcc_optimization_level="None" build_debug_information="Yes" hidden="Yes" Name="Debug" />
<configuration inherited_configurations="ARM;Flash;Release" Name="ARM Flash Release" />
<configuration c_preprocessor_definitions="NDEBUG" link_include_startup_code="No" gcc_optimization_level="Level 1" build_debug_information="No" hidden="Yes" Name="Release" />
<configuration inherited_configurations="THUMB;Flash;Debug" Name="THUMB Flash Debug" />
<configuration arm_library_instruction_set="THUMB" c_preprocessor_definitions="__THUMB" arm_instruction_set="THUMB" hidden="Yes" Name="THUMB" />
<configuration arm_linker_stack_size="256" Name="Common" />
</solution>

View File

@@ -1,86 +0,0 @@
<!DOCTYPE CrossStudio_for_ARM_Session_File>
<session>
<Autos>
<Watches active="0" />
</Autos>
<Bookmarks/>
<Breakpoints>
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="D_Abort" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="FIQ" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="IRQ" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="P_Abort" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="Reset" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="SWI" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="ARM Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="Undef" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="BusFault" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="ExceptionEntryReturnFault" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="HardFault" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="MemManage" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="3" mask="0" comparison="0" expression="Reset" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="UsageFault_CheckingError" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="UsageFault_Coprocessor" filename="" />
<BreakpointListItem actiontype="0" chainFrom="" line="-1" defaultBreakType="true" length="0" triggertype="0" useHWbreakpoint="false" group="Cortex-M3 Exceptions" breakdatatype="5" value="0" name="unnamed" counter="0" state="2" mask="0" comparison="0" expression="UsageFault_StateError" filename="" />
</Breakpoints>
<ExecutionCountWindow/>
<Memory1>
<MemoryWindow autoEvaluate="0" addressText="0x4000592c" numColumns="8" sizeText="2000" dataSize="1" radix="16" addressSpace="" />
</Memory1>
<Memory2>
<MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
</Memory2>
<Memory3>
<MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
</Memory3>
<Memory4>
<MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
</Memory4>
<MemoryUsageWindow>
<ProjectSessionItem path="RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Demo Source" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;uIP Source" name="unnamed" />
</MemoryUsageWindow>
<Project>
<ProjectSessionItem path="RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Demo Source" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;uIP Source" name="unnamed" />
</Project>
<Register1>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="CPU - Current Mode" decimalNodes="" octalNodes="" asciiNodes="" />
</Register1>
<Register2>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="CPU - Current Mode" decimalNodes="" octalNodes="" asciiNodes="" />
</Register2>
<Register3>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
</Register3>
<Register4>
<RegisterWindow openNodes="" binaryNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
</Register4>
<SourceNavigatorWindow/>
<TraceWindow>
<Trace wrap="Yes" type="1" enabled="Yes" />
</TraceWindow>
<Watch1>
<Watches active="0" />
</Watch1>
<Watch2>
<Watches active="0" />
</Watch2>
<Watch3>
<Watches active="0" />
</Watch3>
<Watch4>
<Watches active="1" >
<Watchpoint linenumber="0" radix="-1" name="xStart" expression="xStart" filename="" />
</Watches>
</Watch4>
<Files>
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" y="72" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" left="0" selected="0" name="unnamed" top="47" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\main.c" y="117" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\main.c" left="0" selected="0" name="unnamed" top="80" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="27" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\webserver\uIP_Task.c" y="261" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\webserver\uIP_Task.c" left="0" selected="0" name="unnamed" top="225" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="33" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\webserver\emac.c" y="7" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\ARM7_LPC2368_Rowley\webserver\emac.c" left="0" selected="1" name="unnamed" top="0" />
</Files>
<ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="/USB CrossConnect for ARM-RTCK" debugSearchFileMap="" fileDialogInitialDirectory="C:\E\Dev\FreeRTOS\Demo\ARM7_LPC2368_Rowley\webserver" fileDialogDefaultFilter="*.cpp;*.cxx;*.cc;*.c;*.h;*.hpp;*.hxx" autoConnectCapabilities="1407" debugSearchPath="" buildConfiguration="ARM Flash Debug" />
</session>

View File

@@ -1,250 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Environment includes. */
#include <targets/LPC2368.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
/* Demo app includes. */
#include "BlockQ.h"
#include "death.h"
#include "integer.h"
#include "blocktim.h"
#include "portlcd.h"
#include "flash.h"
#include "partest.h"
#include "semtest.h"
#include "PollQ.h"
/* Demo application definitions. */
#define mainQUEUE_SIZE ( 3 )
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
#define mainBASIC_WEB_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 )
/* Task priorities. */
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainFLASH_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
/*
* Checks the status of all the demo tasks then prints a message to the
* CrossStudio terminal IO windows. The message will be either PASS or FAIL
* depending on the status of the demo applications tasks. A FAIL status will
* be latched.
*
* Messages are not written directly to the terminal, but passed to vPrintTask
* via a queue.
*/
static void vCheckTask( void *pvParameters );
/*
* The task that handles the uIP stack. All TCP/IP processing is performed in
* this task.
*/
extern void vuIP_Task( void *pvParameters );
/*
* The LCD is written two by more than one task so is controlled by a
* 'gatekeeper' task. This is the only task that is actually permitted to
* access the LCD directly. Other tasks wanting to display a message send
* the message to the gatekeeper.
*/
static void vLCDTask( void *pvParameters );
/* The queue used to send messages to the LCD task. */
xQueueHandle xLCDQueue;
/*-----------------------------------------------------------*/
int main (void)
{
/* Setup the led's on the MCB2300 board */
vParTestInitialise();
/* Create the queue used by the LCD task. Messages for display on the LCD
are received via this queue. */
xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );
/* Create the lwIP task. This uses the lwIP RTOS abstraction layer.*/
xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
/* Start the standard demo tasks. */
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vCreateBlockTimeTasks();
vStartLEDFlashTasks( mainFLASH_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
/* Start the tasks defined within this file/specific to this demo. */
xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
/* The suicide tasks must be created last as they need to know how many
tasks were running prior to their creation in order to ascertain whether
or not the correct/expected number of tasks are running at any given time. */
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
/* Start the scheduler. */
vTaskStartScheduler();
/* Will only get here if there was insufficient memory to create the idle
task. */
return 0;
}
/*-----------------------------------------------------------*/
static void vCheckTask( void *pvParameters )
{
portBASE_TYPE xErrorOccurred = pdFALSE;
portTickType xLastExecutionTime;
unsigned portBASE_TYPE uxColumn = 0;
xLCDMessage xMessage;
xLastExecutionTime = xTaskGetTickCount();
xMessage.xColumn = 0;
xMessage.pcMessage = "PASS";
for( ;; )
{
/* Perform this check every mainCHECK_DELAY milliseconds. */
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_DELAY );
/* Has an error been found in any task? */
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
LCD_cls();
xMessage.xColumn++;
LCD_gotoxy( ( uxColumn & 0x07 ) + 1, ( uxColumn & 0x01 ) + 1 );
if( xErrorOccurred == pdTRUE )
{
xMessage.pcMessage = "FAIL";
}
/* Send the message to the LCD gatekeeper for display. */
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );
}
}
/*-----------------------------------------------------------*/
void vLCDTask( void *pvParameters )
{
xLCDMessage xMessage;
/* Initialise the LCD and display a startup message. */
LCD_init();
LCD_cur_off();
LCD_cls();
LCD_gotoxy( 1, 1 );
LCD_puts( ( signed portCHAR * ) "www.FreeRTOS.org" );
for( ;; )
{
/* Wait for a message to arrive that requires displaying. */
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
/* Display the message. Print each message to a different position. */
LCD_cls();
LCD_gotoxy( ( xMessage.xColumn & 0x07 ) + 1, ( xMessage.xColumn & 0x01 ) + 1 );
LCD_puts( xMessage.pcMessage );
}
}
/*-----------------------------------------------------------*/
/* Keep the compiler quiet. */
#include <stdio.h>
int __putchar( int c )
{
return EOF;
}

View File

@@ -1,50 +0,0 @@
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
/* The function that actually performs the interrupt processing. This must be
separate to the wrapper to ensure the correct stack frame is set up. */
void vEMAC_ISR_Handler( void );
extern xSemaphoreHandle xEMACSemaphore;
void vEMAC_ISR_Handler( void )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Clear the interrupt. */
IntClear = 0xffff;
VICVectAddr = 0;
/* Ensure the uIP task is not blocked as data has arrived. */
xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken );
if( xHigherPriorityTaskWoken )
{
/* If the uIP task was unblocked then calling "Yield from ISR" here
will ensure the interrupt returns directly to the uIP task, if it
is the highest priority read task. */
portYIELD_FROM_ISR();
}
}
/*-----------------------------------------------------------*/
void vEMAC_ISR_Wrapper( void )
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler function. This must be separate from the wrapper
function to ensure the correct stack frame is set up. */
vEMAC_ISR_Handler();
/* Restore the context of whichever task is going to run next. */
portRESTORE_CONTEXT();
}

View File

@@ -1,412 +0,0 @@
/******************************************************************
***** *****
***** Name: cs8900.c *****
***** Ver.: 1.0 *****
***** Date: 07/05/2001 *****
***** Auth: Andreas Dannenberg *****
***** HTWK Leipzig *****
***** university of applied sciences *****
***** Germany *****
***** Func: ethernet packet-driver for use with LAN- *****
***** controller CS8900 from Crystal/Cirrus Logic *****
***** *****
***** Keil: Module modified for use with Philips *****
***** LPC2378 EMAC Ethernet controller *****
***** *****
******************************************************************/
/* Adapted from file originally written by Andreas Dannenberg. Supplied with permission. */
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
#include "emac.h"
/* The semaphore used to wake the uIP task when data arives. */
xSemaphoreHandle xEMACSemaphore = NULL;
static unsigned short *rptr;
static unsigned short *tptr;
// easyWEB internal function
// help function to swap the byte order of a WORD
static unsigned short SwapBytes(unsigned short Data)
{
return (Data >> 8) | (Data << 8);
}
// Keil: function added to write PHY
void write_PHY (int PhyReg, int Value)
{
unsigned int tout;
MADR = DP83848C_DEF_ADR | PhyReg;
MWTD = Value;
/* Wait utill operation completed */
tout = 0;
for (tout = 0; tout < MII_WR_TOUT; tout++) {
if ((MIND & MIND_BUSY) == 0) {
break;
}
}
}
// Keil: function added to read PHY
unsigned short read_PHY (unsigned char PhyReg)
{
unsigned int tout;
MADR = DP83848C_DEF_ADR | PhyReg;
MCMD = MCMD_READ;
/* Wait until operation completed */
tout = 0;
for (tout = 0; tout < MII_RD_TOUT; tout++) {
if ((MIND & MIND_BUSY) == 0) {
break;
}
}
MCMD = 0;
return (MRDD);
}
// Keil: function added to initialize Rx Descriptors
void rx_descr_init (void)
{
unsigned int i;
for (i = 0; i < NUM_RX_FRAG; i++) {
RX_DESC_PACKET(i) = RX_BUF(i);
RX_DESC_CTRL(i) = RCTRL_INT | (ETH_FRAG_SIZE-1);
RX_STAT_INFO(i) = 0;
RX_STAT_HASHCRC(i) = 0;
}
/* Set EMAC Receive Descriptor Registers. */
RxDescriptor = RX_DESC_BASE;
RxStatus = RX_STAT_BASE;
RxDescriptorNumber = NUM_RX_FRAG-1;
/* Rx Descriptors Point to 0 */
RxConsumeIndex = 0;
}
// Keil: function added to initialize Tx Descriptors
void tx_descr_init (void) {
unsigned int i;
for (i = 0; i < NUM_TX_FRAG; i++) {
TX_DESC_PACKET(i) = TX_BUF(i);
TX_DESC_CTRL(i) = 0;
TX_STAT_INFO(i) = 0;
}
/* Set EMAC Transmit Descriptor Registers. */
TxDescriptor = TX_DESC_BASE;
TxStatus = TX_STAT_BASE;
TxDescriptorNumber = NUM_TX_FRAG-1;
/* Tx Descriptors Point to 0 */
TxProduceIndex = 0;
}
// configure port-pins for use with LAN-controller,
// reset it and send the configuration-sequence
portBASE_TYPE Init_EMAC(void)
{
portBASE_TYPE xReturn = pdPASS;
static portBASE_TYPE xAttempt = 0;
// Keil: function modified to access the EMAC
// Initializes the EMAC ethernet controller
volatile unsigned int regv,tout,id1,id2;
/* Enable P1 Ethernet Pins. */
PINSEL2 = configPINSEL2_VALUE;
PINSEL3 = (PINSEL3 & ~0x0000000F) | 0x00000005;
/* Power Up the EMAC controller. */
PCONP |= 0x40000000;
vTaskDelay( 10 );
/* Reset all EMAC internal modules. */
MAC1 = MAC1_RES_TX | MAC1_RES_MCS_TX | MAC1_RES_RX | MAC1_RES_MCS_RX |
MAC1_SIM_RES | MAC1_SOFT_RES;
Command = CR_REG_RES | CR_TX_RES | CR_RX_RES;
/* A short delay after reset. */
vTaskDelay( 10 );
/* Initialize MAC control registers. */
MAC1 = MAC1_PASS_ALL;
MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;
MAXF = ETH_MAX_FLEN;
CLRT = CLRT_DEF;
IPGR = IPGR_DEF;
/* Enable Reduced MII interface. */
Command = CR_RMII | CR_PASS_RUNT_FRM;
/* Reset Reduced MII Logic. */
SUPP = SUPP_RES_RMII;
SUPP = 0;
/* Put the DP83848C in reset mode */
write_PHY (PHY_REG_BMCR, 0x8000);
write_PHY (PHY_REG_BMCR, 0x8000);
/* Wait for hardware reset to end. */
for (tout = 0; tout < 100; tout++) {
vTaskDelay( 200 );
regv = read_PHY (PHY_REG_BMCR);
if (!(regv & 0x8000)) {
/* Reset complete */
break;
}
}
/* Check if this is a DP83848C PHY. */
id1 = read_PHY (PHY_REG_IDR1);
id2 = read_PHY (PHY_REG_IDR2);
if (((id1 << 16) | (id2 & 0xFFF0)) == DP83848C_ID) {
/* Configure the PHY device */
/* Use autonegotiation about the link speed. */
write_PHY (PHY_REG_BMCR, PHY_AUTO_NEG);
/* Wait to complete Auto_Negotiation. */
for (tout = 0; tout < 10; tout++) {
vTaskDelay( 200 );
regv = read_PHY (PHY_REG_BMSR);
if (regv & 0x0020) {
/* Autonegotiation Complete. */
break;
}
}
}
else
{
xReturn = pdFAIL;
}
/* Check the link status. */
if( xReturn == pdPASS )
{
xReturn = pdFAIL;
for (tout = 0; tout < 10; tout++) {
vTaskDelay( 200 );
regv = read_PHY (PHY_REG_STS);
if (regv & 0x0001) {
/* Link is on. */
xReturn = pdPASS;
break;
}
}
}
if( xReturn == pdPASS )
{
/* Configure Full/Half Duplex mode. */
if (regv & 0x0004) {
/* Full duplex is enabled. */
MAC2 |= MAC2_FULL_DUP;
Command |= CR_FULL_DUP;
IPGT = IPGT_FULL_DUP;
}
else {
/* Half duplex mode. */
IPGT = IPGT_HALF_DUP;
}
/* Configure 100MBit/10MBit mode. */
if (regv & 0x0002) {
/* 10MBit mode. */
SUPP = 0;
}
else {
/* 100MBit mode. */
SUPP = SUPP_SPEED;
}
/* Set the Ethernet MAC Address registers */
SA0 = (emacETHADDR0 << 8) | emacETHADDR1;
SA1 = (emacETHADDR2 << 8) | emacETHADDR3;
SA2 = (emacETHADDR4 << 8) | emacETHADDR5;
/* Initialize Tx and Rx DMA Descriptors */
rx_descr_init ();
tx_descr_init ();
/* Receive Broadcast and Perfect Match Packets */
RxFilterCtrl = RFC_UCAST_EN | RFC_BCAST_EN | RFC_PERFECT_EN;
/* Create the semaphore used ot wake the uIP task. */
vSemaphoreCreateBinary( xEMACSemaphore );
/* Reset all interrupts */
IntClear = 0xFFFF;
/* Enable receive and transmit mode of MAC Ethernet core */
Command |= (CR_RX_EN | CR_TX_EN);
MAC1 |= MAC1_REC_EN;
}
return xReturn;
}
// reads a word in little-endian byte order from RX_BUFFER
unsigned short ReadFrame_EMAC(void)
{
return (*rptr++);
}
// reads a word in big-endian byte order from RX_FRAME_PORT
// (useful to avoid permanent byte-swapping while reading
// TCP/IP-data)
unsigned short ReadFrameBE_EMAC(void)
{
unsigned short ReturnValue;
ReturnValue = SwapBytes (*rptr++);
return (ReturnValue);
}
// copies bytes from frame port to MCU-memory
// NOTES: * an odd number of byte may only be transfered
// if the frame is read to the end!
// * MCU-memory MUST start at word-boundary
void CopyFromFrame_EMAC(void *Dest, unsigned short Size)
{
unsigned short * piDest; // Keil: Pointer added to correct expression
piDest = Dest; // Keil: Line added
while (Size > 1) {
*piDest++ = ReadFrame_EMAC();
Size -= 2;
}
if (Size) { // check for leftover byte...
*(unsigned char *)piDest = (char)ReadFrame_EMAC();// the LAN-Controller will return 0
} // for the highbyte
}
// does a dummy read on frame-I/O-port
// NOTE: only an even number of bytes is read!
void DummyReadFrame_EMAC(unsigned short Size) // discards an EVEN number of bytes
{ // from RX-fifo
while (Size > 1) {
ReadFrame_EMAC();
Size -= 2;
}
}
// Reads the length of the received ethernet frame and checks if the
// destination address is a broadcast message or not
// returns the frame length
unsigned short StartReadFrame(void) {
unsigned short RxLen;
unsigned int idx;
idx = RxConsumeIndex;
RxLen = (RX_STAT_INFO(idx) & RINFO_SIZE) - 3;
rptr = (unsigned short *)RX_DESC_PACKET(idx);
return(RxLen);
}
void EndReadFrame(void) {
unsigned int idx;
/* DMA free packet. */
idx = RxConsumeIndex;
if (++idx == NUM_RX_FRAG)
idx = 0;
RxConsumeIndex = idx;
}
unsigned int CheckFrameReceived(void) { // Packet received ?
if (RxProduceIndex != RxConsumeIndex) // more packets received ?
return(1);
else
return(0);
}
unsigned int uiGetEMACRxData( unsigned char *ucBuffer )
{
unsigned int uiLen = 0;
if( RxProduceIndex != RxConsumeIndex )
{
uiLen = StartReadFrame();
CopyFromFrame_EMAC( ucBuffer, uiLen );
EndReadFrame();
}
return uiLen;
}
// requests space in EMAC memory for storing an outgoing frame
void RequestSend(void)
{
unsigned int idx;
idx = TxProduceIndex;
tptr = (unsigned short *)TX_DESC_PACKET(idx);
}
// check if ethernet controller is ready to accept the
// frame we want to send
unsigned int Rdy4Tx(void)
{
return (1); // the ethernet controller transmits much faster
} // than the CPU can load its buffers
// writes a word in little-endian byte order to TX_BUFFER
void WriteFrame_EMAC(unsigned short Data)
{
*tptr++ = Data;
}
// copies bytes from MCU-memory to frame port
// NOTES: * an odd number of byte may only be transfered
// if the frame is written to the end!
// * MCU-memory MUST start at word-boundary
void CopyToFrame_EMAC(void *Source, unsigned int Size)
{
unsigned short * piSource;
piSource = Source;
Size = (Size + 1) & 0xFFFE; // round Size up to next even number
while (Size > 0) {
WriteFrame_EMAC(*piSource++);
Size -= 2;
}
}
void DoSend_EMAC(unsigned short FrameSize)
{
unsigned int idx;
idx = TxProduceIndex;
TX_DESC_CTRL(idx) = FrameSize | TCTRL_LAST;
if (++idx == NUM_TX_FRAG) idx = 0;
TxProduceIndex = idx;
}

View File

@@ -1,276 +0,0 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* Web server script interface
* \author
* Adam Dunkels <adam@sics.se>
*
*/
/*
* Copyright (c) 2001-2006, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd-cgi.c,v 1.2 2006/06/11 21:46:37 adam Exp $
*
*/
#include "uip.h"
#include "psock.h"
#include "httpd.h"
#include "httpd-cgi.h"
#include "httpd-fs.h"
#include <stdio.h>
#include <string.h>
HTTPD_CGI_CALL(file, "file-stats", file_stats);
HTTPD_CGI_CALL(tcp, "tcp-connections", tcp_stats);
HTTPD_CGI_CALL(net, "net-stats", net_stats);
HTTPD_CGI_CALL(rtos, "rtos-stats", rtos_stats );
HTTPD_CGI_CALL(io, "led-io", led_io );
static const struct httpd_cgi_call *calls[] = { &file, &tcp, &net, &rtos, &io, NULL };
/*---------------------------------------------------------------------------*/
static
PT_THREAD(nullfunction(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
httpd_cgifunction
httpd_cgi(char *name)
{
const struct httpd_cgi_call **f;
/* Find the matching name in the table, return the function. */
for(f = calls; *f != NULL; ++f) {
if(strncmp((*f)->name, name, strlen((*f)->name)) == 0) {
return (*f)->function;
}
}
return nullfunction;
}
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
char *f = (char *)arg;
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u", httpd_fs_count(f));
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(file_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static const char closed[] = /* "CLOSED",*/
{0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0};
static const char syn_rcvd[] = /* "SYN-RCVD",*/
{0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56,
0x44, 0};
static const char syn_sent[] = /* "SYN-SENT",*/
{0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e,
0x54, 0};
static const char established[] = /* "ESTABLISHED",*/
{0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48,
0x45, 0x44, 0};
static const char fin_wait_1[] = /* "FIN-WAIT-1",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x31, 0};
static const char fin_wait_2[] = /* "FIN-WAIT-2",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
0x54, 0x2d, 0x32, 0};
static const char closing[] = /* "CLOSING",*/
{0x43, 0x4c, 0x4f, 0x53, 0x49,
0x4e, 0x47, 0};
static const char time_wait[] = /* "TIME-WAIT,"*/
{0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41,
0x49, 0x54, 0};
static const char last_ack[] = /* "LAST-ACK"*/
{0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43,
0x4b, 0};
static const char *states[] = {
closed,
syn_rcvd,
syn_sent,
established,
fin_wait_1,
fin_wait_2,
closing,
time_wait,
last_ack};
static unsigned short
generate_tcp_stats(void *arg)
{
struct uip_conn *conn;
struct httpd_state *s = (struct httpd_state *)arg;
conn = &uip_conns[s->count];
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
"<tr><td>%d</td><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
htons(conn->lport),
htons(conn->ripaddr[0]) >> 8,
htons(conn->ripaddr[0]) & 0xff,
htons(conn->ripaddr[1]) >> 8,
htons(conn->ripaddr[1]) & 0xff,
htons(conn->rport),
states[conn->tcpstateflags & UIP_TS_MASK],
conn->nrtx,
conn->timer,
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' ');
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
for(s->count = 0; s->count < UIP_CONNS; ++s->count) {
if((uip_conns[s->count].tcpstateflags & UIP_TS_MASK) != UIP_CLOSED) {
PSOCK_GENERATOR_SEND(&s->sout, generate_tcp_stats, s);
}
}
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
static unsigned short
generate_net_stats(void *arg)
{
struct httpd_state *s = (struct httpd_state *)arg;
return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
"%5u\n", ((uip_stats_t *)&uip_stat)[s->count]);
}
static
PT_THREAD(net_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
#if UIP_STATISTICS
for(s->count = 0; s->count < sizeof(uip_stat) / sizeof(uip_stats_t);
++s->count) {
PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);
}
#endif /* UIP_STATISTICS */
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
extern void vTaskList( signed char *pcWriteBuffer );
static char cCountBuf[ 32 ];
long lRefreshCount = 0;
static unsigned short
generate_rtos_stats(void *arg)
{
lRefreshCount++;
sprintf( cCountBuf, "<p><br>Refresh count = %d", lRefreshCount );
vTaskList( uip_appdata );
strcat( uip_appdata, cCountBuf );
return strlen( uip_appdata );
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(rtos_stats(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_rtos_stats, NULL);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
char *pcStatus[ 3 ];
unsigned long ulString;
extern unsigned long uxParTextGetLED( unsigned long uxLED );
static unsigned short generate_io_state( void *arg )
{
for( ulString = 0; ulString < 4; ulString++ )
{
if( uxParTextGetLED( ulString + 5 ) )
{
pcStatus[ ulString ] = "checked";
}
else
{
pcStatus[ ulString ] = "";
}
}
sprintf( uip_appdata,
"<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED 2.5,"\
"<input type=\"checkbox\" name=\"LED1\" value=\"1\" %s>LED 2.6,"\
"<input type=\"checkbox\" name=\"LED2\" value=\"1\" %s>LED 2.7"\
"<p>"\
"<input type=\"text\" name=\"LCD\" value=\"Enter LCD text\" size=\"16\">",
pcStatus[ 0 ],
pcStatus[ 1 ],
pcStatus[ 2 ] );
return strlen( uip_appdata );
}
static PT_THREAD(led_io(struct httpd_state *s, char *ptr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_io_state, NULL);
PSOCK_END(&s->sout);
}
/** @} */

View File

@@ -1,344 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Standard includes. */
#include <string.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* uip includes. */
#include "uip.h"
#include "uip_arp.h"
#include "httpd.h"
#include "timer.h"
#include "clock-arch.h"
/* Demo includes. */
#include "emac.h"
#include "partest.h"
/*-----------------------------------------------------------*/
/* MAC address configuration. */
#define uipMAC_ADDR0 0x00
#define uipMAC_ADDR1 0x12
#define uipMAC_ADDR2 0x13
#define uipMAC_ADDR3 0x10
#define uipMAC_ADDR4 0x15
#define uipMAC_ADDR5 0x11
/* IP address configuration. */
#define uipIP_ADDR0 192
#define uipIP_ADDR1 168
#define uipIP_ADDR2 0
#define uipIP_ADDR3 200
/* How long to wait before attempting to connect the MAC again. */
#define uipINIT_WAIT 200
/* Shortcut to the header within the Rx buffer. */
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
/* Standard constant. */
#define uipTOTAL_FRAME_HEADER_SIZE 54
/*-----------------------------------------------------------*/
/*
* Send the uIP buffer to the MAC.
*/
static void prvENET_Send(void);
/*
* Setup the MAC address in the MAC itself, and in the uIP stack.
*/
static void prvSetMACAddress( void );
/*
* Port functions required by the uIP stack.
*/
void clock_init( void );
clock_time_t clock_time( void );
/*-----------------------------------------------------------*/
/* The semaphore used by the ISR to wake the uIP task. */
extern xSemaphoreHandle xEMACSemaphore;
/*-----------------------------------------------------------*/
void clock_init(void)
{
/* This is done when the scheduler starts. */
}
/*-----------------------------------------------------------*/
clock_time_t clock_time( void )
{
return xTaskGetTickCount();
}
/*-----------------------------------------------------------*/
void vuIP_Task( void *pvParameters )
{
portBASE_TYPE i;
uip_ipaddr_t xIPAddr;
struct timer periodic_timer, arp_timer;
extern void ( vEMAC_ISR_Wrapper )( void );
/* Create the semaphore used by the ISR to wake this task. */
vSemaphoreCreateBinary( xEMACSemaphore );
/* Initialise the uIP stack. */
timer_set( &periodic_timer, configTICK_RATE_HZ / 2 );
timer_set( &arp_timer, configTICK_RATE_HZ * 10 );
uip_init();
uip_ipaddr( xIPAddr, uipIP_ADDR0, uipIP_ADDR1, uipIP_ADDR2, uipIP_ADDR3 );
uip_sethostaddr( xIPAddr );
httpd_init();
/* Initialise the MAC. */
while( Init_EMAC() != pdPASS )
{
vTaskDelay( uipINIT_WAIT );
}
portENTER_CRITICAL();
{
IntEnable = INT_RX_DONE;
VICIntEnable |= 0x00200000;
VICVectAddr21 = ( portLONG ) vEMAC_ISR_Wrapper;
prvSetMACAddress();
}
portEXIT_CRITICAL();
for( ;; )
{
/* Is there received data ready to be processed? */
uip_len = uiGetEMACRxData( uip_buf );
if( uip_len > 0 )
{
/* Standard uIP loop taken from the uIP manual. */
if( xHeader->type == htons( UIP_ETHTYPE_IP ) )
{
uip_arp_ipin();
uip_input();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
prvENET_Send();
}
}
else if( xHeader->type == htons( UIP_ETHTYPE_ARP ) )
{
uip_arp_arpin();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
prvENET_Send();
}
}
}
else
{
if( timer_expired( &periodic_timer ) )
{
timer_reset( &periodic_timer );
for( i = 0; i < UIP_CONNS; i++ )
{
uip_periodic( i );
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if( uip_len > 0 )
{
uip_arp_out();
prvENET_Send();
}
}
/* Call the ARP timer function every 10 seconds. */
if( timer_expired( &arp_timer ) )
{
timer_reset( &arp_timer );
uip_arp_timer();
}
}
else
{
/* We did not receive a packet, and there was no periodic
processing to perform. Block for a fixed period. If a packet
is received during this period we will be woken by the ISR
giving us the Semaphore. */
xSemaphoreTake( xEMACSemaphore, configTICK_RATE_HZ / 2 );
}
}
}
}
/*-----------------------------------------------------------*/
static void prvENET_Send(void)
{
RequestSend();
/* Copy the header into the Tx buffer. */
CopyToFrame_EMAC( uip_buf, uipTOTAL_FRAME_HEADER_SIZE );
if( uip_len > uipTOTAL_FRAME_HEADER_SIZE )
{
CopyToFrame_EMAC( uip_appdata, ( uip_len - uipTOTAL_FRAME_HEADER_SIZE ) );
}
DoSend_EMAC( uip_len );
RequestSend();
/* Copy the header into the Tx buffer. */
CopyToFrame_EMAC( uip_buf, uipTOTAL_FRAME_HEADER_SIZE );
if( uip_len > uipTOTAL_FRAME_HEADER_SIZE )
{
CopyToFrame_EMAC( uip_appdata, ( uip_len - uipTOTAL_FRAME_HEADER_SIZE ) );
}
DoSend_EMAC( uip_len );
}
/*-----------------------------------------------------------*/
static void prvSetMACAddress( void )
{
struct uip_eth_addr xAddr;
/* Configure the MAC address in the uIP stack. */
xAddr.addr[ 0 ] = uipMAC_ADDR0;
xAddr.addr[ 1 ] = uipMAC_ADDR1;
xAddr.addr[ 2 ] = uipMAC_ADDR2;
xAddr.addr[ 3 ] = uipMAC_ADDR3;
xAddr.addr[ 4 ] = uipMAC_ADDR4;
xAddr.addr[ 5 ] = uipMAC_ADDR5;
uip_setethaddr( xAddr );
}
/*-----------------------------------------------------------*/
void vApplicationProcessFormInput( portCHAR *pcInputString, portBASE_TYPE xInputLength )
{
char *c, *pcText;
static portCHAR cMessageForDisplay[ 32 ];
extern xQueueHandle xLCDQueue;
xLCDMessage xLCDMessage;
/* Process the form input sent by the IO page of the served HTML. */
c = strstr( pcInputString, "?" );
if( c )
{
/* Turn LED's on or off in accordance with the check box status. */
if( strstr( c, "LED0=1" ) != NULL )
{
vParTestSetLED( 5, 0 );
}
else
{
vParTestSetLED( 5, 1 );
}
if( strstr( c, "LED1=1" ) != NULL )
{
vParTestSetLED( 6, 0 );
}
else
{
vParTestSetLED( 6, 1 );
}
if( strstr( c, "LED2=1" ) != NULL )
{
vParTestSetLED( 7, 0 );
}
else
{
vParTestSetLED( 7, 1 );
}
/* Find the start of the text to be displayed on the LCD. */
pcText = strstr( c, "LCD=" );
pcText += strlen( "LCD=" );
/* Terminate the file name for further processing within uIP. */
*c = 0x00;
/* Terminate the LCD string. */
c = strstr( pcText, " " );
if( c != NULL )
{
*c = 0x00;
}
/* Add required spaces. */
while( ( c = strstr( pcText, "+" ) ) != NULL )
{
*c = ' ';
}
/* Write the message to the LCD. */
strcpy( cMessageForDisplay, pcText );
xLCDMessage.xColumn = 0;
xLCDMessage.pcMessage = cMessageForDisplay;
xQueueSend( xLCDQueue, &xLCDMessage, portMAX_DELAY );
}
}

View File

@@ -1,93 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 48000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 20480 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 0
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,365 +0,0 @@
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
* File Name : uart.c
* Author : MCD Application Team
* Date First Issued : 06/08/2003
* Description : This file provides all the UART software functions
********************************************************************************
* History:
* 30/11/2004 : V2.0
* 14/07/2004 : V1.3
* 01/01/2004 : V1.2
*******************************************************************************
THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
#include "uart.h"
/*******************************************************************************
* Function Name : UART_Init
* Description : This function initializes the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Output : None
* Return : None
*******************************************************************************/
void UART_Init(UART_TypeDef *UARTx)
{
UARTx->IER = 0x00;
UARTx->CR = 0x00;
(void)UARTx->RxBUFR;
UARTx->RxRSTR = 0xFFFF;
UARTx->TxRSTR = 0xFFFF;
}
/*******************************************************************************
* Function Name : UART_BaudRateConfig
* Description : This function configures the baud rate of the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : The baudrate value
* Output : None
* Return : None
*******************************************************************************/
void UART_BaudRateConfig(UART_TypeDef *UARTx, u32 BaudRate)
{
UARTx->BR = (u16)(RCCU_FrequencyValue(RCCU_FCLK)/(16*BaudRate));
}
/*******************************************************************************
* Function Name : UART_Config
* Description : This function configures the baudrate, the mode, the data
* parity and the number of stop bits of the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : The baudrate value
* Input 3 : The parity type
* Input 4 : The number of stop bits
* Input 5 : The UART mode
* Output : None
* Return : None
*******************************************************************************/
void UART_Config(UART_TypeDef *UARTx, u32 BaudRate, UARTParity_TypeDef Parity,
UARTStopBits_TypeDef StopBits, UARTMode_TypeDef Mode)
{
UART_ModeConfig(UARTx, Mode);
UART_BaudRateConfig(UARTx, BaudRate);
UART_ParityConfig(UARTx, Parity);
UART_StopBitsConfig(UARTx, StopBits);
}
/*******************************************************************************
* Function Name : UART_ItConfig
* Description : This function enables or disables the interrupts of the
* selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : The new interrupt flag
* Input 3 : ENABLE or DISABLE
* Output : None
* Return : None
*******************************************************************************/
void UART_ItConfig(UART_TypeDef *UARTx, u16 UART_Flag, FunctionalState NewState)
{
if (NewState==ENABLE) UARTx->IER|=UART_Flag; else UARTx->IER&=~UART_Flag;
}
/*******************************************************************************
* Function Name : UART_FifoConfig
* Description : This function enables or disables the Rx and Tx FIFOs of
* the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : ENABLE or DISABLE
* Output : None
* Return : None
*******************************************************************************/
void UART_FifoConfig(UART_TypeDef *UARTx, FunctionalState NewState)
{
if (NewState==ENABLE) UARTx->CR|=0x0400; else UARTx->CR&=~0x0400;
}
/*******************************************************************************
* Function Name : UART_FifoReset
* Description : This function resets the Rx and the Tx FIFOs of the
* selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : UART_RxFIFO or UART_TxFIFO
* Output : None
* Return : None
*******************************************************************************/
void UART_FifoReset(UART_TypeDef *UARTx, UARTFIFO_TypeDef FIFO)
{
if (FIFO==UART_RxFIFO) UARTx->RxRSTR=0xFFFF; else UARTx->TxRSTR=0xFFFF;
}
/*******************************************************************************
* Function Name : UART_LoopBackConfig
* Description : This function enables or disables the loop back mode of
* the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : ENABLE or DISABLE
* Output : None
* Return : None
*******************************************************************************/
void UART_LoopBackConfig(UART_TypeDef *UARTx, FunctionalState NewState)
{
if (NewState==ENABLE) UARTx->CR|=0x0040; else UARTx->CR&=~0x0040;
}
/*******************************************************************************
* Function Name : UART_RxConfig
* Description : This function enables or disables the UART data reception.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : ENABLE or DISABLE
* Output : None
* Return : None
*******************************************************************************/
void UART_RxConfig(UART_TypeDef *UARTx, FunctionalState NewState)
{
if (NewState==ENABLE) UARTx->CR|=0x0100; else UARTx->CR&=~0x0100;
}
/*******************************************************************************
* Function Name : UART_OnOffConfig
* Description : This function sets On/Off the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : ENABLE or DISABLE
* Output : None
* Return : None
*******************************************************************************/
void UART_OnOffConfig(UART_TypeDef *UARTx, FunctionalState NewState)
{
if (NewState==ENABLE) UARTx->CR|=0x0080; else UARTx->CR&=~0x0080;
}
/*******************************************************************************
* Function Name : UART_ByteSend
* Description : This function sends a data byte to the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the data byte to send
* Output : None
* Return : None
*******************************************************************************/
void UART_ByteSend(UART_TypeDef *UARTx, u8 *Data)
{
if (UARTx->CR & (0x0001<<UART_FIFOEnableBit))// if FIFO ENABLED
while((UARTx->SR & UART_TxFull)); // while the UART_TxFIFO contain 16 characters.
else // if FIFO DISABLED
while (!(UARTx->SR & UART_TxEmpty)); // while the transmit shift register not empty
UARTx->TxBUFR = *Data;
}
/*******************************************************************************
* Function Name : UART_9BitByteSend
* Description : This function sends a 9 bits data byte to the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the data to send
* Output : None
* Return : None
*******************************************************************************/
void UART_9BitByteSend(UART_TypeDef *UARTx, u16 *Data)
{
if(UARTx->CR & (0x0001<<UART_FIFOEnableBit))// if FIFO ENABLED
while((UARTx->SR & UART_TxFull)); // while the UART_TxFIFO contain 16 characters.
else // if FIFO DISABLED
while (!(UARTx->SR & UART_TxEmpty)); // while the transmit shift register not empty
UARTx->TxBUFR = *Data;
}
/*******************************************************************************
* Function Name : UART_DataSend
* Description : This function sends several data bytes to the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the data to send
* Input 3 : The data length in bytes
* Output : None
* Return : None
*******************************************************************************/
void UART_DataSend(UART_TypeDef *UARTx, u8 *Data, u8 DataLength)
{
while(DataLength--)
{
UART_ByteSend(UARTx,Data);
Data++;
}
}
/*******************************************************************************
* Function Name : UART_9BitDataSend
* Description : This function sends several 9 bits data bytes to the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the data to send
* Input 3 : The data length
* Output : None
* Return : None
*******************************************************************************/
void UART_9BitDataSend(UART_TypeDef *UARTx, u16 *Data, u8 DataLength)
{
while(DataLength--)
{
UART_9BitByteSend(UARTx,Data);
Data++;
}
}
/*******************************************************************************
* Function Name : UART_StringSend
* Description : This function sends a string to the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the string to send
* Output : None
* Return : None
*******************************************************************************/
void UART_StringSend(UART_TypeDef *UARTx, u8 *String)
{
u8 *Data=String;
while(*Data != '\0')
UART_ByteSend(UARTx, Data++);
*Data='\0';
UART_ByteSend(UARTx, Data);
}
/*******************************************************************************
* Function Name : UART_ByteReceive
* Description : This function gets a data byte from the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the buffer where the data will be stored
* Input 3 : The time-out period
* Output : The received data
* Return : The UARTx.SR register contents
*******************************************************************************/
u16 UART_ByteReceive(UART_TypeDef *UARTx, u8 *Data, u8 TimeOut)
{
u16 wStatus;
UARTx->TOR=TimeOut;// reload the Timeout counter
while (!((wStatus=UARTx->SR) & (UART_TimeOutIdle|UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
*Data = (u8)UARTx->RxBUFR; // then read the Receive Buffer Register
return wStatus;
}
/*******************************************************************************
* Function Name : UART_9BitByteReceive
* Description : This function gets a 9 bits data byte from the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the buffer where the data will be stored
* Input 3 : The time-out period value
* Output : The received data
* Return : The UARTx.SR register contents
*******************************************************************************/
u16 UART_9BitByteReceive(UART_TypeDef *UARTx, u16 *Data, u8 TimeOut)
{
u16 wStatus;
UARTx->TOR=TimeOut;// reload the Timeout counter
while (!((wStatus=UARTx->SR) & (UART_TimeOutIdle|UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
*Data = (u16)UARTx->RxBUFR; // then read the RxBUFR
return wStatus;
}
/*******************************************************************************
* Function Name : UART_DataReceive
* Description : This function gets 8 bits data bytes from the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the buffer where the data will be stored
* Input 3 : The data length
* Input 4 : The time-out period value
* Output : The received data
* Return : The UARTx.SR register contents
*******************************************************************************/
u16 UART_DataReceive(UART_TypeDef *UARTx, u8 *Data, u8 DataLength, u8 TimeOut)
{
u16 wStatus;
while(DataLength--)
wStatus=UART_ByteReceive(UARTx,Data++,TimeOut);
return wStatus;
}
/*******************************************************************************
* Function Name : UART_9BitDataReceive
* Description : This function gets 9 bits data bytes from the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the buffer where the data will be stored
* Input 3 : The data length
* Input 4 : The time-out value
* Output : The received data
* Return : The UARTx.SR register contents
*******************************************************************************/
u16 UART_9BitDataReceive(UART_TypeDef *UARTx, u16 *Data, u8 DataLength, u8 TimeOut)
{
u16 wStatus;
while(DataLength--)
wStatus=UART_9BitByteReceive(UARTx,Data++,TimeOut);
return wStatus;
}
/*******************************************************************************
* Function Name : UART_StringReceive
* Description : This function gets 8 bits data bytes from the selected UART.
* Input 1 : UARTx (x can be 0,1, 2 or 3) the desired UART
* Input 2 : A pointer to the buffer where the string will be stored
* Output : The received string
* Return : The UARTx.SR register contents
*******************************************************************************/
u16 UART_StringReceive(UART_TypeDef *UARTx, u8 *Data)
{
u8 *pSTRING=Data;
u16 wStatus;
do
{
while (!((wStatus=UARTx->SR) & (UART_RxHalfFull|UART_RxBufFull)));// while the UART_RxFIFO is empty and no Timeoutidle
*(pSTRING++) = (u8)UARTx->RxBUFR; // then read the RxBUFR
} while((*(pSTRING - 1)!=0x0D)&(*(pSTRING - 1)!='\0'));
*(pSTRING - 1)='\0';
return wStatus;
}
#ifdef USE_SERIAL_PORT
/*******************************************************************************
* Function Name : sendchar
* Description : This function sends a character to the selected UART.
* Input 1 : A pointer to the character to send.
* Output : None
* Return : None
*******************************************************************************/
void sendchar( char *ch )
{
#ifdef USE_UART0
#define UARTx UART0
#endif /* Use_UART0 */
#ifdef USE_UART1
#define UARTx UART1
#endif /* Use_UART1 */
#ifdef USE_UART2
#define UARTx UART2
#endif /* Use_UART2 */
#ifdef USE_UART3
#define UARTx UART3
#endif /* Use_UART3 */
UART_ByteSend(UARTx,(u8 *)ch);
}
#endif /* USE_SERIAL_PORT */
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/

View File

@@ -1,122 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Library includes. */
#include "GPIO.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
/* Demo application includes. */
#include "partest.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's - which are
* connected to the second nibble of GPIO port 1.
*-----------------------------------------------------------*/
#define partstLED_3 0x0080
#define partstLED_2 0x0040
#define partstLED_1 0x0020
#define partstLED_0 0x0010
#define partstON_BOARD 0x0100 /* The LED built onto the KickStart board. */
#define partstALL_LEDs ( partstLED_0 | partstLED_1 | partstLED_2 | partstLED_3 | partstON_BOARD )
#define partstFIRST_LED_BIT 4
/* This demo application uses files that are common to all port demo
applications. These files assume 6 LED's are available, whereas I have
only 5 (including the LED built onto the development board). To prevent
two tasks trying to use the same LED a bit of remapping is performed.
The ComTest tasks will try and use LED's 6 and 7. LED 6 is ignored and
has no effect, LED 7 is mapped to LED3. The LED usage is described in
the port documentation available from the FreeRTOS.org WEB site. */
#define partstCOM_TEST_LED 7
#define partstRX_CHAR_LED 3
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
/* Configure the bits used to flash LED's on port 1 as output. */
GPIO_Config(GPIO1, partstALL_LEDs, GPIO_OUT_OD);
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED == partstCOM_TEST_LED )
{
/* Remap as described above. */
uxLED = partstRX_CHAR_LED;
}
/* Adjust the LED value to map to the port pins actually being used,
then write the required value to the port. */
uxLED += partstFIRST_LED_BIT;
GPIO_BitWrite( GPIO1, uxLED, !xValue );
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED == partstCOM_TEST_LED )
{
/* Remap as described above. */
uxLED = partstRX_CHAR_LED;
}
/* Adjust the LED value to map to the port pins actually being used,
then write the opposite value to the current state to the port pin. */
uxLED += partstFIRST_LED_BIT;
GPIO_BitWrite(GPIO1, uxLED, ~GPIO_BitRead( GPIO1, uxLED ) );
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,261 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles the onboard LED. Should any task contain an error at any time
* the LED toggle rate will change from 3 seconds to 500ms.
*
*/
/* Library includes. */
#include "RCCU.h"
#include "wdg.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo application includes. */
#include "flash.h"
#include "integer.h"
#include "PollQ.h"
#include "BlockQ.h"
#include "semtest.h"
#include "dynamic.h"
#include "partest.h"
#include "comtest2.h"
/* Priorities for the demo application tasks. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
/* Constants required by the 'Check' task. */
#define mainNO_ERROR_FLASH_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
#define mainERROR_FLASH_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( 4 )
/* Constants for the ComTest tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 115200 )
#define mainCOM_TEST_LED ( 6 ) /* The LED built onto the kickstart board. */
/*
* The task that executes at the highest priority and calls
* prvCheckOtherTasksAreStillRunning(). See the description at the top
* of the file.
*/
static void vErrorChecks( void *pvParameters );
/*
* Configure the processor for use with the IAR STR71x demo board. This
* just sets the PLL for the required frequency.
*/
static void prvSetupHardware( void );
/*
* Checks that all the demo application tasks are still executing without error
* - as described at the top of the file. Called by vErrorChecks().
*/
static portLONG prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/*
* Starts all the other tasks, then starts the scheduler.
*/
void main( void )
{
/* Setup any hardware that has not already been configured by the low
level init routines. */
prvSetupHardware();
/* Initialise the LED outputs for use by the demo application tasks. */
vParTestInitialise();
/* Start all the standard demo application tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartDynamicPriorityTasks();
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
/* Start the check task - which is defined in this file. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler.
NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.
The processor MUST be in supervisor mode when vTaskStartScheduler is
called. The demo applications included in the FreeRTOS.org download switch
to supervisor mode prior to main being called. If you are not using one of
these demo application projects then ensure Supervisor mode is used here. */
vTaskStartScheduler();
/* We should never get here as control is now taken by the scheduler. */
return;
}
/*-----------------------------------------------------------*/
static void prvSetupHardware( void )
{
/* Setup the PLL to generate a 48MHz clock from the 4MHz CLK. */
/* Turn of the div by two. */
RCCU_Div2Config( DISABLE );
/* 48MHz = ( 4MHz * 12 ) / 1 */
RCCU_PLL1Config( RCCU_PLL1_Mul_12, RCCU_Div_1 );
RCCU_RCLKSourceConfig( RCCU_PLL1_Output );
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;
portTickType xLastWakeTime;
/* The parameters are not used in this task. */
( void ) pvParameters;
/* Initialise xLastWakeTime to ensure the first call to vTaskDelayUntil()
functions correctly. */
xLastWakeTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. If an error is detected then the delay period
is decreased from mainNO_ERROR_FLASH_PERIOD to mainERROR_FLASH_PERIOD so
the on board LED flash rate will increase. */
for( ;; )
{
/* Delay until it is time to execute again. The delay period is
shorter following an error so the LED flashes faster. */
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );
/* Check all the standard demo application tasks are executing without
error. */
if( prvCheckOtherTasksAreStillRunning() != pdPASS )
{
/* An error has been detected in one of the tasks - flash faster. */
xDelayPeriod = mainERROR_FLASH_PERIOD;
}
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portLONG prvCheckOtherTasksAreStillRunning( void )
{
portLONG lReturn = ( portLONG ) pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = ( portLONG ) pdFAIL;
}
return lReturn;
}
/*-----------------------------------------------------------*/

View File

@@ -1,257 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
*/
/* Library includes. */
#include "uart.h"
#include "gpio.h"
#include "eic.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
/* Demo application includes. */
#include "serial.h"
#define UART0_Rx_Pin ( 0x0001<< 8 )
#define UART0_Tx_Pin ( 0x0001<< 9 )
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
/* Macros to turn on and off the Tx empty interrupt. */
#define serINTERRUPT_ON() UART0->IER |= UART_TxHalfEmpty
#define serINTERRUPT_OFF() UART0->IER &= ~UART_TxHalfEmpty
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
/*-----------------------------------------------------------*/
/* Interrupt entry point written in the assembler file serialISR.s79. */
extern void vSerialISREntry( void );
/* The interrupt service routine - called from the assembly entry point. */
__arm void vSerialISR( void );
/*-----------------------------------------------------------*/
/*
* See the serial2.h header file.
*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
xComPortHandle xReturn;
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* If the queues were created correctly then setup the serial port
hardware. */
if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) )
{
portENTER_CRITICAL();
{
/* Setup the UART port pins. */
GPIO_Config( GPIO0, UART0_Tx_Pin, GPIO_AF_PP );
GPIO_Config( GPIO0, UART0_Rx_Pin, GPIO_IN_TRI_CMOS );
/* Configure the UART. */
UART_OnOffConfig( UART0, ENABLE );
UART_FifoConfig( UART0, DISABLE );
UART_FifoReset( UART0, UART_RxFIFO );
UART_FifoReset( UART0, UART_TxFIFO );
UART_LoopBackConfig(UART0, DISABLE );
UART_Config( UART0, ulWantedBaud, UART_NO_PARITY, UART_1_StopBits, UARTM_8D );
UART_RxConfig( UART0, ENABLE );
/* Configure the IEC for the UART interrupts. */
EIC_IRQChannelPriorityConfig( UART0_IRQChannel, 1 );
EIC_IRQChannelConfig( UART0_IRQChannel, ENABLE );
EIC_IRQConfig( ENABLE );
UART_ItConfig( UART0, UART_RxBufFull, ENABLE );
}
portEXIT_CRITICAL();
}
else
{
xReturn = ( xComPortHandle ) 0;
}
/* This demo file only supports a single port but we have to return
something to comply with the standard demo header file. */
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* A couple of parameters that this port does not use. */
( void ) usStringLength;
( void ) pxPort;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
/* Place the character in the queue of characters to be transmitted. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
{
return pdFAIL;
}
/* Turn on the Tx interrupt so the ISR will remove the character from the
queue and send it. This does not need to be in a critical section as
if the interrupt has already removed the character the next interrupt
will simply turn off the Tx interrupt again. */
serINTERRUPT_ON();
return pdPASS;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
/* Not supported as not required by the demo application. */
}
/*-----------------------------------------------------------*/
/* Serial port ISR. This can cause a context switch so is not defined as a
standard ISR using the __irq keyword. Instead a wrapper function is defined
within serialISR.s79 which in turn calls this function. See the port
documentation on the FreeRTOS.org website for more information. */
__arm void vSerialISR( void )
{
unsigned portSHORT usStatus;
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt? */
usStatus = UART_FlagStatus( UART0 );
if( usStatus & UART_TxHalfEmpty )
{
/* The interrupt was caused by the THR becoming empty. Are there any
more characters to transmit? */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
/* A character was retrieved from the queue so can be sent to the
THR now. */
UART0->TxBUFR = cChar;
}
else
{
/* Queue empty, nothing to send so turn off the Tx interrupt. */
serINTERRUPT_OFF();
}
}
if( usStatus & UART_RxBufFull )
{
/* The interrupt was caused by a character being received. Grab the
character from the RHR and place it in the queue of received
characters. */
cChar = UART0->RxBUFR;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
}
/* If a task was woken by either a character being received or a character
being transmitted then we may need to switch to another task. */
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
/* End the interrupt in the EIC. */
portCLEAR_EIC();
}

View File

@@ -1,39 +0,0 @@
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1
[JLinkDriver]
WatchVectorCatch=_ 0
WatchCond=_ 0
Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
[Low Level]
Pipeline mode=0
Initialized=0
[CodeCoverage]
Enabled=_ 0
[Profiling]
Enabled=0
[StackPlugin]
Enabled=1
OverflowWarningsEnabled=1
WarningThreshold=90
SpWarningsEnabled=1
WarnHow=0
UseTrigger=1
TriggerName=main
LimitSize=0
ByteLimit=50
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
[Disassemble mode]
mode=0
[Breakpoints]
Count=0
[TraceHelper]
Enabled=0
ShowSource=1

View File

@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>RTOSDemo/Release</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>189</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build>
<ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1153</ColumnWidth1><ColumnWidth2>307</ColumnWidth2><ColumnWidth3>76</ColumnWidth3></Build>
<TerminalIO/>
<Profiling/>
<Debug-Log/>
<CodeCoveragePlugin/><Breakpoints/><Disassembly><MixedMode>1</MixedMode><CodeCovShow>0</CodeCovShow></Disassembly></Static>
<Windows>
<Wnd3>
<Tabs>
<Tab>
<Identity>TabID-14962-21036</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/source</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd3><Wnd4>
<Tabs>
<Tab>
<Identity>TabID-24623-22493</Identity>
<TabName>Build</TabName>
<Factory>Build</Factory>
<Session/>
</Tab>
<Tab>
<Identity>TabID-13645-22698</Identity>
<TabName>Debug Log</TabName>
<Factory>Debug-Log</Factory>
<Session/>
</Tab>
<Tab><Identity>TabID-25855-25419</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory><Session/></Tab></Tabs>
<SelectedTab>0</SelectedTab></Wnd4></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Demo\ARM7_STR71x_IAR\main.c</Filename><XPos>0</XPos><YPos>104</YPos><SelStart>4900</SelStart><SelEnd>4900</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-01284260><key>iaridepm.enu1</key></Toolbar-01284260></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>590</Bottom><Right>263</Right><x>-2</x><y>-2</y><xscreen>18</xscreen><yscreen>18</yscreen><sizeHorzCX>12857</sizeHorzCX><sizeHorzCY>18330</sizeHorzCY><sizeVertCX>189286</sizeVertCX><sizeVertCY>602851</sizeVertCY></Rect></Wnd3></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>348</Bottom><Right>1402</Right><x>-2</x><y>-2</y><xscreen>1404</xscreen><yscreen>350</yscreen><sizeHorzCX>1002857</sizeHorzCX><sizeHorzCY>356415</sizeHorzCY><sizeVertCX>12857</sizeVertCX><sizeVertCY>18330</sizeVertCY></Rect></Wnd4></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View File

@@ -1,95 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <75x_lib.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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 60000000 ) /* Timer clock. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 12800 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 0
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,152 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Library includes. */
#include "75x_GPIO.h"
#include "75x_map.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
/* Demo application includes. */
#include "partest.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's
*-----------------------------------------------------------*/
#define partstNUM_LEDS 4
typedef struct GPIOMAP
{
GPIO_TypeDef *pxPort;
unsigned portLONG ulPin;
unsigned portLONG ulValue;
} GPIO_MAP;
static GPIO_MAP xLEDMap[ partstNUM_LEDS ] =
{
{ ( GPIO_TypeDef * )GPIO1_BASE, GPIO_Pin_1, 0UL },
{ ( GPIO_TypeDef * )GPIO0_BASE, GPIO_Pin_16, 0UL },
{ ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_18, 0UL },
{ ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_19, 0UL }
};
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
GPIO_InitTypeDef GPIO_InitStructure ;
/* Configure the bits used to flash LED's on port 1 as output. */
/* Configure LED3 */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_16;
GPIO_Init(GPIO0,&GPIO_InitStructure);
/* Configure LED2 */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_Init(GPIO1, &GPIO_InitStructure);
/* Configure LED4 and LED5 */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_18 | GPIO_Pin_19;
GPIO_Init(GPIO2, &GPIO_InitStructure);
vParTestSetLED( 0, 0 );
vParTestSetLED( 1, 0 );
vParTestSetLED( 2, 0 );
vParTestSetLED( 3, 0 );
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED < partstNUM_LEDS )
{
portENTER_CRITICAL();
{
if( xValue )
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_RESET );
xLEDMap[ uxLED ].ulValue = 0;
}
else
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET );
xLEDMap[ uxLED ].ulValue = 1;
}
}
portEXIT_CRITICAL();
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED < partstNUM_LEDS )
{
portENTER_CRITICAL();
{
if( xLEDMap[ uxLED ].ulValue == 1 )
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_RESET );
xLEDMap[ uxLED ].ulValue = 0;
}
else
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET );
xLEDMap[ uxLED ].ulValue = 1;
}
}
portEXIT_CRITICAL();
}
}

View File

@@ -1,333 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* In addition to the standard demo tasks there are two tasks defined within
* this file:
*
* 1 - The check task
* The 'check' task is responsible for ensuring that all the standard demo
* tasks are executing as expected. It only executes every three seconds, but
* has the highest priority within the system so is guaranteed to get execution
* time. Any errors discovered by the check task are latched until the
* processor is reset. At the end of each cycle the check task sends either
* a pass or fail message to the 'print' task for display on the LCD.
*
* 2 - The print task
* The print task is the LCD 'gatekeeper'. That is, it is the only task that
* should access the LCD directly so is always guaranteed exclusive (and
* therefore consistent) access. The print task simply blocks on a queue
* to wait for messages from other tasks wishing to display text on the LCD.
* When a message arrives it displays its contents on the LCD then blocks to
* wait again.
*/
/* ST includes. */
#include "lcd.h"
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
/* Demo application includes. */
#include "partest.h"
#include "flash.h"
#include "integer.h"
#include "blocktim.h"
#include "BlockQ.h"
#include "comtest2.h"
#include "dynamic.h"
/* Demo application task priorities. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* How often should we check the other tasks? */
#define mainCHECK_TASK_CYCLE_TIME ( 3000 )
/* The maximum offset into the pass and fail strings sent to the LCD. An
offset is used a simple method of using a different column each time a message
is written to the LCD. */
#define mainMAX_WRITE_COLUMN ( 14 )
/* Baud rate used by the comtest tasks. */
#define mainCOM_TEST_BAUD_RATE ( 19200 )
/* The LED used by the comtest tasks. See the comtest.c file for more
information. */
#define mainCOM_TEST_LED ( 3 )
/* The number of messages that can be queued for display on the LCD at any one
time. */
#define mainLCD_QUEUE_LENGTH ( 2 )
/* The time to wait when sending to mainLCD_QUEUE_LENGTH. */
#define mainNO_DELAY ( 0 )
/*-----------------------------------------------------------*/
/* The type that is posted to the LCD queue. */
typedef struct LCD_MESSAGE
{
unsigned portCHAR *pucString; /* Points to the string to be displayed. */
unsigned portCHAR ucLine; /* The line of the LCD that should be used. */
} LCDMessage;
/*-----------------------------------------------------------*/
/*
* The task that executes at the highest priority and checks the operation of
* all the other tasks in the system. See the description at the top of the
* file.
*/
static void vCheckTask( void *pvParameters );
/*
* ST provided routine to configure the processor.
*/
static void prvSetupHardware(void);
/*
* The only task that should access the LCD. Other tasks wanting to write
* to the LCD should send a message of type LCDMessage containing the
* information to display to the print task. The print task simply blocks
* waiting for the arrival of such messages, displays the message, then blocks
* again.
*/
static void vPrintTask( void *pvParameters );
/*-----------------------------------------------------------*/
/* The queue used to communicate with the LCD print task. */
static xQueueHandle xLCDQueue;
/*-----------------------------------------------------------*/
/* Create all the demo application tasks, then start the scheduler. */
int main( void )
{
/* Perform any hardware setup necessary. */
prvSetupHardware();
vParTestInitialise();
/* Create the queue used to communicate with the LCD print task. */
xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) );
/* Create the standard demo application tasks. See the WEB documentation
for more information on these tasks. */
vCreateBlockTimeTasks();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartDynamicPriorityTasks();
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartIntegerMathTasks( tskIDLE_PRIORITY );
/* Create the tasks defined within this file. */
xTaskCreate( vPrintTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );
xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
vTaskStartScheduler();
/* Execution will only reach here if there was insufficient heap to
start the scheduler. */
return 0;
}
/*-----------------------------------------------------------*/
static void vCheckTask( void *pvParameters )
{
static unsigned portLONG ulErrorDetected = pdFALSE;
portTickType xLastExecutionTime;
unsigned portCHAR *ucErrorMessage = ( unsigned portCHAR * )" FAIL";
unsigned portCHAR *ucSuccessMessage = ( unsigned portCHAR * )" PASS";
unsigned portBASE_TYPE uxColumn = mainMAX_WRITE_COLUMN;
LCDMessage xMessage;
/* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
works correctly. */
xLastExecutionTime = xTaskGetTickCount();
for( ;; )
{
/* Wait until it is time for the next cycle. */
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_TASK_CYCLE_TIME );
/* Has an error been found in any of the standard demo tasks? */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
/* Calculate the LCD line on which we would like the message to
be displayed. The column variable is used for convenience as
it is incremented each cycle anyway. */
xMessage.ucLine = ( unsigned portCHAR ) ( uxColumn & 0x01 );
/* The message displayed depends on whether an error was found or
not. Any discovered error is latched. Here the column variable
is used as an index into the text string as a simple way of moving
the text from column to column. */
if( ulErrorDetected == pdFALSE )
{
xMessage.pucString = ucSuccessMessage + uxColumn;
}
else
{
xMessage.pucString = ucErrorMessage + uxColumn;
}
/* Send the message to the print task for display. */
xQueueSend( xLCDQueue, ( void * ) &xMessage, mainNO_DELAY );
/* Make sure the message is printed in a different column the next
time around. */
uxColumn--;
if( uxColumn == 0 )
{
uxColumn = mainMAX_WRITE_COLUMN;
}
}
}
/*-----------------------------------------------------------*/
static void vPrintTask( void *pvParameters )
{
LCDMessage xMessage;
for( ;; )
{
/* Wait until a message arrives. */
while( xQueueReceive( xLCDQueue, ( void * ) &xMessage, portMAX_DELAY ) != pdPASS );
/* The message contains the text to display, and the line on which the
text should be displayed. */
LCD_Clear();
LCD_DisplayString( xMessage.ucLine, xMessage.pucString, BlackText );
}
}
/*-----------------------------------------------------------*/
static void prvSetupHardware(void)
{
ErrorStatus OSC4MStartUpStatus01;
/* ST provided routine. */
/* MRCC system reset */
MRCC_DeInit();
/* Wait for OSC4M start-up */
OSC4MStartUpStatus01 = MRCC_WaitForOSC4MStartUp();
if(OSC4MStartUpStatus01 == SUCCESS)
{
/* Set HCLK to 60MHz */
MRCC_HCLKConfig(MRCC_CKSYS_Div1);
/* Set CKTIM to 60MHz */
MRCC_CKTIMConfig(MRCC_HCLK_Div1);
/* Set PCLK to 30MHz */
MRCC_PCLKConfig(MRCC_CKTIM_Div2);
/* Enable Flash Burst mode */
CFG_FLASHBurstConfig(CFG_FLASHBurst_Enable);
/* Set CK_SYS to 60 MHz */
MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);
}
/* GPIO pins optimized for 3V3 operation */
MRCC_IOVoltageRangeConfig(MRCC_IOVoltageRange_3V3);
/* GPIO clock source enable */
MRCC_PeripheralClockConfig(MRCC_Peripheral_GPIO, ENABLE);
/* EXTIT clock source enable */
MRCC_PeripheralClockConfig(MRCC_Peripheral_EXTIT, ENABLE);
/* TB clock source enable */
MRCC_PeripheralClockConfig(MRCC_Peripheral_TB, ENABLE);
/* Initialize the demonstration menu */
LCD_Init();
LCD_DisplayString(Line1, ( unsigned portCHAR * ) "www.FreeRTOS.org", BlackText);
LCD_DisplayString(Line2, ( unsigned portCHAR * ) " STR750 Demo ", BlackText);
EIC_IRQCmd(ENABLE);
}
/*-----------------------------------------------------------*/

View File

@@ -1,250 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
*/
/*-----------------------------------------------------------
* Components that can be compiled to either ARM or THUMB mode are
* contained in this file.c The ISR routines, which can only be compiled
* to ARM mode, are contained in serialISR.c.
*----------------------------------------------------------*/
/* Library includes. */
#include "75x_uart.h"
#include "75x_gpio.h"
#include "75x_eic.h"
#include "75x_mrcc.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
/* Demo application includes. */
#include "serial.h"
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static volatile portBASE_TYPE xQueueEmpty = pdTRUE;
/*-----------------------------------------------------------*/
/* The interrupt service routine - called from the assembly entry point. */
void vSerialISR( void );
void vConfigureQueues( xQueueHandle xQForRx, xQueueHandle xQForTx, volatile portBASE_TYPE *pxEmptyFlag );
/*-----------------------------------------------------------*/
/*
* See the serial2.h header file.
*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
xComPortHandle xReturn;
UART_InitTypeDef UART_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
EIC_IRQInitTypeDef EIC_IRQInitStructure;
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* If the queues were created correctly then setup the serial port
hardware. */
if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) )
{
vConfigureQueues( xRxedChars, xCharsForTx, &xQueueEmpty );
portENTER_CRITICAL();
{
/* Enable the UART0 Clock. */
MRCC_PeripheralClockConfig( MRCC_Peripheral_UART0, ENABLE );
/* Configure the UART0_Tx as alternate function */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;
GPIO_Init(GPIO0, &GPIO_InitStructure);
/* Configure the UART0_Rx as input floating */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_Init(GPIO0, &GPIO_InitStructure);
/* Configure UART0. */
UART_InitStructure.UART_WordLength = UART_WordLength_8D;
UART_InitStructure.UART_StopBits = UART_StopBits_1;
UART_InitStructure.UART_Parity = UART_Parity_No;
UART_InitStructure.UART_BaudRate = ulWantedBaud;
UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None;
UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx;
UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */
UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */
UART_Init(UART0, &UART_InitStructure);
/* Enable the UART0 */
UART_Cmd(UART0, ENABLE);
/* Configure the IEC for the UART interrupts. */
EIC_IRQInitStructure.EIC_IRQChannelCmd = ENABLE;
EIC_IRQInitStructure.EIC_IRQChannel = UART0_IRQChannel;
EIC_IRQInitStructure.EIC_IRQChannelPriority = 1;
EIC_IRQInit(&EIC_IRQInitStructure);
xQueueEmpty = pdTRUE;
UART_ITConfig( UART0, UART_IT_Transmit | UART_IT_Receive, ENABLE );
}
portEXIT_CRITICAL();
}
else
{
xReturn = ( xComPortHandle ) 0;
}
/* This demo file only supports a single port but we have to return
something to comply with the standard demo header file. */
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* A couple of parameters that this port does not use. */
( void ) usStringLength;
( void ) pxPort;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
portBASE_TYPE xReturn;
/* Place the character in the queue of characters to be transmitted. */
portENTER_CRITICAL();
{
if( xQueueEmpty == pdTRUE )
{
UART0->DR = cOutChar;
xReturn = pdPASS;
}
else
{
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
{
xReturn = pdFAIL;
}
else
{
xReturn = pdPASS;
}
}
xQueueEmpty = pdFALSE;
}
portEXIT_CRITICAL();
return xReturn;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
/* Not supported as not required by the demo application. */
}
/*-----------------------------------------------------------*/

View File

@@ -1,116 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*-----------------------------------------------------------
* Components that can be compiled to either ARM or THUMB mode are
* contained in serial.c The ISR routines, which can only be compiled
* to ARM mode, are contained in this file.
*----------------------------------------------------------*/
/* Library includes. */
#include "75x_uart.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static portBASE_TYPE volatile *pxQueueEmpty;
void vConfigureQueues( xQueueHandle xQForRx, xQueueHandle xQForTx, portBASE_TYPE volatile *pxEmptyFlag )
{
xRxedChars = xQForRx;
xCharsForTx = xQForTx;
pxQueueEmpty = pxEmptyFlag;
}
/*-----------------------------------------------------------*/
void vSerialISR( void )
{
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
do
{
if( UART0->MIS & UART_IT_Transmit )
{
/* The interrupt was caused by the THR becoming empty. Are there any
more characters to transmit? */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
/* A character was retrieved from the queue so can be sent to the
THR now. */
UART0->DR = cChar;
}
else
{
*pxQueueEmpty = pdTRUE;
}
UART_ClearITPendingBit( UART0, UART_IT_Transmit );
}
if( UART0->MIS & UART_IT_Receive )
{
/* The interrupt was caused by a character being received. Grab the
character from the RHR and place it in the queue of received
characters. */
cChar = UART0->DR;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
UART_ClearITPendingBit( UART0, UART_IT_Receive );
}
} while( UART0->MIS );
/* If a task was woken by either a character being received or a character
being transmitted then we may need to switch to another task. */
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}

View File

@@ -1,93 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 60000000 ) /* Timer clock. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 12800 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 0
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,152 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/* Library includes. */
#include "75x_GPIO.h"
#include "75x_map.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
/* Demo application includes. */
#include "partest.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's
*-----------------------------------------------------------*/
#define partstNUM_LEDS 4
typedef struct GPIOMAP
{
GPIO_TypeDef *pxPort;
unsigned portLONG ulPin;
unsigned portLONG ulValue;
} GPIO_MAP;
static GPIO_MAP xLEDMap[ partstNUM_LEDS ] =
{
{ ( GPIO_TypeDef * )GPIO1_BASE, GPIO_Pin_1, 0UL },
{ ( GPIO_TypeDef * )GPIO0_BASE, GPIO_Pin_16, 0UL },
{ ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_18, 0UL },
{ ( GPIO_TypeDef * )GPIO2_BASE, GPIO_Pin_19, 0UL }
};
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
GPIO_InitTypeDef GPIO_InitStructure ;
/* Configure the bits used to flash LED's on port 1 as output. */
/* Configure LED3 */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_16;
GPIO_Init(GPIO0,&GPIO_InitStructure);
/* Configure LED2 */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_Init(GPIO1, &GPIO_InitStructure);
/* Configure LED4 and LED5 */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_18 | GPIO_Pin_19;
GPIO_Init(GPIO2, &GPIO_InitStructure);
vParTestSetLED( 0, 0 );
vParTestSetLED( 1, 0 );
vParTestSetLED( 2, 0 );
vParTestSetLED( 3, 0 );
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED < partstNUM_LEDS )
{
portENTER_CRITICAL();
{
if( xValue )
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_RESET );
xLEDMap[ uxLED ].ulValue = 0;
}
else
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET );
xLEDMap[ uxLED ].ulValue = 1;
}
}
portEXIT_CRITICAL();
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED < partstNUM_LEDS )
{
portENTER_CRITICAL();
{
if( xLEDMap[ uxLED ].ulValue == 1 )
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_RESET );
xLEDMap[ uxLED ].ulValue = 0;
}
else
{
GPIO_WriteBit( xLEDMap[ uxLED ].pxPort, xLEDMap[ uxLED ].ulPin, Bit_SET );
xLEDMap[ uxLED ].ulValue = 1;
}
}
portEXIT_CRITICAL();
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,330 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* In addition to the standard demo tasks there are two tasks defined within
* this file:
*
* 1 - The check task
* The 'check' task is responsible for ensuring that all the standard demo
* tasks are executing as expected. It only executes every three seconds, but
* has the highest priority within the system so is guaranteed to get execution
* time. Any errors discovered by the check task are latched until the
* processor is reset. At the end of each cycle the check task sends either
* a pass or fail message to the 'print' task for display on the LCD.
*
* 2 - The print task
* The print task is the LCD 'gatekeeper'. That is, it is the only task that
* should access the LCD directly so is always guaranteed exclusive (and
* therefore consistent) access. The print task simply blocks on a queue
* to wait for messages from other tasks wishing to display text on the LCD.
* When a message arrives it displays its contents on the LCD then blocks to
* wait again.
*/
/* ST includes. */
#include "lcd.h"
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
/* Demo application includes. */
#include "partest.h"
#include "flash.h"
#include "integer.h"
#include "blocktim.h"
#include "BlockQ.h"
#include "comtest2.h"
#include "dynamic.h"
/* Demo application task priorities. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* How often should we check the other tasks? */
#define mainCHECK_TASK_CYCLE_TIME ( 3000 )
/* The maximum offset into the pass and fail strings sent to the LCD. An
offset is used a simple method of using a different column each time a message
is written to the LCD. */
#define mainMAX_WRITE_COLUMN ( 14 )
/* Baud rate used by the comtest tasks. */
#define mainCOM_TEST_BAUD_RATE ( 19200 )
/* The LED used by the comtest tasks. See the comtest.c file for more
information. */
#define mainCOM_TEST_LED ( 3 )
/* The number of messages that can be queued for display on the LCD at any one
time. */
#define mainLCD_QUEUE_LENGTH ( 2 )
/* The time to wait when sending to mainLCD_QUEUE_LENGTH. */
#define mainNO_DELAY ( 0 )
/*-----------------------------------------------------------*/
/* The type that is posted to the LCD queue. */
typedef struct LCD_MESSAGE
{
unsigned portCHAR *pucString; /* Points to the string to be displayed. */
unsigned portCHAR ucLine; /* The line of the LCD that should be used. */
} LCDMessage;
/*-----------------------------------------------------------*/
/*
* The task that executes at the highest priority and checks the operation of
* all the other tasks in the system. See the description at the top of the
* file.
*/
static void vCheckTask( void *pvParameters );
/*
* ST provided routine to configure the processor.
*/
static void prvSetupHardware(void);
/*
* The only task that should access the LCD. Other tasks wanting to write
* to the LCD should send a message of type LCDMessage containing the
* information to display to the print task. The print task simply blocks
* waiting for the arrival of such messages, displays the message, then blocks
* again.
*/
static void vPrintTask( void *pvParameters );
/*-----------------------------------------------------------*/
/* The queue used to communicate with the LCD print task. */
static xQueueHandle xLCDQueue;
/*-----------------------------------------------------------*/
/* Create all the demo application tasks, then start the scheduler. */
void main( void )
{
/* Perform any hardware setup necessary. */
prvSetupHardware();
vParTestInitialise();
/* Create the queue used to communicate with the LCD print task. */
xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) );
/* Create the standard demo application tasks. See the WEB documentation
for more information on these tasks. */
vCreateBlockTimeTasks();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartDynamicPriorityTasks();
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartIntegerMathTasks( tskIDLE_PRIORITY );
/* Create the tasks defined within this file. */
xTaskCreate( vPrintTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );
xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
vTaskStartScheduler();
/* Execution will only reach here if there was insufficient heap to
start the scheduler. */
}
/*-----------------------------------------------------------*/
static void vCheckTask( void *pvParameters )
{
static unsigned portLONG ulErrorDetected = pdFALSE;
portTickType xLastExecutionTime;
unsigned portCHAR *cErrorMessage = " FAIL";
unsigned portCHAR *cSuccessMessage = " PASS";
unsigned portBASE_TYPE uxColumn = mainMAX_WRITE_COLUMN;
LCDMessage xMessage;
/* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
works correctly. */
xLastExecutionTime = xTaskGetTickCount();
for( ;; )
{
/* Wait until it is time for the next cycle. */
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_TASK_CYCLE_TIME );
/* Has an error been found in any of the standard demo tasks? */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorDetected = pdTRUE;
}
/* Calculate the LCD line on which we would like the message to
be displayed. The column variable is used for convenience as
it is incremented each cycle anyway. */
xMessage.ucLine = ( unsigned portCHAR ) ( uxColumn & 0x01 );
/* The message displayed depends on whether an error was found or
not. Any discovered error is latched. Here the column variable
is used as an index into the text string as a simple way of moving
the text from column to column. */
if( ulErrorDetected == pdFALSE )
{
xMessage.pucString = cSuccessMessage + uxColumn;
}
else
{
xMessage.pucString = cErrorMessage + uxColumn;
}
/* Send the message to the print task for display. */
xQueueSend( xLCDQueue, ( void * ) &xMessage, mainNO_DELAY );
/* Make sure the message is printed in a different column the next
time around. */
uxColumn--;
if( uxColumn == 0 )
{
uxColumn = mainMAX_WRITE_COLUMN;
}
}
}
/*-----------------------------------------------------------*/
static void vPrintTask( void *pvParameters )
{
LCDMessage xMessage;
for( ;; )
{
/* Wait until a message arrives. */
while( xQueueReceive( xLCDQueue, ( void * ) &xMessage, portMAX_DELAY ) != pdPASS );
/* The message contains the text to display, and the line on which the
text should be displayed. */
LCD_Clear();
LCD_DisplayString( xMessage.ucLine, xMessage.pucString, BlackText );
}
}
/*-----------------------------------------------------------*/
static void prvSetupHardware(void)
{
ErrorStatus OSC4MStartUpStatus01;
/* ST provided routine. */
/* MRCC system reset */
MRCC_DeInit();
/* Wait for OSC4M start-up */
OSC4MStartUpStatus01 = MRCC_WaitForOSC4MStartUp();
if(OSC4MStartUpStatus01 == SUCCESS)
{
/* Set HCLK to 60MHz */
MRCC_HCLKConfig(MRCC_CKSYS_Div1);
/* Set CKTIM to 60MHz */
MRCC_CKTIMConfig(MRCC_HCLK_Div1);
/* Set PCLK to 30MHz */
MRCC_PCLKConfig(MRCC_CKTIM_Div2);
/* Enable Flash Burst mode */
CFG_FLASHBurstConfig(CFG_FLASHBurst_Enable);
/* Set CK_SYS to 60 MHz */
MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);
}
/* GPIO pins optimized for 3V3 operation */
MRCC_IOVoltageRangeConfig(MRCC_IOVoltageRange_3V3);
/* GPIO clock source enable */
MRCC_PeripheralClockConfig(MRCC_Peripheral_GPIO, ENABLE);
/* EXTIT clock source enable */
MRCC_PeripheralClockConfig(MRCC_Peripheral_EXTIT, ENABLE);
/* TB clock source enable */
MRCC_PeripheralClockConfig(MRCC_Peripheral_TB, ENABLE);
/* Initialize the demonstration menu */
LCD_Init();
LCD_DisplayString(Line1, "www.FreeRTOS.org", BlackText);
LCD_DisplayString(Line2, " STR750 Demo ", BlackText);
EIC_IRQCmd(ENABLE);
}
/*-----------------------------------------------------------*/

View File

@@ -1,278 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
*/
/* Library includes. */
#include "75x_uart.h"
#include "75x_gpio.h"
#include "75x_eic.h"
#include "75x_mrcc.h"
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"
/* Demo application includes. */
#include "serial.h"
#define serINVALID_QUEUE ( ( xQueueHandle ) 0 )
#define serNO_BLOCK ( ( portTickType ) 0 )
/*-----------------------------------------------------------*/
/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
static volatile portBASE_TYPE xQueueEmpty = pdTRUE;
/*-----------------------------------------------------------*/
/* The interrupt service routine - called from the assembly entry point. */
__arm void vSerialISR( void );
/*-----------------------------------------------------------*/
/*
* See the serial2.h header file.
*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
xComPortHandle xReturn;
UART_InitTypeDef UART_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
EIC_IRQInitTypeDef EIC_IRQInitStructure;
/* Create the queues used to hold Rx and Tx characters. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
/* If the queues were created correctly then setup the serial port
hardware. */
if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) )
{
portENTER_CRITICAL();
{
/* Enable the UART0 Clock. */
MRCC_PeripheralClockConfig( MRCC_Peripheral_UART0, ENABLE );
/* Configure the UART0_Tx as alternate function */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;
GPIO_Init(GPIO0, &GPIO_InitStructure);
/* Configure the UART0_Rx as input floating */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_Init(GPIO0, &GPIO_InitStructure);
/* Configure UART0. */
UART_InitStructure.UART_WordLength = UART_WordLength_8D;
UART_InitStructure.UART_StopBits = UART_StopBits_1;
UART_InitStructure.UART_Parity = UART_Parity_No;
UART_InitStructure.UART_BaudRate = ulWantedBaud;
UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None;
UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx;
UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */
UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */
UART_Init(UART0, &UART_InitStructure);
/* Enable the UART0 */
UART_Cmd(UART0, ENABLE);
/* Configure the IEC for the UART interrupts. */
EIC_IRQInitStructure.EIC_IRQChannelCmd = ENABLE;
EIC_IRQInitStructure.EIC_IRQChannel = UART0_IRQChannel;
EIC_IRQInitStructure.EIC_IRQChannelPriority = 1;
EIC_IRQInit(&EIC_IRQInitStructure);
xQueueEmpty = pdTRUE;
UART_ITConfig( UART0, UART_IT_Transmit | UART_IT_Receive, ENABLE );
}
portEXIT_CRITICAL();
}
else
{
xReturn = ( xComPortHandle ) 0;
}
/* This demo file only supports a single port but we have to return
something to comply with the standard demo header file. */
return xReturn;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
/* The port handle is not required as this driver only supports one port. */
( void ) pxPort;
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;
/* A couple of parameters that this port does not use. */
( void ) usStringLength;
( void ) pxPort;
/* NOTE: This implementation does not handle the queue being full as no
block time is used! */
/* The port handle is not required as this driver only supports UART0. */
( void ) pxPort;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
pxNext++;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
portBASE_TYPE xReturn;
/* Place the character in the queue of characters to be transmitted. */
portENTER_CRITICAL();
{
if( xQueueEmpty == pdTRUE )
{
UART0->DR = cOutChar;
xReturn = pdPASS;
}
else
{
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
{
xReturn = pdFAIL;
}
else
{
xReturn = pdPASS;
}
}
xQueueEmpty = pdFALSE;
}
portEXIT_CRITICAL();
return xReturn;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
/* Not supported as not required by the demo application. */
}
/*-----------------------------------------------------------*/
__arm void vSerialISR( void )
{
signed portCHAR cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
do
{
if( UART0->MIS & UART_IT_Transmit )
{
/* The interrupt was caused by the THR becoming empty. Are there any
more characters to transmit? */
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
{
/* A character was retrieved from the queue so can be sent to the
THR now. */
UART0->DR = cChar;
}
else
{
xQueueEmpty = pdTRUE;
}
UART_ClearITPendingBit( UART0, UART_IT_Transmit );
}
if( UART0->MIS & UART_IT_Receive )
{
/* The interrupt was caused by a character being received. Grab the
character from the RHR and place it in the queue of received
characters. */
cChar = UART0->DR;
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
UART_ClearITPendingBit( UART0, UART_IT_Receive );
}
} while( UART0->MIS );
/* If a task was woken by either a character being received or a character
being transmitted then we may need to switch to another task. */
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}

View File

@@ -1,44 +0,0 @@
[JLinkDriver]
WatchCond=_ 0
Watch0=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
Watch1=_ 0 "" 0 "" 0 "" 0 "" 0 0 0 0
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1
[StackPlugin]
Enabled=1
OverflowWarningsEnabled=1
WarningThreshold=90
SpWarningsEnabled=1
WarnHow=0
UseTrigger=1
TriggerName=main
LimitSize=0
ByteLimit=50
[Interrupts]
Enabled=1
[MemoryMap]
Enabled=0
Base=0
UseAuto=0
TypeViolation=1
UnspecRange=1
ActionState=1
[CodeCoverage]
Enabled=_ 0
[Profiling]
Enabled=0
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
[Disassemble mode]
mode=0
[Breakpoints]
Count=0
[TraceHelper]
Enabled=0
ShowSource=1

View File

@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>RTOSDemo/Release</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>224</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build>
<PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Find-in-Files</Factory></Window><Window><Factory>Debug-Log</Factory></Window><Window><Factory>Breakpoints</Factory></Window></Windows></PreferedWindows><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1004</ColumnWidth1><ColumnWidth2>267</ColumnWidth2><ColumnWidth3>66</ColumnWidth3></Build>
<Find-in-Files>
<ColumnWidth0>482</ColumnWidth0><ColumnWidth1>68</ColumnWidth1><ColumnWidth2>826</ColumnWidth2><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window><Window><Factory>Debug-Log</Factory></Window><Window><Factory>Breakpoints</Factory></Window></Windows></PreferedWindows></Find-in-Files>
<Debug-Log><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window><Window><Factory>Find-in-Files</Factory></Window><Window><Factory>Breakpoints</Factory></Window></Windows></PreferedWindows></Debug-Log>
<TerminalIO/>
<Profiling/>
<Disassembly><CodeCovEnabled>0</CodeCovEnabled><MixedMode>1</MixedMode><CodeCovShow>0</CodeCovShow></Disassembly><Breakpoints><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window><Window><Factory>Find-in-Files</Factory></Window><Window><Factory>Debug-Log</Factory></Window></Windows></PreferedWindows></Breakpoints></Static>
<Windows>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-5322-15070</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/source</ExpandedNode><ExpandedNode>RTOSDemo/startup</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3><Tabs><Tab><Identity>TabID-10308-14988</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab><Tab><Identity>TabID-11884-28246</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory><Session/></Tab><Tab><Identity>TabID-30248-21129</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\temp\rc\1\Demo\ARM7_STR75x_IAR\main.c</Filename><XPos>0</XPos><YPos>126</YPos><SelStart>5518</SelStart><SelEnd>5518</SelEnd></Tab><ActiveTab>0</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-01284318><key>iaridepm.enu1</key></Toolbar-01284318></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>715</Bottom><Right>298</Right><x>-2</x><y>-2</y><xscreen>0</xscreen><yscreen>0</yscreen><sizeHorzCX>0</sizeHorzCX><sizeHorzCY>0</sizeHorzCY><sizeVertCX>214286</sizeVertCX><sizeVertCY>730143</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>223</Bottom><Right>1402</Right><x>-2</x><y>-2</y><xscreen>1404</xscreen><yscreen>225</yscreen><sizeHorzCX>1002857</sizeHorzCX><sizeHorzCY>229124</sizeHorzCY><sizeVertCX>142857</sizeVertCX><sizeVertCY>205703</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View File

@@ -1,104 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include "board.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 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) BOARD_MCK )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 190 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40000 ) )
#define configMAX_TASK_NAME_LEN ( 12 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 10
#define configUSE_COUNTING_SEMAPHORES 1
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 6 )
#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 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define configYIELD_INTERRUPT_VECTOR 16UL
#define configKERNEL_INTERRUPT_PRIORITY 1
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
void vApplicationSetupInterrupts( void );
#endif /* FREERTOS_CONFIG_H */

View File

@@ -1,94 +0,0 @@
/*
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd.
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 exception 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.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
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. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
#include "FreeRTOS.h"
#include "partest.h"
#include "led.h"
#define partstNUM_LEDS ( 4 )
/*-----------------------------------------------------------
* Simple parallel port IO routines for the LED's.
*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
unsigned long ul;
for( ul = 0; ul < partstNUM_LEDS; ul++ )
{
LED_Configure( ul );
}
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
if( uxLED < partstNUM_LEDS )
{
if( xValue == 0 )
{
LED_Clear( uxLED );
}
else
{
LED_Set( uxLED );
}
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
if( uxLED < partstNUM_LEDS )
{
LED_Toggle( uxLED );
}
}

Some files were not shown because too many files have changed in this diff Show More