@@ -130,6 +130,8 rtems_task Init( rtems_task_argument ign | |||||
130 | rtems_status_code status_spw; |
|
130 | rtems_status_code status_spw; | |
131 | rtems_isr_entry old_isr_handler; |
|
131 | rtems_isr_entry old_isr_handler; | |
132 |
|
132 | |||
|
133 | old_isr_handler = NULL; | |||
|
134 | ||||
133 | // UART settings |
|
135 | // UART settings | |
134 | enable_apbuart_transmitter(); |
|
136 | enable_apbuart_transmitter(); | |
135 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); |
|
137 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); | |
@@ -736,6 +738,9 rtems_status_code create_message_queues( | |||||
736 | rtems_status_code ret; |
|
738 | rtems_status_code ret; | |
737 | rtems_id queue_id; |
|
739 | rtems_id queue_id; | |
738 |
|
740 | |||
|
741 | ret = RTEMS_SUCCESSFUL; | |||
|
742 | queue_id = RTEMS_ID_NONE; | |||
|
743 | ||||
739 | //**************************************** |
|
744 | //**************************************** | |
740 | // create the queue for handling valid TCs |
|
745 | // create the queue for handling valid TCs | |
741 | status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV], |
|
746 | status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV], | |
@@ -888,6 +893,8 void update_queue_max_count( rtems_id qu | |||||
888 | u_int32_t count; |
|
893 | u_int32_t count; | |
889 | rtems_status_code status; |
|
894 | rtems_status_code status; | |
890 |
|
895 | |||
|
896 | count = 0; | |||
|
897 | ||||
891 | status = rtems_message_queue_get_number_pending( queue_id, &count ); |
|
898 | status = rtems_message_queue_get_number_pending( queue_id, &count ); | |
892 |
|
899 | |||
893 | count = count + 1; |
|
900 | count = count + 1; |
@@ -25,6 +25,8 void timer_configure(unsigned char timer | |||||
25 | rtems_status_code status; |
|
25 | rtems_status_code status; | |
26 | rtems_isr_entry old_isr_handler; |
|
26 | rtems_isr_entry old_isr_handler; | |
27 |
|
27 | |||
|
28 | old_isr_handler = NULL; | |||
|
29 | ||||
28 | gptimer_regs->timer[timer].ctrl = INIT_CHAR; // reset the control register |
|
30 | gptimer_regs->timer[timer].ctrl = INIT_CHAR; // reset the control register | |
29 |
|
31 | |||
30 | status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels |
|
32 | status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels | |
@@ -190,6 +192,8 rtems_task load_task(rtems_task_argument | |||||
190 | rtems_name name_watchdog_rate_monotonic; // name of the watchdog rate monotonic |
|
192 | rtems_name name_watchdog_rate_monotonic; // name of the watchdog rate monotonic | |
191 | rtems_id watchdog_period_id; // id of the watchdog rate monotonic period |
|
193 | rtems_id watchdog_period_id; // id of the watchdog rate monotonic period | |
192 |
|
194 | |||
|
195 | watchdog_period_id = RTEMS_ID_NONE; | |||
|
196 | ||||
193 | name_watchdog_rate_monotonic = rtems_build_name( 'L', 'O', 'A', 'D' ); |
|
197 | name_watchdog_rate_monotonic = rtems_build_name( 'L', 'O', 'A', 'D' ); | |
194 |
|
198 | |||
195 | status = rtems_rate_monotonic_create( name_watchdog_rate_monotonic, &watchdog_period_id ); |
|
199 | status = rtems_rate_monotonic_create( name_watchdog_rate_monotonic, &watchdog_period_id ); | |
@@ -233,6 +237,8 rtems_task hous_task(rtems_task_argument | |||||
233 | rtems_rate_monotonic_period_status period_status; |
|
237 | rtems_rate_monotonic_period_status period_status; | |
234 | bool isSynchronized; |
|
238 | bool isSynchronized; | |
235 |
|
239 | |||
|
240 | queue_id = RTEMS_ID_NONE; | |||
|
241 | memset(&period_status, 0, sizeof(rtems_rate_monotonic_period_status)); | |||
236 | isSynchronized = false; |
|
242 | isSynchronized = false; | |
237 |
|
243 | |||
238 | status = get_message_queue_id_send( &queue_id ); |
|
244 | status = get_message_queue_id_send( &queue_id ); | |
@@ -440,22 +446,7 rtems_task dumb_task( rtems_task_argumen | |||||
440 | unsigned int fine_time = 0; |
|
446 | unsigned int fine_time = 0; | |
441 | rtems_event_set event_out; |
|
447 | rtems_event_set event_out; | |
442 |
|
448 | |||
443 | char *DumbMessages[DUMB_MESSAGE_NB] = {DUMB_MESSAGE_0, // RTEMS_EVENT_0 |
|
449 | event_out = EVENT_SETS_NONE_PENDING; | |
444 | DUMB_MESSAGE_1, // RTEMS_EVENT_1 |
|
|||
445 | DUMB_MESSAGE_2, // RTEMS_EVENT_2 |
|
|||
446 | DUMB_MESSAGE_3, // RTEMS_EVENT_3 |
|
|||
447 | DUMB_MESSAGE_4, // RTEMS_EVENT_4 |
|
|||
448 | DUMB_MESSAGE_5, // RTEMS_EVENT_5 |
|
|||
449 | DUMB_MESSAGE_6, // RTEMS_EVENT_6 |
|
|||
450 | DUMB_MESSAGE_7, // RTEMS_EVENT_7 |
|
|||
451 | DUMB_MESSAGE_8, // RTEMS_EVENT_8 |
|
|||
452 | DUMB_MESSAGE_9, // RTEMS_EVENT_9 |
|
|||
453 | DUMB_MESSAGE_10, // RTEMS_EVENT_10 |
|
|||
454 | DUMB_MESSAGE_11, // RTEMS_EVENT_11 |
|
|||
455 | DUMB_MESSAGE_12, // RTEMS_EVENT_12 |
|
|||
456 | DUMB_MESSAGE_13, // RTEMS_EVENT_13 |
|
|||
457 | DUMB_MESSAGE_14 // RTEMS_EVENT_14 |
|
|||
458 | }; |
|
|||
459 |
|
450 | |||
460 | BOOT_PRINTF("in DUMB *** \n") |
|
451 | BOOT_PRINTF("in DUMB *** \n") | |
461 |
|
452 | |||
@@ -608,6 +599,8 void send_dumb_hk( void ) | |||||
608 | unsigned int i; |
|
599 | unsigned int i; | |
609 | rtems_id queue_id; |
|
600 | rtems_id queue_id; | |
610 |
|
601 | |||
|
602 | queue_id = RTEMS_ID_NONE; | |||
|
603 | ||||
611 | dummy_hk_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
604 | dummy_hk_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
612 | dummy_hk_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
605 | dummy_hk_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
613 | dummy_hk_packet.reserved = DEFAULT_RESERVED; |
|
606 | dummy_hk_packet.reserved = DEFAULT_RESERVED; | |
@@ -983,6 +976,11 void set_hk_lfr_ahb_correctable() // C | |||||
983 | unsigned int fprfErrorCounter; |
|
976 | unsigned int fprfErrorCounter; | |
984 | unsigned int iurfErrorCounter; |
|
977 | unsigned int iurfErrorCounter; | |
985 |
|
978 | |||
|
979 | instructionErrorCounter = 0; | |||
|
980 | dataErrorCounter = 0; | |||
|
981 | fprfErrorCounter = 0; | |||
|
982 | iurfErrorCounter = 0; | |||
|
983 | ||||
986 | CCR_getInstructionAndDataErrorCounters( &instructionErrorCounter, &dataErrorCounter); |
|
984 | CCR_getInstructionAndDataErrorCounters( &instructionErrorCounter, &dataErrorCounter); | |
987 | ASR16_get_FPRF_IURF_ErrorCounters( &fprfErrorCounter, &iurfErrorCounter); |
|
985 | ASR16_get_FPRF_IURF_ErrorCounters( &fprfErrorCounter, &iurfErrorCounter); | |
988 |
|
986 |
@@ -39,6 +39,9 rtems_task spiq_task(rtems_task_argument | |||||
39 | rtems_status_code status; |
|
39 | rtems_status_code status; | |
40 | int linkStatus; |
|
40 | int linkStatus; | |
41 |
|
41 | |||
|
42 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
43 | linkStatus = 0; | |||
|
44 | ||||
42 | BOOT_PRINTF("in SPIQ *** \n") |
|
45 | BOOT_PRINTF("in SPIQ *** \n") | |
43 |
|
46 | |||
44 | while(true){ |
|
47 | while(true){ | |
@@ -131,6 +134,11 rtems_task recv_task( rtems_task_argumen | |||||
131 | rtems_id queue_recv_id; |
|
134 | rtems_id queue_recv_id; | |
132 | rtems_id queue_send_id; |
|
135 | rtems_id queue_send_id; | |
133 |
|
136 | |||
|
137 | memset( ¤tTC, 0, sizeof(ccsdsTelecommandPacket_t) ); | |||
|
138 | destinationID = 0; | |||
|
139 | queue_recv_id = RTEMS_ID_NONE; | |||
|
140 | queue_send_id = RTEMS_ID_NONE; | |||
|
141 | ||||
134 | initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes |
|
142 | initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes | |
135 |
|
143 | |||
136 | status = get_message_queue_id_recv( &queue_recv_id ); |
|
144 | status = get_message_queue_id_recv( &queue_recv_id ); | |
@@ -230,6 +238,8 rtems_task send_task( rtems_task_argumen | |||||
230 | incomingRingNodePtr = NULL; |
|
238 | incomingRingNodePtr = NULL; | |
231 | ring_node_address = 0; |
|
239 | ring_node_address = 0; | |
232 | charPtr = (char *) &ring_node_address; |
|
240 | charPtr = (char *) &ring_node_address; | |
|
241 | size = 0; | |||
|
242 | queue_send_id = RTEMS_ID_NONE; | |||
233 | sid = 0; |
|
243 | sid = 0; | |
234 | sidAsUnsignedChar = 0; |
|
244 | sidAsUnsignedChar = 0; | |
235 |
|
245 | |||
@@ -337,6 +347,9 rtems_task link_task( rtems_task_argumen | |||||
337 | rtems_status_code status; |
|
347 | rtems_status_code status; | |
338 | int linkStatus; |
|
348 | int linkStatus; | |
339 |
|
349 | |||
|
350 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
351 | linkStatus = 0; | |||
|
352 | ||||
340 | BOOT_PRINTF("in LINK ***\n") |
|
353 | BOOT_PRINTF("in LINK ***\n") | |
341 |
|
354 | |||
342 | while(1) |
|
355 | while(1) | |
@@ -394,6 +407,8 int spacewire_open_link( void ) // by d | |||||
394 | */ |
|
407 | */ | |
395 | rtems_status_code status; |
|
408 | rtems_status_code status; | |
396 |
|
409 | |||
|
410 | status = RTEMS_SUCCESSFUL; | |||
|
411 | ||||
397 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call resets the hardware |
|
412 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call resets the hardware | |
398 | if ( fdSPW < 0 ) { |
|
413 | if ( fdSPW < 0 ) { | |
399 | PRINTF1("ERR *** in configure_spw_link *** error opening "GRSPW_DEVICE_NAME" with ERR %d\n", errno) |
|
414 | PRINTF1("ERR *** in configure_spw_link *** error opening "GRSPW_DEVICE_NAME" with ERR %d\n", errno) | |
@@ -508,6 +523,8 int spacewire_several_connect_attemps( v | |||||
508 | rtems_status_code status; |
|
523 | rtems_status_code status; | |
509 | int i; |
|
524 | int i; | |
510 |
|
525 | |||
|
526 | status_spw = RTEMS_SUCCESSFUL; | |||
|
527 | ||||
511 | i = 0; |
|
528 | i = 0; | |
512 | while (i < SY_LFR_DPU_CONNECT_ATTEMPT) |
|
529 | while (i < SY_LFR_DPU_CONNECT_ATTEMPT) | |
513 | { |
|
530 | { | |
@@ -593,6 +610,8 void spacewire_read_statistics( void ) | |||||
593 | rtems_status_code status; |
|
610 | rtems_status_code status; | |
594 | spw_stats current; |
|
611 | spw_stats current; | |
595 |
|
612 | |||
|
613 | memset(¤t, 0, sizeof(spw_stats)); | |||
|
614 | ||||
596 | spacewire_get_last_error(); |
|
615 | spacewire_get_last_error(); | |
597 |
|
616 | |||
598 | // read the current statistics |
|
617 | // read the current statistics | |
@@ -645,7 +664,7 void spacewire_read_statistics( void ) | |||||
645 |
|
664 | |||
646 | void spacewire_get_last_error( void ) |
|
665 | void spacewire_get_last_error( void ) | |
647 | { |
|
666 | { | |
648 | static spw_stats previous; |
|
667 | static spw_stats previous = {0}; | |
649 | spw_stats current; |
|
668 | spw_stats current; | |
650 | rtems_status_code status; |
|
669 | rtems_status_code status; | |
651 |
|
670 | |||
@@ -655,6 +674,7 void spacewire_get_last_error( void ) | |||||
655 | int fineTime; |
|
674 | int fineTime; | |
656 | unsigned char update_hk_lfr_last_er; |
|
675 | unsigned char update_hk_lfr_last_er; | |
657 |
|
676 | |||
|
677 | memset(¤t, 0, sizeof(spw_stats)); | |||
658 | update_hk_lfr_last_er = 0; |
|
678 | update_hk_lfr_last_er = 0; | |
659 |
|
679 | |||
660 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, ¤t ); |
|
680 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, ¤t ); |
@@ -29,6 +29,8 unsigned char lfr_rtems_cpu_usage_report | |||||
29 | #endif |
|
29 | #endif | |
30 |
|
30 | |||
31 | unsigned char cpu_load; |
|
31 | unsigned char cpu_load; | |
|
32 | ||||
|
33 | ival = 0; | |||
32 | cpu_load = 0; |
|
34 | cpu_load = 0; | |
33 |
|
35 | |||
34 | /* |
|
36 | /* |
@@ -57,6 +57,8 rtems_task avf0_task( rtems_task_argumen | |||||
57 | nb_norm_asm = 0; |
|
57 | nb_norm_asm = 0; | |
58 | nb_sbm_bp1 = 0; |
|
58 | nb_sbm_bp1 = 0; | |
59 | nb_sbm_bp2 = 0; |
|
59 | nb_sbm_bp2 = 0; | |
|
60 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
61 | queue_id_prc0 = RTEMS_ID_NONE; | |||
60 |
|
62 | |||
61 | reset_nb_sm_f0( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions |
|
63 | reset_nb_sm_f0( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions | |
62 | ASM_generic_init_ring( asm_ring_norm_f0, NB_RING_NODES_ASM_NORM_F0 ); |
|
64 | ASM_generic_init_ring( asm_ring_norm_f0, NB_RING_NODES_ASM_NORM_F0 ); | |
@@ -64,7 +66,7 rtems_task avf0_task( rtems_task_argumen | |||||
64 | current_ring_node_asm_norm_f0 = asm_ring_norm_f0; |
|
66 | current_ring_node_asm_norm_f0 = asm_ring_norm_f0; | |
65 | current_ring_node_asm_burst_sbm_f0 = asm_ring_burst_sbm_f0; |
|
67 | current_ring_node_asm_burst_sbm_f0 = asm_ring_burst_sbm_f0; | |
66 |
|
68 | |||
67 | BOOT_PRINTF1("in AVFO *** lfrRequestedMode = %d\n", (int) lfrRequestedMode) |
|
69 | BOOT_PRINTF1("in AVFO *** lfrRequestedMode = %d\n", (int) lfrRequestedMode); | |
68 |
|
70 | |||
69 | status = get_message_queue_id_prc0( &queue_id_prc0 ); |
|
71 | status = get_message_queue_id_prc0( &queue_id_prc0 ); | |
70 | if (status != RTEMS_SUCCESSFUL) |
|
72 | if (status != RTEMS_SUCCESSFUL) | |
@@ -197,6 +199,14 rtems_task prc0_task( rtems_task_argumen | |||||
197 | float nbSMInASMNORM; |
|
199 | float nbSMInASMNORM; | |
198 | float nbSMInASMSBM; |
|
200 | float nbSMInASMSBM; | |
199 |
|
201 | |||
|
202 | size = 0; | |||
|
203 | queue_id = RTEMS_ID_NONE; | |||
|
204 | queue_id_q_p0 = RTEMS_ID_NONE; | |||
|
205 | memset( &packet_norm_bp1, 0, sizeof(bp_packet_with_spare) ); | |||
|
206 | memset( &packet_norm_bp2, 0, sizeof(bp_packet) ); | |||
|
207 | memset( &packet_sbm_bp1, 0, sizeof(bp_packet) ); | |||
|
208 | memset( &packet_sbm_bp2, 0, sizeof(bp_packet) ); | |||
|
209 | ||||
200 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU |
|
210 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU | |
201 | init_ring( ring_to_send_asm_f0, NB_RING_NODES_ASM_F0, (volatile int*) buffer_asm_f0, TOTAL_SIZE_SM ); |
|
211 | init_ring( ring_to_send_asm_f0, NB_RING_NODES_ASM_F0, (volatile int*) buffer_asm_f0, TOTAL_SIZE_SM ); | |
202 | current_ring_node_to_send_asm_f0 = ring_to_send_asm_f0; |
|
212 | current_ring_node_to_send_asm_f0 = ring_to_send_asm_f0; |
@@ -53,6 +53,9 rtems_task avf1_task( rtems_task_argumen | |||||
53 | unsigned int nb_sbm_bp1; |
|
53 | unsigned int nb_sbm_bp1; | |
54 | unsigned int nb_sbm_bp2; |
|
54 | unsigned int nb_sbm_bp2; | |
55 |
|
55 | |||
|
56 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
57 | queue_id_prc1 = RTEMS_ID_NONE; | |||
|
58 | ||||
56 | nb_norm_bp1 = 0; |
|
59 | nb_norm_bp1 = 0; | |
57 | nb_norm_bp2 = 0; |
|
60 | nb_norm_bp2 = 0; | |
58 | nb_norm_asm = 0; |
|
61 | nb_norm_asm = 0; | |
@@ -198,6 +201,14 rtems_task prc1_task( rtems_task_argumen | |||||
198 | float nbSMInASMNORM; |
|
201 | float nbSMInASMNORM; | |
199 | float nbSMInASMSBM; |
|
202 | float nbSMInASMSBM; | |
200 |
|
203 | |||
|
204 | size = 0; | |||
|
205 | queue_id_send = RTEMS_ID_NONE; | |||
|
206 | queue_id_q_p1 = RTEMS_ID_NONE; | |||
|
207 | memset( &packet_norm_bp1, 0, sizeof(bp_packet_with_spare) ); | |||
|
208 | memset( &packet_norm_bp2, 0, sizeof(bp_packet) ); | |||
|
209 | memset( &packet_sbm_bp1, 0, sizeof(bp_packet) ); | |||
|
210 | memset( &packet_sbm_bp2, 0, sizeof(bp_packet) ); | |||
|
211 | ||||
201 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU |
|
212 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU | |
202 | init_ring( ring_to_send_asm_f1, NB_RING_NODES_ASM_F1, (volatile int*) buffer_asm_f1, TOTAL_SIZE_SM ); |
|
213 | init_ring( ring_to_send_asm_f1, NB_RING_NODES_ASM_F1, (volatile int*) buffer_asm_f1, TOTAL_SIZE_SM ); | |
203 | current_ring_node_to_send_asm_f1 = ring_to_send_asm_f1; |
|
214 | current_ring_node_to_send_asm_f1 = ring_to_send_asm_f1; |
@@ -45,6 +45,8 rtems_task avf2_task( rtems_task_argumen | |||||
45 | unsigned int nb_norm_bp2; |
|
45 | unsigned int nb_norm_bp2; | |
46 | unsigned int nb_norm_asm; |
|
46 | unsigned int nb_norm_asm; | |
47 |
|
47 | |||
|
48 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
49 | queue_id_prc2 = RTEMS_ID_NONE; | |||
48 | nb_norm_bp1 = 0; |
|
50 | nb_norm_bp1 = 0; | |
49 | nb_norm_bp2 = 0; |
|
51 | nb_norm_bp2 = 0; | |
50 | nb_norm_asm = 0; |
|
52 | nb_norm_asm = 0; | |
@@ -146,6 +148,12 rtems_task prc2_task( rtems_task_argumen | |||||
146 |
|
148 | |||
147 | unsigned long long int localTime; |
|
149 | unsigned long long int localTime; | |
148 |
|
150 | |||
|
151 | size = 0; | |||
|
152 | queue_id_send = RTEMS_ID_NONE; | |||
|
153 | queue_id_q_p2 = RTEMS_ID_NONE; | |||
|
154 | memset( &packet_norm_bp1, 0, sizeof(bp_packet) ); | |||
|
155 | memset( &packet_norm_bp2, 0, sizeof(bp_packet) ); | |||
|
156 | ||||
149 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU |
|
157 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU | |
150 | init_ring( ring_to_send_asm_f2, NB_RING_NODES_ASM_F2, (volatile int*) buffer_asm_f2, TOTAL_SIZE_SM ); |
|
158 | init_ring( ring_to_send_asm_f2, NB_RING_NODES_ASM_F2, (volatile int*) buffer_asm_f2, TOTAL_SIZE_SM ); | |
151 | current_ring_node_to_send_asm_f2 = ring_to_send_asm_f2; |
|
159 | current_ring_node_to_send_asm_f2 = ring_to_send_asm_f2; |
@@ -551,6 +551,8 unsigned char getSID( rtems_event_set ev | |||||
551 | rtems_event_set eventSetBURST; |
|
551 | rtems_event_set eventSetBURST; | |
552 | rtems_event_set eventSetSBM; |
|
552 | rtems_event_set eventSetSBM; | |
553 |
|
553 | |||
|
554 | sid = 0; | |||
|
555 | ||||
554 | //****** |
|
556 | //****** | |
555 | // BURST |
|
557 | // BURST | |
556 | eventSetBURST = RTEMS_EVENT_BURST_BP1_F0 |
|
558 | eventSetBURST = RTEMS_EVENT_BURST_BP1_F0 |
@@ -193,6 +193,8 int tc_check_type( unsigned char packetT | |||||
193 |
|
193 | |||
194 | int status; |
|
194 | int status; | |
195 |
|
195 | |||
|
196 | status = ILL_TYPE; | |||
|
197 | ||||
196 | if ( (packetType == TC_TYPE_GEN) || (packetType == TC_TYPE_TIME)) |
|
198 | if ( (packetType == TC_TYPE_GEN) || (packetType == TC_TYPE_TIME)) | |
197 | { |
|
199 | { | |
198 | status = CCSDS_TM_VALID; |
|
200 | status = CCSDS_TM_VALID; | |
@@ -272,6 +274,8 int tc_check_sid( unsigned char sid ) | |||||
272 |
|
274 | |||
273 | int status; |
|
275 | int status; | |
274 |
|
276 | |||
|
277 | status = WRONG_SRC_ID; | |||
|
278 | ||||
275 | if ( (sid == SID_TC_MISSION_TIMELINE) || (sid == SID_TC_TC_SEQUENCES) || (sid == SID_TC_RECOVERY_ACTION_CMD) |
|
279 | if ( (sid == SID_TC_MISSION_TIMELINE) || (sid == SID_TC_TC_SEQUENCES) || (sid == SID_TC_RECOVERY_ACTION_CMD) | |
276 | || (sid == SID_TC_BACKUP_MISSION_TIMELINE) |
|
280 | || (sid == SID_TC_BACKUP_MISSION_TIMELINE) | |
277 | || (sid == SID_TC_DIRECT_CMD) || (sid == SID_TC_SPARE_GRD_SRC1) || (sid == SID_TC_SPARE_GRD_SRC2) |
|
281 | || (sid == SID_TC_DIRECT_CMD) || (sid == SID_TC_SPARE_GRD_SRC1) || (sid == SID_TC_SPARE_GRD_SRC2) | |
@@ -455,6 +459,8 int tc_check_crc( ccsdsTelecommandPacket | |||||
455 | int status; |
|
459 | int status; | |
456 | unsigned char * CCSDSContent; |
|
460 | unsigned char * CCSDSContent; | |
457 |
|
461 | |||
|
462 | status = INCOR_CHECKSUM; | |||
|
463 | ||||
458 | CCSDSContent = (unsigned char*) TCPacket->packetID; |
|
464 | CCSDSContent = (unsigned char*) TCPacket->packetID; | |
459 | GetCRCAsTwoBytes(CCSDSContent, computed_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - BYTES_PER_CRC); // 2 CRC bytes removed from the calculation of the CRC |
|
465 | GetCRCAsTwoBytes(CCSDSContent, computed_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - BYTES_PER_CRC); // 2 CRC bytes removed from the calculation of the CRC | |
460 |
|
466 |
@@ -36,6 +36,11 rtems_task actn_task( rtems_task_argumen | |||||
36 | rtems_id queue_rcv_id; |
|
36 | rtems_id queue_rcv_id; | |
37 | rtems_id queue_snd_id; |
|
37 | rtems_id queue_snd_id; | |
38 |
|
38 | |||
|
39 | memset(&TC, 0, sizeof(ccsdsTelecommandPacket_t)); | |||
|
40 | size = 0; | |||
|
41 | queue_rcv_id = RTEMS_ID_NONE; | |||
|
42 | queue_snd_id = RTEMS_ID_NONE; | |||
|
43 | ||||
39 | status = get_message_queue_id_recv( &queue_rcv_id ); |
|
44 | status = get_message_queue_id_recv( &queue_rcv_id ); | |
40 | if (status != RTEMS_SUCCESSFUL) |
|
45 | if (status != RTEMS_SUCCESSFUL) | |
41 | { |
|
46 | { | |
@@ -383,6 +388,8 int check_mode_value( unsigned char requ | |||||
383 | { |
|
388 | { | |
384 | int status; |
|
389 | int status; | |
385 |
|
390 | |||
|
391 | status = LFR_DEFAULT; | |||
|
392 | ||||
386 | if ( (requestedMode != LFR_MODE_STANDBY) |
|
393 | if ( (requestedMode != LFR_MODE_STANDBY) | |
387 | && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST) |
|
394 | && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST) | |
388 | && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) ) |
|
395 | && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) ) |
@@ -877,6 +877,8 unsigned int check_update_info_hk_lfr_mo | |||||
877 | { |
|
877 | { | |
878 | unsigned int status; |
|
878 | unsigned int status; | |
879 |
|
879 | |||
|
880 | status = LFR_DEFAULT; | |||
|
881 | ||||
880 | if ( (mode == LFR_MODE_STANDBY) || (mode == LFR_MODE_NORMAL) |
|
882 | if ( (mode == LFR_MODE_STANDBY) || (mode == LFR_MODE_NORMAL) | |
881 | || (mode == LFR_MODE_BURST) |
|
883 | || (mode == LFR_MODE_BURST) | |
882 | || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2)) |
|
884 | || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2)) | |
@@ -895,6 +897,8 unsigned int check_update_info_hk_tds_mo | |||||
895 | { |
|
897 | { | |
896 | unsigned int status; |
|
898 | unsigned int status; | |
897 |
|
899 | |||
|
900 | status = LFR_DEFAULT; | |||
|
901 | ||||
898 | if ( (mode == TDS_MODE_STANDBY) || (mode == TDS_MODE_NORMAL) |
|
902 | if ( (mode == TDS_MODE_STANDBY) || (mode == TDS_MODE_NORMAL) | |
899 | || (mode == TDS_MODE_BURST) |
|
903 | || (mode == TDS_MODE_BURST) | |
900 | || (mode == TDS_MODE_SBM1) || (mode == TDS_MODE_SBM2) |
|
904 | || (mode == TDS_MODE_SBM1) || (mode == TDS_MODE_SBM2) | |
@@ -914,6 +918,8 unsigned int check_update_info_hk_thr_mo | |||||
914 | { |
|
918 | { | |
915 | unsigned int status; |
|
919 | unsigned int status; | |
916 |
|
920 | |||
|
921 | status = LFR_DEFAULT; | |||
|
922 | ||||
917 | if ( (mode == THR_MODE_STANDBY) || (mode == THR_MODE_NORMAL) |
|
923 | if ( (mode == THR_MODE_STANDBY) || (mode == THR_MODE_NORMAL) | |
918 | || (mode == THR_MODE_BURST)) |
|
924 | || (mode == THR_MODE_BURST)) | |
919 | { |
|
925 | { | |
@@ -1001,6 +1007,7 void setFBinMask( unsigned char *fbins_m | |||||
1001 | int binToRemove[NB_BINS_TO_REMOVE]; |
|
1007 | int binToRemove[NB_BINS_TO_REMOVE]; | |
1002 | int k; |
|
1008 | int k; | |
1003 |
|
1009 | |||
|
1010 | closestBin = 0; | |||
1004 | whichByte = 0; |
|
1011 | whichByte = 0; | |
1005 | bin = 0; |
|
1012 | bin = 0; | |
1006 |
|
1013 |
@@ -336,6 +336,9 rtems_task wfrm_task(rtems_task_argument | |||||
336 | ring_node *ring_node_swf1_extracted_ptr; |
|
336 | ring_node *ring_node_swf1_extracted_ptr; | |
337 | ring_node *ring_node_swf2_extracted_ptr; |
|
337 | ring_node *ring_node_swf2_extracted_ptr; | |
338 |
|
338 | |||
|
339 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
340 | queue_id = RTEMS_ID_NONE; | |||
|
341 | ||||
339 | ring_node_swf1_extracted_ptr = (ring_node *) &ring_node_swf1_extracted; |
|
342 | ring_node_swf1_extracted_ptr = (ring_node *) &ring_node_swf1_extracted; | |
340 | ring_node_swf2_extracted_ptr = (ring_node *) &ring_node_swf2_extracted; |
|
343 | ring_node_swf2_extracted_ptr = (ring_node *) &ring_node_swf2_extracted; | |
341 |
|
344 | |||
@@ -386,6 +389,9 rtems_task cwf3_task(rtems_task_argument | |||||
386 | ring_node ring_node_cwf3_light; |
|
389 | ring_node ring_node_cwf3_light; | |
387 | ring_node *ring_node_to_send_cwf; |
|
390 | ring_node *ring_node_to_send_cwf; | |
388 |
|
391 | |||
|
392 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
393 | queue_id = RTEMS_ID_NONE; | |||
|
394 | ||||
389 | status = get_message_queue_id_send( &queue_id ); |
|
395 | status = get_message_queue_id_send( &queue_id ); | |
390 | if (status != RTEMS_SUCCESSFUL) |
|
396 | if (status != RTEMS_SUCCESSFUL) | |
391 | { |
|
397 | { | |
@@ -451,6 +457,9 rtems_task cwf2_task(rtems_task_argument | |||||
451 | ring_node *ring_node_to_send; |
|
457 | ring_node *ring_node_to_send; | |
452 | unsigned long long int acquisitionTimeF0_asLong; |
|
458 | unsigned long long int acquisitionTimeF0_asLong; | |
453 |
|
459 | |||
|
460 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
461 | queue_id = RTEMS_ID_NONE; | |||
|
462 | ||||
454 | acquisitionTimeF0_asLong = INIT_CHAR; |
|
463 | acquisitionTimeF0_asLong = INIT_CHAR; | |
455 |
|
464 | |||
456 | status = get_message_queue_id_send( &queue_id ); |
|
465 | status = get_message_queue_id_send( &queue_id ); | |
@@ -519,6 +528,9 rtems_task cwf1_task(rtems_task_argument | |||||
519 |
|
528 | |||
520 | ring_node *ring_node_to_send_cwf; |
|
529 | ring_node *ring_node_to_send_cwf; | |
521 |
|
530 | |||
|
531 | event_out = EVENT_SETS_NONE_PENDING; | |||
|
532 | queue_id = RTEMS_ID_NONE; | |||
|
533 | ||||
522 | status = get_message_queue_id_send( &queue_id ); |
|
534 | status = get_message_queue_id_send( &queue_id ); | |
523 | if (status != RTEMS_SUCCESSFUL) |
|
535 | if (status != RTEMS_SUCCESSFUL) | |
524 | { |
|
536 | { | |
@@ -574,6 +586,7 rtems_task swbd_task(rtems_task_argument | |||||
574 | rtems_event_set event_out; |
|
586 | rtems_event_set event_out; | |
575 | unsigned long long int acquisitionTimeF0_asLong; |
|
587 | unsigned long long int acquisitionTimeF0_asLong; | |
576 |
|
588 | |||
|
589 | event_out = EVENT_SETS_NONE_PENDING; | |||
577 | acquisitionTimeF0_asLong = INIT_CHAR; |
|
590 | acquisitionTimeF0_asLong = INIT_CHAR; | |
578 |
|
591 | |||
579 | BOOT_PRINTF("in SWBD ***\n") |
|
592 | BOOT_PRINTF("in SWBD ***\n") | |
@@ -796,6 +809,9 void build_snapshot_from_ring( ring_node | |||||
796 |
|
809 | |||
797 | // (2) compute the central reference time |
|
810 | // (2) compute the central reference time | |
798 | centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0; |
|
811 | centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0; | |
|
812 | acquisitionTime_asLong = centerTime_asLong; //set to default value (Don_Initialisation_P2) | |||
|
813 | bufferAcquisitionTime_asLong = centerTime_asLong; //set to default value (Don_Initialisation_P2) | |||
|
814 | nbTicksPerSample_asLong = TICKS_PER_T2; //set to default value (Don_Initialisation_P2) | |||
799 |
|
815 | |||
800 | // (3) compute the acquisition time of the current snapshot |
|
816 | // (3) compute the acquisition time of the current snapshot | |
801 | switch(frequencyChannel) |
|
817 | switch(frequencyChannel) | |
@@ -896,6 +912,8 double computeCorrection( unsigned char | |||||
896 | double deltaNext_ms; |
|
912 | double deltaNext_ms; | |
897 | double correctionInF2; |
|
913 | double correctionInF2; | |
898 |
|
914 | |||
|
915 | correctionInF2 = 0; //set to default value (Don_Initialisation_P2) | |||
|
916 | ||||
899 | // get acquisition time in fine time ticks |
|
917 | // get acquisition time in fine time ticks | |
900 | acquisitionTime = get_acquisition_time( timePtr ); |
|
918 | acquisitionTime = get_acquisition_time( timePtr ); | |
901 |
|
919 | |||
@@ -933,6 +951,8 void applyCorrection( double correction | |||||
933 | { |
|
951 | { | |
934 | int correctionInt; |
|
952 | int correctionInt; | |
935 |
|
953 | |||
|
954 | correctionInt = 0; | |||
|
955 | ||||
936 | if (correction >= 0.) |
|
956 | if (correction >= 0.) | |
937 | { |
|
957 | { | |
938 | if ( (ONE_TICK_CORR_INTERVAL_0_MIN < correction) && (correction < ONE_TICK_CORR_INTERVAL_0_MAX) ) |
|
958 | if ( (ONE_TICK_CORR_INTERVAL_0_MIN < correction) && (correction < ONE_TICK_CORR_INTERVAL_0_MAX) ) | |
@@ -1264,6 +1284,10 void increment_seq_counter_source_id( un | |||||
1264 | rtems_mode current_mode_set; |
|
1284 | rtems_mode current_mode_set; | |
1265 | rtems_status_code status; |
|
1285 | rtems_status_code status; | |
1266 |
|
1286 | |||
|
1287 | initial_mode_set = RTEMS_DEFAULT_MODES; | |||
|
1288 | current_mode_set = RTEMS_DEFAULT_MODES; | |||
|
1289 | sequence_cnt = NULL; | |||
|
1290 | ||||
1267 | //****************************************** |
|
1291 | //****************************************** | |
1268 | // CHANGE THE MODE OF THE CALLING RTEMS TASK |
|
1292 | // CHANGE THE MODE OF THE CALLING RTEMS TASK | |
1269 | status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &initial_mode_set ); |
|
1293 | status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &initial_mode_set ); |
General Comments 0
You need to be logged in to leave comments.
Login now