]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c
Beginnings of a project to build the GCC Cortex-A port targeting a Zynq.
[freertos] / FreeRTOS / Demo / CORTEX_A9_Zynq_ZC702 / RTOSDemo / src / main.c
1 /*
2     FreeRTOS V8.0.0:rc2 - Copyright (C) 2014 Real Time Engineers Ltd.
3     All rights reserved
4
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6
7     ***************************************************************************
8      *                                                                       *
9      *    FreeRTOS provides completely free yet professionally developed,    *
10      *    robust, strictly quality controlled, supported, and cross          *
11      *    platform software that has become a de facto standard.             *
12      *                                                                       *
13      *    Help yourself get started quickly and support the FreeRTOS         *
14      *    project by purchasing a FreeRTOS tutorial book, reference          *
15      *    manual, or both from: http://www.FreeRTOS.org/Documentation        *
16      *                                                                       *
17      *    Thank you!                                                         *
18      *                                                                       *
19     ***************************************************************************
20
21     This file is part of the FreeRTOS distribution.
22
23     FreeRTOS is free software; you can redistribute it and/or modify it under
24     the terms of the GNU General Public License (version 2) as published by the
25     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
26
27     >>! NOTE: The modification to the GPL is included to allow you to distribute
28     >>! a combined work that includes FreeRTOS without being obliged to provide
29     >>! the source code for proprietary components outside of the FreeRTOS
30     >>! kernel.
31
32     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
33     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
34     FOR A PARTICULAR PURPOSE.  Full license text is available from the following
35     link: http://www.freertos.org/a00114.html
36
37     1 tab == 4 spaces!
38
39     ***************************************************************************
40      *                                                                       *
41      *    Having a problem?  Start by reading the FAQ "My application does   *
42      *    not run, what could be wrong?"                                     *
43      *                                                                       *
44      *    http://www.FreeRTOS.org/FAQHelp.html                               *
45      *                                                                       *
46     ***************************************************************************
47
48     http://www.FreeRTOS.org - Documentation, books, training, latest versions,
49     license and Real Time Engineers Ltd. contact details.
50
51     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
52     including FreeRTOS+Trace - an indispensable productivity tool, a DOS
53     compatible FAT file system, and our tiny thread aware UDP/IP stack.
54
55     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
56     Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS
57     licenses offer ticketed support, indemnification and middleware.
58
59     http://www.SafeRTOS.com - High Integrity Systems also provide a safety
60     engineered and independently SIL3 certified version for use in safety and
61     mission critical applications that require provable dependability.
62
63     1 tab == 4 spaces!
64 */
65
66 /******************************************************************************
67  * This project provides two demo applications.  A simple blinky style project,
68  * and a more comprehensive test and demo application.  The
69  * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting (defined in this file) is used to
70  * select between the two.  The simply blinky demo is implemented and described
71  * in main_blinky.c.  The more comprehensive test and demo application is
72  * implemented and described in main_full.c.
73  *
74  * This file implements the code that is not demo specific, including the
75  * hardware setup and FreeRTOS hook functions.
76  *
77  * ENSURE TO READ THE DOCUMENTATION PAGE FOR THIS PORT AND DEMO APPLICATION ON
78  * THE http://www.FreeRTOS.org WEB SITE FOR FULL INFORMATION ON USING THIS DEMO
79  * APPLICATION, AND ITS ASSOCIATE FreeRTOS ARCHITECTURE PORT!
80  *
81  */
82
83 /* Standard includes. */
84 #include <stdio.h>
85
86 /* Scheduler include files. */
87 #include "FreeRTOS.h"
88 #include "task.h"
89 #include "semphr.h"
90
91 /* Standard demo includes. */
92 #include "partest.h"
93 #include "TimerDemo.h"
94 #include "QueueOverwrite.h"
95
96 /* Xilinx includes. */
97 #include "platform.h"
98 #include "xparameters.h"
99 #include "xscutimer.h"
100 #include "xscugic.h"
101 #include "xil_exception.h"
102
103 int main()
104 {
105     init_platform();
106
107     print("Hello World\n\r");
108
109     return 0;
110 }
111
112 void vAssertCalled( const char * pcFile, unsigned long ulLine )
113 {
114         ( void ) pcFile;
115         ( void ) ulLine;
116 }
117
118
119 void vConfigureTickInterrupt( void )
120 {
121 }
122
123 static void prvSetupHardware( void )
124 {
125         Xil_ExceptionInit();
126
127         /*
128          * Connect the interrupt controller interrupt handler to the hardware
129          * interrupt handling logic in the ARM processor.
130          */
131 #if 0
132         Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_UNDEFINED_INT,
133                         (Xil_ExceptionHandler)FreeRTOS_ExHandler,
134                         (void *)4);
135
136         Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_PREFETCH_ABORT_INT,
137                         (Xil_ExceptionHandler)FreeRTOS_ExHandler,
138                         (void *)4);
139
140         Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_DATA_ABORT_INT,
141                         (Xil_ExceptionHandler)FreeRTOS_ExHandler,
142                         (void *)8);
143 #endif
144 }
145
146
147 void vApplicationIdleHook( void )
148 {
149 }
150
151 void vApplicationStackOverflowHook( TaskHandle_t xTask, const char * pcTaskName )
152 {
153 }
154
155 void vApplicationTickHook( void )
156 {
157 }
158
159 void vApplicationIRQHandler( uint32_t ulICCIAR )
160 {
161 uint32_t ulInterruptID;
162
163         /* Re-enable interrupts. */
164     __asm ( "cpsie i" );
165
166         /* The ID of the interrupt can be obtained by bitwise anding the ICCIAR value
167         with 0x3FF. */
168         ulInterruptID = ulICCIAR & 0x3FFUL;
169
170         /* Call the function installed in the array of installed handler functions. */
171 //      intc_func_table[ ulInterruptID ]( 0 );
172 }