Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Alexandre Malecot
freertos-cu-gps
Commits
7cabcb68
Commit
7cabcb68
authored
Jun 11, 2018
by
Colin González
Browse files
Trivial application
parent
3df7266b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
104 deletions
+14
-104
src/FreeRTOSConfig.h
src/FreeRTOSConfig.h
+3
-21
src/main.c
src/main.c
+11
-83
No files found.
src/FreeRTOSConfig.h
View file @
7cabcb68
...
...
@@ -6,7 +6,6 @@
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
/* #define configUSE_TIMERS 0 */
#define configMAX_PRIORITIES ( 6 )
#define configMINIMAL_STACK_SIZE ( (unsigned short) 128 )
#define configTOTAL_HEAP_SIZE ( (size_t) (20480) )
...
...
@@ -27,25 +26,8 @@
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
/* This is the raw value as per the Cortex-M3 NVIC. Values can be 255
(lowest) to 0 (1?) (highest). */
#define configKERNEL_INTERRUPT_PRIORITY 255
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191
/* equivalent to 0xb0, or priority 11. */
/* This is the value being used as per the ST library which permits 16
priority values, 0 to 15. This must correspond to the
configKERNEL_INTERRUPT_PRIORITY setting. Here 15 corresponds to the lowest
NVIC value of 255. */
#define configLIBRARY_KERNEL_INTERRUPT_PRIORITY 15
/* #define configYIELD_INTERRUPT_VECTOR 16UL */
/* #define configKERNEL_INTERRUPT_PRIORITY 1 */
/* #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 */
/* void vApplicationSetupInterrupts( void ); */
#define configYIELD_INTERRUPT_VECTOR 16UL
#define configKERNEL_INTERRUPT_PRIORITY 1
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
#endif
src/main.c
View file @
7cabcb68
...
...
@@ -10,101 +10,29 @@
#include <FreeRTOS.h>
#include <task.h>
/* type nom_de_fonction (type2 param1, type3 param2) { */
/* } */
/* typedef struct structure_struct { */
/* int val1; */
/* } structure_type; */
/* structure_type inc(structure_type x) { */
/* structure_type a; */
/* a.val1 = x.val1+1; */
/* return a; */
/* } */
/* int adds_one (int x) { */
/* return x++; */
/* } */
/* int times_two (int x) { */
/* return (x * 2); */
/* } */
/* int times_two_plus_one (int x){ */
/* return (adds_one(times_two(x))); */
/* } */
/* int test_times_two (int input , int expected){ */
/* int x = times_two (input); */
/* return (x == expected); */
/* } */
/* int many_test (void) { */
/* printf("many test"); */
/* int i; */
/* for (i=0; i<10; i++){ */
/* int x = i * 2; */
/* if (test_times_two(i, x)){ */
/* printf("Test succeeded with %d\n\r", i); */
/* }else{ */
/* printf("Test didn't succeed with %d\n\r", i); */
/* return 0; */
/* } */
/* } */
/* return 1; */
/* } */
void
task1
(
void
*
pParam
)
{
int
i
=
0
;
while
(
1
)
{
i
++
;
LED_
Set
(
1
);
vTaskDelay
(
2
00
);
LED_
Toggle
(
1
);
vTaskDelay
(
5
00
);
}
}
void
task2
(
void
*
pParam
)
{
int
i
=
0
;
while
(
1
)
{
i
++
;
vTaskDelay
(
100
);
LED_Clear
(
1
);
vTaskDelay
(
100
);
}
}
void
ConfigureLeds
(
void
)
{
LED_Configure
(
1
);
LED_Configure
(
1
);
}
/* static void prvSetupHardware (void) { */
/* AT91C_BASE_AIC->AIC_EOICR = 0; */
/* ConfigureLeds(); */
/* } */
int
main
()
{
/* TRACE_CONFIGURE(DBGU_STANDARD, 115200, BOARD_MCK); */
/* printf("-- Template project %s --\n\r", SOFTPACK_VERSION); */
/* printf("-- %s\n\r", BOARD_NAME); */
/* printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__); */
/* printf("--Testish\n\r"); */
/* int x = many_test(); */
/* printf("--Testouch %d \n\r", x); */
TRACE_CONFIGURE
(
DBGU_STANDARD
,
115200
,
BOARD_MCK
);
printf
(
"-- Template project %s --
\n\r
"
,
SOFTPACK_VERSION
);
printf
(
"-- %s
\n\r
"
,
BOARD_NAME
);
printf
(
"-- Compiled: %s %s --
\n\r
"
,
__DATE__
,
__TIME__
);
ConfigureLeds
();
LED_Set
(
1
);
xTaskCreate
(
task1
,
"LED_0"
,
128
,
NULL
,
0
,
NULL
);
xTaskCreate
(
task2
,
"LED_1"
,
128
,
NULL
,
0
,
NULL
);
xTaskCreate
(
task1
,
"TASK_1"
,
128
,
NULL
,
0
,
NULL
);
vTaskStartScheduler
();
/*
* We should never get here, but just in case something goes wrong,
* we'll place the CPU into a safe loop.
*/
while
(
1
)
{
}
return
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment