@@ -1,6 +1,6 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw-gsa | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Ju |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Jul 5 12:17:39 2013 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
@@ -10,7 +10,7 | |||||
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 |
DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4= |
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DGSA | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header | |
@@ -78,9 +78,9 DIST = /usr/lib64/qt4/mkspecs/c | |||||
78 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
78 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
79 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
79 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
80 | fsw-qt.pro |
|
80 | fsw-qt.pro | |
81 | QMAKE_TARGET = fsw |
|
81 | QMAKE_TARGET = fsw-gsa | |
82 | DESTDIR = bin/ |
|
82 | DESTDIR = bin/ | |
83 | TARGET = bin/fsw |
|
83 | TARGET = bin/fsw-gsa | |
84 |
|
84 | |||
85 | first: all |
|
85 | first: all | |
86 | ####### Implicit rules |
|
86 | ####### Implicit rules | |
@@ -159,8 +159,8 qmake: FORCE | |||||
159 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
159 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
160 |
|
160 | |||
161 | dist: |
|
161 | dist: | |
162 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 |
|
162 | @$(CHK_DIR_EXISTS) obj/fsw-gsa1.0.0 || $(MKDIR) obj/fsw-gsa1.0.0 | |
163 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0 |
|
163 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw-gsa1.0.0/ && (cd `dirname obj/fsw-gsa1.0.0` && $(TAR) fsw-gsa1.0.0.tar fsw-gsa1.0.0 && $(COMPRESS) fsw-gsa1.0.0.tar) && $(MOVE) `dirname obj/fsw-gsa1.0.0`/fsw-gsa1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw-gsa1.0.0 | |
164 |
|
164 | |||
165 |
|
165 | |||
166 | clean:compiler_clean |
|
166 | clean:compiler_clean |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -1,7 +1,7 | |||||
1 | TEMPLATE = app |
|
1 | TEMPLATE = app | |
2 | # CONFIG += console v8 sim |
|
2 | # CONFIG += console v8 sim | |
3 | # CONFIG options = verbose *** cpu_usage_report *** gsa |
|
3 | # CONFIG options = verbose *** cpu_usage_report *** gsa | |
4 | CONFIG += console verbose |
|
4 | CONFIG += console verbose gsa | |
5 | CONFIG -= qt |
|
5 | CONFIG -= qt | |
6 |
|
6 | |||
7 | include(./sparc.pri) |
|
7 | include(./sparc.pri) |
@@ -1,6 +1,6 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by Qt Creator 2.4.1, 2013-07-05T |
|
3 | <!-- Written by Qt Creator 2.4.1, 2013-07-05T13:31:36. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -53,7 +53,7 void init_default_mode_parameters( void | |||||
53 | void init_housekeeping_parameters( void ); |
|
53 | void init_housekeeping_parameters( void ); | |
54 |
|
54 | |||
55 | int spacewire_configure_link( void ); |
|
55 | int spacewire_configure_link( void ); | |
56 |
int spacewire_ |
|
56 | int spacewire_wait_for_link(void); | |
57 | void spacewire_set_NP(unsigned char val, unsigned int regAddr); // No Port force |
|
57 | void spacewire_set_NP(unsigned char val, unsigned int regAddr); // No Port force | |
58 | void spacewire_set_RE(unsigned char val, unsigned int regAddr); // RMAP Enable |
|
58 | void spacewire_set_RE(unsigned char val, unsigned int regAddr); // RMAP Enable | |
59 | void spacewire_compute_stats_offsets(); |
|
59 | void spacewire_compute_stats_offsets(); |
@@ -20,7 +20,7 int configure_timer(gptimer_regs_t *gpti | |||||
20 | void update_spacewire_statistics(); |
|
20 | void update_spacewire_statistics(); | |
21 |
|
21 | |||
22 | // SERIAL LINK |
|
22 | // SERIAL LINK | |
23 |
int send_console_outputs_on_ |
|
23 | int send_console_outputs_on_apbuart_port( void ); | |
24 | int set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value); |
|
24 | int set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value); | |
25 |
|
25 | |||
26 | // RTEMS TASKS |
|
26 | // RTEMS TASKS |
@@ -50,7 +50,7 | |||||
50 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 |
|
50 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 | |
51 |
|
51 | |||
52 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff |
|
52 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff | |
53 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 |
|
53 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50) | |
54 |
|
54 | |||
55 | //********** |
|
55 | //********** | |
56 | // IRQ LINES |
|
56 | // IRQ LINES |
@@ -3,46 +3,53 | |||||
3 |
|
3 | |||
4 | #define NB_GPTIMER 3 |
|
4 | #define NB_GPTIMER 3 | |
5 |
|
5 | |||
6 | struct apbuart_regs_str{ |
|
6 | struct apbuart_regs_str{ | |
7 | volatile unsigned int data; |
|
7 | volatile unsigned int data; | |
8 | volatile unsigned int status; |
|
8 | volatile unsigned int status; | |
9 | volatile unsigned int ctrl; |
|
9 | volatile unsigned int ctrl; | |
10 | volatile unsigned int scaler; |
|
10 | volatile unsigned int scaler; | |
11 | volatile unsigned int fifoDebug; |
|
11 | volatile unsigned int fifoDebug; | |
12 | }; |
|
12 | }; | |
13 |
|
13 | |||
14 |
struct |
|
14 | struct ahbuart_regs_str{ | |
|
15 | volatile unsigned int unused; | |||
|
16 | volatile unsigned int status; | |||
|
17 | volatile unsigned int ctrl; | |||
|
18 | volatile unsigned int scaler; | |||
|
19 | }; | |||
|
20 | ||||
|
21 | struct timer_regs_str | |||
15 | { |
|
22 | { | |
16 | volatile unsigned int counter; |
|
23 | volatile unsigned int counter; | |
17 | volatile unsigned int reload; |
|
24 | volatile unsigned int reload; | |
18 | volatile unsigned int ctrl; |
|
25 | volatile unsigned int ctrl; | |
19 | volatile unsigned int unused; |
|
26 | volatile unsigned int unused; | |
20 | }; |
|
27 | }; | |
21 | typedef struct timer_regs_str timer_regs_t; |
|
28 | typedef struct timer_regs_str timer_regs_t; | |
22 |
|
29 | |||
23 | struct gptimer_regs_str |
|
30 | struct gptimer_regs_str | |
24 | { |
|
31 | { | |
25 | volatile unsigned int scaler_value; |
|
32 | volatile unsigned int scaler_value; | |
26 | volatile unsigned int scaler_reload; |
|
33 | volatile unsigned int scaler_reload; | |
27 | volatile unsigned int conf; |
|
34 | volatile unsigned int conf; | |
28 | volatile unsigned int unused0; |
|
35 | volatile unsigned int unused0; | |
29 | timer_regs_t timer[NB_GPTIMER]; |
|
36 | timer_regs_t timer[NB_GPTIMER]; | |
30 | }; |
|
37 | }; | |
31 | typedef struct gptimer_regs_str gptimer_regs_t; |
|
38 | typedef struct gptimer_regs_str gptimer_regs_t; | |
32 |
|
39 | |||
33 | struct spectral_matrices_regs_str{ |
|
40 | struct spectral_matrices_regs_str{ | |
34 | volatile int ctrl; |
|
41 | volatile int ctrl; | |
35 | volatile int address0; |
|
42 | volatile int address0; | |
36 | volatile int address1; |
|
43 | volatile int address1; | |
37 | }; |
|
44 | }; | |
38 | typedef struct spectral_matrices_regs_str spectral_matrices_regs_t; |
|
45 | typedef struct spectral_matrices_regs_str spectral_matrices_regs_t; | |
39 |
|
46 | |||
40 | struct time_management_regs_str{ |
|
47 | struct time_management_regs_str{ | |
41 | volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time |
|
48 | volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time | |
42 | volatile int coarse_time_load; |
|
49 | volatile int coarse_time_load; | |
43 | volatile int coarse_time; |
|
50 | volatile int coarse_time; | |
44 | volatile int fine_time; |
|
51 | volatile int fine_time; | |
45 | }; |
|
52 | }; | |
46 | typedef struct time_management_regs_str time_management_regs_t; |
|
53 | typedef struct time_management_regs_str time_management_regs_t; | |
47 |
|
54 | |||
48 | struct waveform_picker_regs_str{ |
|
55 | struct waveform_picker_regs_str{ |
@@ -63,7 +63,7 rtems_task Init( rtems_task_argument ign | |||||
63 | PRINTF("***************************\n") |
|
63 | PRINTF("***************************\n") | |
64 | PRINTF("\n\n") |
|
64 | PRINTF("\n\n") | |
65 |
|
65 | |||
66 |
//send_console_outputs_on_ |
|
66 | //send_console_outputs_on_apbuart_port(); | |
67 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); |
|
67 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); | |
68 |
|
68 | |||
69 | initLookUpTableForCRC(); // in tc_handler.h |
|
69 | initLookUpTableForCRC(); // in tc_handler.h | |
@@ -145,35 +145,37 rtems_task spiq_task(rtems_task_argument | |||||
145 |
|
145 | |||
146 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; // get the current mode |
|
146 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; // get the current mode | |
147 |
|
147 | |||
148 | //**************** |
|
148 | status = spacewire_wait_for_link(); | |
149 | // STOP THE SYSTEM |
|
149 | ||
150 | spacewire_compute_stats_offsets(); |
|
150 | if (status != RTEMS_SUCCESSFUL) | |
151 | stop_current_mode(); |
|
151 | { | |
152 | if (rtems_task_suspend(Task_id[TASKID_RECV])!=RTEMS_SUCCESSFUL) { // suspend RECV task |
|
152 | //**************** | |
153 | PRINTF("in SPIQ *** Error suspending RECV Task\n") |
|
153 | // STOP THE SYSTEM | |
154 | } |
|
154 | spacewire_compute_stats_offsets(); | |
155 | if (rtems_task_suspend(Task_id[TASKID_HOUS])!=RTEMS_SUCCESSFUL) { // suspend HOUS task |
|
155 | stop_current_mode(); | |
156 | PRINTF("in SPIQ *** Error suspending HOUS Task\n") |
|
156 | if (rtems_task_suspend(Task_id[TASKID_RECV])!=RTEMS_SUCCESSFUL) { // suspend RECV task | |
157 | } |
|
157 | PRINTF("in SPIQ *** Error suspending RECV Task\n") | |
|
158 | } | |||
|
159 | if (rtems_task_suspend(Task_id[TASKID_HOUS])!=RTEMS_SUCCESSFUL) { // suspend HOUS task | |||
|
160 | PRINTF("in SPIQ *** Error suspending HOUS Task\n") | |||
|
161 | } | |||
158 |
|
162 | |||
159 | //*************************** |
|
163 | //*************************** | |
160 | // RESTART THE SPACEWIRE LINK |
|
164 | // RESTART THE SPACEWIRE LINK | |
161 | status = spacewire_try_to_start(); |
|
|||
162 | if (status != RTEMS_SUCCESSFUL) { |
|
|||
163 | spacewire_configure_link(); |
|
165 | spacewire_configure_link(); | |
164 | } |
|
|||
165 |
|
166 | |||
166 | //******************* |
|
167 | //******************* | |
167 | // RESTART THE SYSTEM |
|
168 | // RESTART THE SYSTEM | |
168 | //ioctl(fdSPW, SPACEWIRE_IOCTRL_CLR_STATISTICS); // clear statistics |
|
169 | //ioctl(fdSPW, SPACEWIRE_IOCTRL_CLR_STATISTICS); // clear statistics | |
169 | status = rtems_task_restart( Task_id[TASKID_HOUS], 1 ); |
|
170 | status = rtems_task_restart( Task_id[TASKID_HOUS], 1 ); | |
170 | if (status != RTEMS_SUCCESSFUL) { |
|
171 | if (status != RTEMS_SUCCESSFUL) { | |
171 | PRINTF1("in SPIQ *** Error restarting HOUS Task *** code %d\n", status) |
|
172 | PRINTF1("in SPIQ *** Error restarting HOUS Task *** code %d\n", status) | |
|
173 | } | |||
|
174 | if (rtems_task_restart(Task_id[TASKID_RECV], 1) != RTEMS_SUCCESSFUL) { // restart RECV task | |||
|
175 | PRINTF("in SPIQ *** Error restarting RECV Task\n") | |||
|
176 | } | |||
|
177 | //enter_mode(lfrMode, NULL); // enter the mode that was running before the SpaceWire interruption | |||
172 | } |
|
178 | } | |
173 | if (rtems_task_restart(Task_id[TASKID_RECV], 1) != RTEMS_SUCCESSFUL) { // restart RECV task |
|
|||
174 | PRINTF("in SPIQ *** Error restarting RECV Task\n") |
|
|||
175 | } |
|
|||
176 | //enter_mode(lfrMode, NULL); // enter the mode that was running before the SpaceWire interruption |
|
|||
177 | } |
|
179 | } | |
178 | } |
|
180 | } | |
179 |
|
181 | |||
@@ -446,7 +448,7 int spacewire_configure_link( void ) | |||||
446 | return RTEMS_SUCCESSFUL; |
|
448 | return RTEMS_SUCCESSFUL; | |
447 | } |
|
449 | } | |
448 |
|
450 | |||
449 |
int spacewire_ |
|
451 | int spacewire_wait_for_link(void) | |
450 | { |
|
452 | { | |
451 | unsigned int i; |
|
453 | unsigned int i; | |
452 | int linkStatus; |
|
454 | int linkStatus; |
@@ -91,7 +91,7 void update_spacewire_statistics() | |||||
91 |
|
91 | |||
92 | } |
|
92 | } | |
93 |
|
93 | |||
94 |
int send_console_outputs_on_ |
|
94 | int send_console_outputs_on_apbuart_port( void ) // Send the console outputs on the apbuart port | |
95 | { |
|
95 | { | |
96 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART; |
|
96 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART; | |
97 |
|
97 | |||
@@ -106,7 +106,7 int set_apbuart_scaler_reload_register(u | |||||
106 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs; |
|
106 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs; | |
107 |
|
107 | |||
108 | apbuart_regs->scaler = value; |
|
108 | apbuart_regs->scaler = value; | |
109 |
PRINTF1("OK *** |
|
109 | PRINTF1("OK *** apbuart port scaler reload register set to 0x%x\n", value) | |
110 |
|
110 | |||
111 | return 0; |
|
111 | return 0; | |
112 | } |
|
112 | } |
@@ -145,7 +145,7 rtems_isr waveforms_simulator_isr( rtems | |||||
145 | // NORMAL |
|
145 | // NORMAL | |
146 | case(LFR_MODE_NORMAL): |
|
146 | case(LFR_MODE_NORMAL): | |
147 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
147 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
148 |
PRINTF("ERR *** in waveforms_isr *** error sending event to WFRM\n") |
|
148 | PRINTF("ERR *** in waveforms_isr *** error sending event to WFRM\n") | |
149 | } |
|
149 | } | |
150 | break; |
|
150 | break; | |
151 |
|
151 |
General Comments 0
You need to be logged in to leave comments.
Login now