-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.cpp
More file actions
85 lines (69 loc) · 1.91 KB
/
Copy pathmain.cpp
File metadata and controls
85 lines (69 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Copyright (c) 2013-2017, German Aerospace Center (DLR)
*
* This file is part of the development version of OUTPOST.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Authors:
* - 2013-2017, Fabian Greif (DLR RY-AVS)
*/
/**
* \file
* \author Fabian Greif
*
* \copyright German Aerospace Center (DLR)
*
* \brief RTEMS usage example for the Nexys3 (LEON3).
*/
#include <cstring>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <outpost/rtos/thread.h>
#include <bsp.h>
#include <rtems.h>
void
fatalErrorHandler(Internal_errors_Source source, bool isInternal, uint32_t errorCode);
rtems_extensions_table User_extensions = {
NULL, // task_create_extension,
NULL, // task_start_extension
NULL, // task_restart_extension
NULL, // task_delete_extension,
NULL, // task_switch_extension,
NULL, // task_begin_extension
NULL, // task_exitted_extension
&fatalErrorHandler // fatal_extension
};
#define CONFIGURE_INITIAL_EXTENSIONS User_extensions
#define CONFIGURE_INIT
#include "system.h"
void
fatalErrorHandler(Internal_errors_Source source, bool isInternal, uint32_t errorCode)
{
printf("Fatal error handler: %i, %i, %ld\n", source, isInternal, errorCode);
while (1)
{
}
}
// ----------------------------------------------------------------------------
/*
* Set up the environment.
*/
rtems_task
task_system_init(rtems_task_argument /*ignored*/)
{
// NOTE:
// apbuart0 - debug messages (only accessible via printk(...))
// apbuart1 - receive/transmit tc and tm
FILE* uart2 = fopen("/dev/apbuart1", "w");
fprintf(uart2, "Hello World!!\r\n");
printk("Hello World!!!\r\n");
while (1)
{
}
rtems_task_delete(RTEMS_SELF);
}