##// END OF EJS Templates
printf removed or replaced by PRINTF macros...
printf removed or replaced by PRINTF macros sequence counts modified for DUMP packets, now it depends on the source id bug 516 corrected

File last commit:

r227:919e10e56ea1 R3
r227:919e10e56ea1 R3
Show More
wf_handler.c
1373 lines | 54.1 KiB | text/x-c | CLexer
paul
Header files inclusion reworked...
r40 /** Functions and tasks related to waveform packet generation.
*
* @file
* @author P. LEROY
*
* A group of functions to handle waveforms, in snapshot or continuous format.\n
*
*/
#include "wf_handler.h"
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 //***************
// waveform rings
// F0
paul
ICD 2.0...
r92 ring_node waveform_ring_f0[NB_RING_NODES_F0];
ring_node *current_ring_node_f0;
ring_node *ring_node_to_send_swf_f0;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // F1
ring_node waveform_ring_f1[NB_RING_NODES_F1];
paul
First version of the rings for the waveform picker.
r87 ring_node *current_ring_node_f1;
ring_node *ring_node_to_send_swf_f1;
ring_node *ring_node_to_send_cwf_f1;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // F2
ring_node waveform_ring_f2[NB_RING_NODES_F2];
paul
First version of the rings for the waveform picker.
r87 ring_node *current_ring_node_f2;
ring_node *ring_node_to_send_swf_f2;
ring_node *ring_node_to_send_cwf_f2;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // F3
ring_node waveform_ring_f3[NB_RING_NODES_F3];
paul
waveform buffers declaration modified...
r131 ring_node *current_ring_node_f3;
ring_node *ring_node_to_send_cwf_f3;
paul
sync
r181 char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK ];
paul
First version of the rings for the waveform picker.
r87
paul
snapshot extraction for the waveform ring is operational...
r105 bool extractSWF = false;
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 bool swf_f0_ready = false;
bool swf_f1_ready = false;
bool swf_f2_ready = false;
paul
snapshot extraction for the waveform ring is operational...
r105
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 int wf_snap_extracted[ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) ];
ring_node ring_node_wf_snap_extracted;
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106
//*********************
// Interrupt SubRoutine
paul
Integration of basic parameters functions in the flight software...
r179 ring_node * getRingNodeToSendCWF( unsigned char frequencyChannel)
{
ring_node *node;
node = NULL;
switch ( frequencyChannel ) {
case 1:
node = ring_node_to_send_cwf_f1;
break;
case 2:
node = ring_node_to_send_cwf_f2;
break;
case 3:
node = ring_node_to_send_cwf_f3;
break;
default:
break;
}
return node;
}
ring_node * getRingNodeToSendSWF( unsigned char frequencyChannel)
{
ring_node *node;
node = NULL;
switch ( frequencyChannel ) {
case 0:
node = ring_node_to_send_swf_f0;
break;
case 1:
node = ring_node_to_send_swf_f1;
break;
case 2:
node = ring_node_to_send_swf_f2;
break;
default:
break;
}
return node;
}
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 void reset_extractSWF( void )
{
extractSWF = false;
swf_f0_ready = false;
swf_f1_ready = false;
swf_f2_ready = false;
}
paul
snapshot extraction for the waveform ring is operational...
r105
paul
New version of the waveform picker packet transmission...
r172 inline void waveforms_isr_f3( void )
paul
timegen version 0.0.0.1
r170 {
rtems_status_code spare_status;
if ( (lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_BURST) // in BURST the data are used to place v, e1 and e2 in the HK packet
|| (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
{ // in modes other than STANDBY and BURST, send the CWF_F3 data
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 //***
// F3
if ( (waveform_picker_regs->status & 0xc0) != 0x00 ) { // [1100 0000] check the f3 full bits
ring_node_to_send_cwf_f3 = current_ring_node_f3->previous;
current_ring_node_f3 = current_ring_node_f3->next;
if ((waveform_picker_regs->status & 0x40) == 0x40){ // [0100 0000] f3 buffer 0 is full
ring_node_to_send_cwf_f3->coarseTime = waveform_picker_regs->f3_0_coarse_time;
ring_node_to_send_cwf_f3->fineTime = waveform_picker_regs->f3_0_fine_time;
waveform_picker_regs->addr_data_f3_0 = current_ring_node_f3->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00008840; // [1000 1000 0100 0000]
}
else if ((waveform_picker_regs->status & 0x80) == 0x80){ // [1000 0000] f3 buffer 1 is full
ring_node_to_send_cwf_f3->coarseTime = waveform_picker_regs->f3_1_coarse_time;
ring_node_to_send_cwf_f3->fineTime = waveform_picker_regs->f3_1_fine_time;
waveform_picker_regs->addr_data_f3_1 = current_ring_node_f3->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00008880; // [1000 1000 1000 0000]
}
paul
timegen version 0.0.0.1
r170 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
paul
timegen version 0.0.0.1
r170 }
}
}
}
paul
New version of the waveform picker packet transmission...
r172 inline void waveforms_isr_normal( void )
paul
timegen version 0.0.0.1
r170 {
rtems_status_code status;
if ( ( (waveform_picker_regs->status & 0x30) != 0x00 ) // [0011 0000] check the f2 full bits
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 && ( (waveform_picker_regs->status & 0x0c) != 0x00 ) // [0000 1100] check the f1 full bits
&& ( (waveform_picker_regs->status & 0x03) != 0x00 )) // [0000 0011] check the f0 full bits
paul
timegen version 0.0.0.1
r170 {
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 //***
// F0
ring_node_to_send_swf_f0 = current_ring_node_f0->previous;
current_ring_node_f0 = current_ring_node_f0->next;
if ( (waveform_picker_regs->status & 0x01) == 0x01)
{
ring_node_to_send_swf_f0->coarseTime = waveform_picker_regs->f0_0_coarse_time;
ring_node_to_send_swf_f0->fineTime = waveform_picker_regs->f0_0_fine_time;
waveform_picker_regs->addr_data_f0_0 = current_ring_node_f0->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00001101; // [0001 0001 0000 0001]
}
else if ( (waveform_picker_regs->status & 0x02) == 0x02)
{
ring_node_to_send_swf_f0->coarseTime = waveform_picker_regs->f0_1_coarse_time;
ring_node_to_send_swf_f0->fineTime = waveform_picker_regs->f0_1_fine_time;
waveform_picker_regs->addr_data_f0_1 = current_ring_node_f0->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00001102; // [0001 0001 0000 0010]
}
//***
// F1
ring_node_to_send_swf_f1 = current_ring_node_f1->previous;
current_ring_node_f1 = current_ring_node_f1->next;
if ( (waveform_picker_regs->status & 0x04) == 0x04)
{
ring_node_to_send_swf_f1->coarseTime = waveform_picker_regs->f1_0_coarse_time;
ring_node_to_send_swf_f1->fineTime = waveform_picker_regs->f1_0_fine_time;
waveform_picker_regs->addr_data_f1_0 = current_ring_node_f1->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00002204; // [0010 0010 0000 0100] f1 bits = 0
}
else if ( (waveform_picker_regs->status & 0x08) == 0x08)
{
ring_node_to_send_swf_f1->coarseTime = waveform_picker_regs->f1_1_coarse_time;
ring_node_to_send_swf_f1->fineTime = waveform_picker_regs->f1_1_fine_time;
waveform_picker_regs->addr_data_f1_1 = current_ring_node_f1->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00002208; // [0010 0010 0000 1000] f1 bits = 0
}
//***
// F2
ring_node_to_send_swf_f2 = current_ring_node_f2->previous;
current_ring_node_f2 = current_ring_node_f2->next;
if ( (waveform_picker_regs->status & 0x10) == 0x10)
{
ring_node_to_send_swf_f2->coarseTime = waveform_picker_regs->f2_0_coarse_time;
ring_node_to_send_swf_f2->fineTime = waveform_picker_regs->f2_0_fine_time;
waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00004410; // [0100 0100 0001 0000]
}
else if ( (waveform_picker_regs->status & 0x20) == 0x20)
{
ring_node_to_send_swf_f2->coarseTime = waveform_picker_regs->f2_1_coarse_time;
ring_node_to_send_swf_f2->fineTime = waveform_picker_regs->f2_1_fine_time;
waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00004420; // [0100 0100 0010 0000]
}
paul
timegen version 0.0.0.1
r170 //
status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL );
if ( status != RTEMS_SUCCESSFUL)
{
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
paul
timegen version 0.0.0.1
r170 }
}
}
paul
New version of the waveform picker packet transmission...
r172 inline void waveforms_isr_burst( void )
paul
timegen version 0.0.0.1
r170 {
paul
Integration of basic parameters functions in the flight software...
r179 unsigned char status;
paul
timegen version 0.0.0.1
r170 rtems_status_code spare_status;
paul
sync
r181 status = (waveform_picker_regs->status & 0x30) >> 4; // [0011 0000] get the status bits for f2
paul
Integration of basic parameters functions in the flight software...
r179
switch(status)
{
case 1:
paul
2.0.2.1
r185 ring_node_to_send_cwf_f2 = current_ring_node_f2->previous;
ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2;
paul
Integration of basic parameters functions in the flight software...
r179 ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_0_coarse_time;
ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_0_fine_time;
paul
2.0.2.1
r185 current_ring_node_f2 = current_ring_node_f2->next;
paul
Integration of basic parameters functions in the flight software...
r179 waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->buffer_address;
paul
timegen version 0.0.0.1
r170 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
paul
timegen version 0.0.0.1
r170 }
paul
sync
r181 waveform_picker_regs->status = waveform_picker_regs->status & 0x00004410; // [0100 0100 0001 0000]
paul
Integration of basic parameters functions in the flight software...
r179 break;
case 2:
paul
2.0.2.1
r185 ring_node_to_send_cwf_f2 = current_ring_node_f2->previous;
ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2;
paul
Integration of basic parameters functions in the flight software...
r179 ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_1_coarse_time;
ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_1_fine_time;
paul
2.0.2.1
r185 current_ring_node_f2 = current_ring_node_f2->next;
paul
Integration of basic parameters functions in the flight software...
r179 waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address;
if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
}
paul
sync
r181 waveform_picker_regs->status = waveform_picker_regs->status & 0x00004420; // [0100 0100 0010 0000]
paul
Integration of basic parameters functions in the flight software...
r179 break;
default:
break;
paul
timegen version 0.0.0.1
r170 }
}
paul
New version of the waveform picker packet transmission...
r172 inline void waveforms_isr_sbm1( void )
paul
timegen version 0.0.0.1
r170 {
rtems_status_code status;
//***
// F1
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 if ( (waveform_picker_regs->status & 0x0c) != 0x00 ) { // [0000 1100] check the f1 full bits
paul
timegen version 0.0.0.1
r170 // (1) change the receiving buffer for the waveform picker
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 ring_node_to_send_cwf_f1 = current_ring_node_f1->previous;
current_ring_node_f1 = current_ring_node_f1->next;
if ( (waveform_picker_regs->status & 0x04) == 0x04)
{
ring_node_to_send_cwf_f1->coarseTime = waveform_picker_regs->f1_0_coarse_time;
ring_node_to_send_cwf_f1->fineTime = waveform_picker_regs->f1_0_fine_time;
waveform_picker_regs->addr_data_f1_0 = current_ring_node_f1->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00002204; // [0010 0010 0000 0100] f1 bits = 0
}
else if ( (waveform_picker_regs->status & 0x08) == 0x08)
{
ring_node_to_send_cwf_f1->coarseTime = waveform_picker_regs->f1_1_coarse_time;
ring_node_to_send_cwf_f1->fineTime = waveform_picker_regs->f1_1_fine_time;
waveform_picker_regs->addr_data_f1_1 = current_ring_node_f1->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00002208; // [0010 0010 0000 1000] f1 bits = 0
}
paul
timegen version 0.0.0.1
r170 // (2) send an event for the the CWF1 task for transmission (and snapshot extraction if needed)
status = rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 );
}
//***
// F0
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 if ( (waveform_picker_regs->status & 0x03) != 0x00 ) { // [0000 0011] check the f0 full bits
paul
timegen version 0.0.0.1
r170 swf_f0_ready = true;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // change f0 buffer
ring_node_to_send_swf_f0 = current_ring_node_f0->previous;
current_ring_node_f0 = current_ring_node_f0->next;
if ( (waveform_picker_regs->status & 0x01) == 0x01)
{
ring_node_to_send_swf_f0->coarseTime = waveform_picker_regs->f0_0_coarse_time;
ring_node_to_send_swf_f0->fineTime = waveform_picker_regs->f0_0_fine_time;
waveform_picker_regs->addr_data_f0_0 = current_ring_node_f0->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00001101; // [0001 0001 0000 0001]
}
else if ( (waveform_picker_regs->status & 0x02) == 0x02)
{
ring_node_to_send_swf_f0->coarseTime = waveform_picker_regs->f0_1_coarse_time;
ring_node_to_send_swf_f0->fineTime = waveform_picker_regs->f0_1_fine_time;
waveform_picker_regs->addr_data_f0_1 = current_ring_node_f0->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00001102; // [0001 0001 0000 0010]
}
paul
timegen version 0.0.0.1
r170 }
//***
// F2
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 if ( (waveform_picker_regs->status & 0x30) != 0x00 ) { // [0011 0000] check the f2 full bits
paul
timegen version 0.0.0.1
r170 swf_f2_ready = true;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // change f2 buffer
ring_node_to_send_swf_f2 = current_ring_node_f2->previous;
current_ring_node_f2 = current_ring_node_f2->next;
if ( (waveform_picker_regs->status & 0x10) == 0x10)
{
ring_node_to_send_swf_f2->coarseTime = waveform_picker_regs->f2_0_coarse_time;
ring_node_to_send_swf_f2->fineTime = waveform_picker_regs->f2_0_fine_time;
waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00004410; // [0100 0100 0001 0000]
}
else if ( (waveform_picker_regs->status & 0x20) == 0x20)
{
ring_node_to_send_swf_f2->coarseTime = waveform_picker_regs->f2_1_coarse_time;
ring_node_to_send_swf_f2->fineTime = waveform_picker_regs->f2_1_fine_time;
waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00004420; // [0100 0100 0010 0000]
}
paul
timegen version 0.0.0.1
r170 }
}
paul
New version of the waveform picker packet transmission...
r172 inline void waveforms_isr_sbm2( void )
paul
timegen version 0.0.0.1
r170 {
rtems_status_code status;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 //***
// F2
if ( (waveform_picker_regs->status & 0x30) != 0x00 ) { // [0011 0000] check the f2 full bit
paul
timegen version 0.0.0.1
r170 // (1) change the receiving buffer for the waveform picker
paul
sync
r181 ring_node_to_send_cwf_f2 = current_ring_node_f2->previous;
ring_node_to_send_cwf_f2->sid = SID_SBM2_CWF_F2;
current_ring_node_f2 = current_ring_node_f2->next;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 if ( (waveform_picker_regs->status & 0x10) == 0x10)
{
ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_0_coarse_time;
ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_0_fine_time;
waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00004410; // [0100 0100 0001 0000]
}
else if ( (waveform_picker_regs->status & 0x20) == 0x20)
{
ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_1_coarse_time;
ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_1_fine_time;
waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00004420; // [0100 0100 0010 0000]
}
paul
timegen version 0.0.0.1
r170 // (2) send an event for the waveforms transmission
status = rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 );
}
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
//***
// F0
if ( (waveform_picker_regs->status & 0x03) != 0x00 ) { // [0000 0011] check the f0 full bit
paul
timegen version 0.0.0.1
r170 swf_f0_ready = true;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // change f0 buffer
ring_node_to_send_swf_f0 = current_ring_node_f0->previous;
current_ring_node_f0 = current_ring_node_f0->next;
if ( (waveform_picker_regs->status & 0x01) == 0x01)
{
ring_node_to_send_swf_f0->coarseTime = waveform_picker_regs->f0_0_coarse_time;
ring_node_to_send_swf_f0->fineTime = waveform_picker_regs->f0_0_fine_time;
waveform_picker_regs->addr_data_f0_0 = current_ring_node_f0->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00001101; // [0001 0001 0000 0001]
}
else if ( (waveform_picker_regs->status & 0x02) == 0x02)
{
ring_node_to_send_swf_f0->coarseTime = waveform_picker_regs->f0_1_coarse_time;
ring_node_to_send_swf_f0->fineTime = waveform_picker_regs->f0_1_fine_time;
waveform_picker_regs->addr_data_f0_1 = current_ring_node_f0->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00001102; // [0001 0001 0000 0010]
}
paul
timegen version 0.0.0.1
r170 }
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
//***
// F1
if ( (waveform_picker_regs->status & 0x0c) != 0x00 ) { // [0000 1100] check the f1 full bit
paul
timegen version 0.0.0.1
r170 swf_f1_ready = true;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 ring_node_to_send_swf_f1 = current_ring_node_f1->previous;
current_ring_node_f1 = current_ring_node_f1->next;
if ( (waveform_picker_regs->status & 0x04) == 0x04)
{
ring_node_to_send_swf_f1->coarseTime = waveform_picker_regs->f1_0_coarse_time;
ring_node_to_send_swf_f1->fineTime = waveform_picker_regs->f1_0_fine_time;
waveform_picker_regs->addr_data_f1_0 = current_ring_node_f1->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00002204; // [0010 0010 0000 0100] f1 bits = 0
}
else if ( (waveform_picker_regs->status & 0x08) == 0x08)
{
ring_node_to_send_swf_f1->coarseTime = waveform_picker_regs->f1_1_coarse_time;
ring_node_to_send_swf_f1->fineTime = waveform_picker_regs->f1_1_fine_time;
waveform_picker_regs->addr_data_f1_1 = current_ring_node_f1->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0x00002208; // [0010 0010 0000 1000] f1 bits = 0
}
paul
timegen version 0.0.0.1
r170 }
}
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 rtems_isr waveforms_isr( rtems_vector_number vector )
{
paul
Minor changes in .h inclusion
r45 /** This is the interrupt sub routine called by the waveform picker core.
*
* This ISR launch different actions depending mainly on two pieces of information:
* 1. the values read in the registers of the waveform picker.
* 2. the current LFR mode.
*
*/
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
paul
timegen version 0.0.0.1
r170 // STATUS
// new error error buffer full
// 15 14 13 12 11 10 9 8
// f3 f2 f1 f0 f3 f2 f1 f0
//
// ready buffer
// 7 6 5 4 3 2 1 0
// f3_1 f3_0 f2_1 f2_0 f1_1 f1_0 f0_1 f0_0
paul
Many corrections done after Logiscope analysis
r166 rtems_status_code spare_status;
paul
Sync
r95
paul
timegen version 0.0.0.1
r170 waveforms_isr_f3();
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 if ( (waveform_picker_regs->status & 0xff00) != 0x00) // [1111 1111 0000 0000] check the error bits
paul
timegen version 0.0.0.1
r170 {
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_10 );
paul
sy_lfr_n_swf_p implemented...
r32 }
paul
packet emission task added...
r33 switch(lfrCurrentMode)
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 {
//********
// STANDBY
case(LFR_MODE_STANDBY):
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
//******
// NORMAL
case(LFR_MODE_NORMAL):
paul
timegen version 0.0.0.1
r170 waveforms_isr_normal();
paul
Sync
r95 break;
//******
// BURST
case(LFR_MODE_BURST):
paul
timegen version 0.0.0.1
r170 waveforms_isr_burst();
paul
Sync
r95 break;
//*****
// SBM1
case(LFR_MODE_SBM1):
paul
timegen version 0.0.0.1
r170 waveforms_isr_sbm1();
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
//*****
// SBM2
case(LFR_MODE_SBM2):
paul
timegen version 0.0.0.1
r170 waveforms_isr_sbm2();
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 //********
// DEFAULT
default:
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 }
}
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 //************
// RTEMS TASKS
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packets are sent by this task:
* - TM_LFR_SCIENCE_NORMAL_SWF_F0
* - TM_LFR_SCIENCE_NORMAL_SWF_F1
* - TM_LFR_SCIENCE_NORMAL_SWF_F2
*
*/
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul
2.0.1.1...
r168 bool resynchronisationEngaged;
paul
New version of the waveform picker packet transmission...
r172 ring_node *ring_node_wf_snap_extracted_ptr;
ring_node_wf_snap_extracted_ptr = (ring_node *) &ring_node_wf_snap_extracted;
paul
2.0.1.1...
r168
resynchronisationEngaged = false;
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
BOOT_PRINTF("in WFRM ***\n")
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18
while(1){
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 // wait for an RTEMS_EVENT
paul
Commit before working on the ERR 4 due to message queue...
r34 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
paul
snapshot extraction for the waveform ring is operational...
r105 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
2.0.1.1...
r168 if(resynchronisationEngaged == false)
{ // engage resynchronisation
paul
Integration of basic parameters functions in the flight software...
r179 snapshot_resynchronization( (unsigned char *) &ring_node_to_send_swf_f0->coarseTime );
paul
2.0.1.1...
r168 resynchronisationEngaged = true;
}
else
{ // reset delta_snapshot to the nominal value
PRINTF("no resynchronisation, reset delta_snapshot to the nominal value\n")
paul
Integration of basic parameters functions in the flight software...
r179 set_wfp_delta_snapshot();
paul
2.0.1.1...
r168 resynchronisationEngaged = false;
}
//
paul
Last commit before release 0-13...
r35 if (event_out == RTEMS_EVENT_MODE_NORMAL)
{
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_NORMAL\n")
paul
New version of the waveform picker packet transmission...
r172 ring_node_to_send_swf_f0->sid = SID_NORM_SWF_F0;
ring_node_to_send_swf_f1->sid = SID_NORM_SWF_F1;
ring_node_to_send_swf_f2->sid = SID_NORM_SWF_F2;
status = rtems_message_queue_send( queue_id, &ring_node_to_send_swf_f0, sizeof( ring_node* ) );
status = rtems_message_queue_send( queue_id, &ring_node_to_send_swf_f1, sizeof( ring_node* ) );
status = rtems_message_queue_send( queue_id, &ring_node_to_send_swf_f2, sizeof( ring_node* ) );
paul
Minor changes
r94 }
paul
snapshot extraction for the waveform ring is operational...
r105 if (event_out == RTEMS_EVENT_MODE_SBM1)
paul
Minor changes
r94 {
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM1\n")
paul
New version of the waveform picker packet transmission...
r172 ring_node_to_send_swf_f0->sid = SID_NORM_SWF_F0;
ring_node_wf_snap_extracted_ptr->sid = SID_NORM_SWF_F1;
ring_node_to_send_swf_f2->sid = SID_NORM_SWF_F2;
status = rtems_message_queue_send( queue_id, &ring_node_to_send_swf_f0, sizeof( ring_node* ) );
status = rtems_message_queue_send( queue_id, &ring_node_wf_snap_extracted_ptr, sizeof( ring_node* ) );
status = rtems_message_queue_send( queue_id, &ring_node_to_send_swf_f2, sizeof( ring_node* ) );
paul
Last commit before release 0-13...
r35 }
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 if (event_out == RTEMS_EVENT_MODE_SBM2)
{
DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM2\n")
paul
New version of the waveform picker packet transmission...
r172 ring_node_to_send_swf_f0->sid = SID_NORM_SWF_F0;
ring_node_to_send_swf_f1->sid = SID_NORM_SWF_F1;
ring_node_wf_snap_extracted_ptr->sid = SID_NORM_SWF_F2;
status = rtems_message_queue_send( queue_id, &ring_node_to_send_swf_f0, sizeof( ring_node* ) );
status = rtems_message_queue_send( queue_id, &ring_node_to_send_swf_f1, sizeof( ring_node* ) );
status = rtems_message_queue_send( queue_id, &ring_node_wf_snap_extracted_ptr, sizeof( ring_node* ) );
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 }
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 }
}
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17
paul
sy_lfr_n_swf_p implemented...
r32 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packet is sent by this task:
* - TM_LFR_SCIENCE_NORMAL_CWF_F3
*
*/
paul
sy_lfr_n_swf_p implemented...
r32 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul
New version of the waveform picker packet transmission...
r172 ring_node ring_node_cwf3_light;
paul
rev 3.0.0.2
r205 ring_node *ring_node_to_send_cwf;
paul
sy_lfr_n_swf_p implemented...
r32
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
paul
New version of the waveform picker packet transmission...
r172 ring_node_to_send_cwf_f3->sid = SID_NORM_CWF_LONG_F3;
// init the ring_node_cwf3_light structure
ring_node_cwf3_light.buffer_address = (int) wf_cont_f3_light;
ring_node_cwf3_light.coarseTime = 0x00;
ring_node_cwf3_light.fineTime = 0x00;
ring_node_cwf3_light.next = NULL;
ring_node_cwf3_light.previous = NULL;
ring_node_cwf3_light.sid = SID_NORM_CWF_F3;
ring_node_cwf3_light.status = 0x00;
paul
Last commit before release 0-13...
r35 BOOT_PRINTF("in CWF3 ***\n")
paul
sy_lfr_n_swf_p implemented...
r32
while(1){
// wait for an RTEMS_EVENT
paul
packet emission task added...
r33 rtems_event_receive( RTEMS_EVENT_0,
paul
sy_lfr_n_swf_p implemented...
r32 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
|| (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode==LFR_MODE_SBM2) )
paul
rev 1.0.0.1
r98 {
paul
rev 3.0.0.2
r205 ring_node_to_send_cwf = getRingNodeToSendCWF( 3 );
paul
ICD 2.0...
r92 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
{
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129 PRINTF("send CWF_LONG_F3\n")
paul
New version of the waveform picker packet transmission...
r172 ring_node_to_send_cwf_f3->sid = SID_NORM_CWF_LONG_F3;
paul
rev 3.0.0.2
r205 status = rtems_message_queue_send( queue_id, &ring_node_to_send_cwf, sizeof( ring_node* ) );
paul
ICD 2.0...
r92 }
else
{
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129 PRINTF("send CWF_F3 (light)\n")
paul
rev 3.0.0.2
r205 send_waveform_CWF3_light( ring_node_to_send_cwf, &ring_node_cwf3_light, queue_id );
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129 }
paul
packet emission task added...
r33 }
paul
ICD 2.0...
r92 else
{
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129 PRINTF1("in CWF3 *** lfrCurrentMode is %d, no data will be sent\n", lfrCurrentMode)
paul
packet emission task added...
r33 }
}
}
rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packet is sent by this function:
* - TM_LFR_SCIENCE_BURST_CWF_F2
* - TM_LFR_SCIENCE_SBM2_CWF_F2
*
*/
paul
packet emission task added...
r33 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul
Integration of basic parameters functions in the flight software...
r179 ring_node *ring_node_to_send;
paul
sync
r181 unsigned long long int acquisitionTimeF0_asLong;
acquisitionTimeF0_asLong = 0x00;
paul
packet emission task added...
r33
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
BOOT_PRINTF("in CWF2 ***\n")
paul
packet emission task added...
r33
while(1){
// wait for an RTEMS_EVENT
rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
Integration of basic parameters functions in the flight software...
r179 ring_node_to_send = getRingNodeToSendCWF( 2 );
paul
packet emission task added...
r33 if (event_out == RTEMS_EVENT_MODE_BURST)
{
paul
Integration of basic parameters functions in the flight software...
r179 status = rtems_message_queue_send( queue_id, &ring_node_to_send, sizeof( ring_node* ) );
paul
packet emission task added...
r33 }
paul
First version of the rings for the waveform picker.
r87 if (event_out == RTEMS_EVENT_MODE_SBM2)
paul
packet emission task added...
r33 {
paul
Integration of basic parameters functions in the flight software...
r179 status = rtems_message_queue_send( queue_id, &ring_node_to_send, sizeof( ring_node* ) );
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 // launch snapshot extraction if needed
if (extractSWF == true)
{
paul
sync
r181 ring_node_to_send_swf_f2 = ring_node_to_send_cwf_f2;
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 // extract the snapshot
paul
sync
r181 build_snapshot_from_ring( ring_node_to_send_swf_f2, 2, acquisitionTimeF0_asLong );
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 // send the snapshot when built
status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 );
extractSWF = false;
}
if (swf_f0_ready && swf_f1_ready)
{
extractSWF = true;
paul
sync
r181 // record the acquition time of the fà snapshot to use to build the snapshot at f2
acquisitionTimeF0_asLong = get_acquisition_time( (unsigned char *) &ring_node_to_send_swf_f0->coarseTime );
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 swf_f0_ready = false;
swf_f1_ready = false;
}
paul
packet emission task added...
r33 }
}
}
rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packet is sent by this function:
* - TM_LFR_SCIENCE_SBM1_CWF_F1
*
*/
paul
packet emission task added...
r33 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul
packet emission task added...
r33
paul
TC_LFR_LOAD_KCOEFFICIENTS...
r194 ring_node *ring_node_to_send_cwf;
paul
packet emission task added...
r33
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
BOOT_PRINTF("in CWF1 ***\n")
paul
packet emission task added...
r33
while(1){
// wait for an RTEMS_EVENT
rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
Integration of basic parameters functions in the flight software...
r179 ring_node_to_send_cwf = getRingNodeToSendCWF( 1 );
paul
New version of the waveform picker packet transmission...
r172 ring_node_to_send_cwf_f1->sid = SID_SBM1_CWF_F1;
paul
Integration of basic parameters functions in the flight software...
r179 status = rtems_message_queue_send( queue_id, &ring_node_to_send_cwf, sizeof( ring_node* ) );
paul
fifo occupation reported in the HK packet
r197 if (status != 0)
paul
printf removed or replaced by PRINTF macros...
r227 {
PRINTF("cwf sending failed\n")
}
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 // launch snapshot extraction if needed
if (extractSWF == true)
{
paul
Integration of basic parameters functions in the flight software...
r179 ring_node_to_send_swf_f1 = ring_node_to_send_cwf;
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 // launch the snapshot extraction
status = rtems_event_send( Task_id[TASKID_SWBD], RTEMS_EVENT_MODE_SBM1 );
extractSWF = false;
}
if (swf_f0_ready == true)
{
extractSWF = true;
swf_f0_ready = false; // this step shall be executed only one time
}
if ((swf_f1_ready == true) && (swf_f2_ready == true)) // swf_f1 is ready after the extraction
{
status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM1 );
swf_f1_ready = false;
swf_f2_ready = false;
}
paul
sy_lfr_n_swf_p implemented...
r32 }
}
paul
snapshot extraction for the waveform ring is operational...
r105 rtems_task swbd_task(rtems_task_argument argument)
{
/** This RTEMS task is dedicated to the building of snapshots from different continuous waveforms buffers.
*
* @param unused is the starting argument of the RTEMS task
*
*/
rtems_event_set event_out;
paul
sync
r181 unsigned long long int acquisitionTimeF0_asLong;
acquisitionTimeF0_asLong = 0x00;
paul
snapshot extraction for the waveform ring is operational...
r105
BOOT_PRINTF("in SWBD ***\n")
while(1){
// wait for an RTEMS_EVENT
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 rtems_event_receive( RTEMS_EVENT_MODE_SBM1 | RTEMS_EVENT_MODE_SBM2,
paul
snapshot extraction for the waveform ring is operational...
r105 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 if (event_out == RTEMS_EVENT_MODE_SBM1)
{
paul
sync
r181 acquisitionTimeF0_asLong = get_acquisition_time( (unsigned char *) &ring_node_to_send_swf_f0->coarseTime );
build_snapshot_from_ring( ring_node_to_send_swf_f1, 1, acquisitionTimeF0_asLong );
paul
the interrupt sub routine related to the waveform picker is now lighter...
r112 swf_f1_ready = true; // the snapshot has been extracted and is ready to be sent
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 }
else
{
PRINTF1("in SWBD *** unexpected rtems event received %x\n", (int) event_out)
}
paul
snapshot extraction for the waveform ring is operational...
r105 }
}
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 //******************
// general functions
paul
First version of the rings for the waveform picker.
r87
paul
Sync
r139 void WFP_init_rings( void )
paul
First version of the rings for the waveform picker.
r87 {
paul
ICD 2.0...
r92 // F0 RING
paul
New version of the waveform picker packet transmission...
r172 init_ring( waveform_ring_f0, NB_RING_NODES_F0, wf_buffer_f0, WFRM_BUFFER );
paul
First version of the rings for the waveform picker.
r87 // F1 RING
paul
New version of the waveform picker packet transmission...
r172 init_ring( waveform_ring_f1, NB_RING_NODES_F1, wf_buffer_f1, WFRM_BUFFER );
paul
First version of the rings for the waveform picker.
r87 // F2 RING
paul
New version of the waveform picker packet transmission...
r172 init_ring( waveform_ring_f2, NB_RING_NODES_F2, wf_buffer_f2, WFRM_BUFFER );
paul
waveform buffers declaration modified...
r131 // F3 RING
paul
New version of the waveform picker packet transmission...
r172 init_ring( waveform_ring_f3, NB_RING_NODES_F3, wf_buffer_f3, WFRM_BUFFER );
paul
First version of the rings for the waveform picker.
r87
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 ring_node_wf_snap_extracted.buffer_address = (int) wf_snap_extracted;
paul
ICD 2.0...
r92 DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0)
paul
First version of the rings for the waveform picker.
r87 DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1)
DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2)
paul
waveform buffers declaration modified...
r131 DEBUG_PRINTF1("waveform_ring_f3 @%x\n", (unsigned int) waveform_ring_f3)
paul
New version of the waveform picker packet transmission...
r172 DEBUG_PRINTF1("wf_buffer_f0 @%x\n", (unsigned int) wf_buffer_f0)
DEBUG_PRINTF1("wf_buffer_f1 @%x\n", (unsigned int) wf_buffer_f1)
DEBUG_PRINTF1("wf_buffer_f2 @%x\n", (unsigned int) wf_buffer_f2)
DEBUG_PRINTF1("wf_buffer_f3 @%x\n", (unsigned int) wf_buffer_f3)
paul
waveform buffers declaration modified...
r131 }
paul
First version of the rings for the waveform picker.
r87
paul
Sync
r139 void WFP_reset_current_ring_nodes( void )
paul
First version of the rings for the waveform picker.
r87 {
paul
Integration of basic parameters functions in the flight software...
r179 current_ring_node_f0 = waveform_ring_f0[0].next;
current_ring_node_f1 = waveform_ring_f1[0].next;
current_ring_node_f2 = waveform_ring_f2[0].next;
current_ring_node_f3 = waveform_ring_f3[0].next;
paul
ICD 2.0...
r92
paul
Integration of basic parameters functions in the flight software...
r179 ring_node_to_send_swf_f0 = waveform_ring_f0;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 ring_node_to_send_swf_f1 = waveform_ring_f1;
ring_node_to_send_swf_f2 = waveform_ring_f2;
paul
waveform buffers declaration modified...
r131
paul
Integration of basic parameters functions in the flight software...
r179 ring_node_to_send_cwf_f1 = waveform_ring_f1;
ring_node_to_send_cwf_f2 = waveform_ring_f2;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 ring_node_to_send_cwf_f3 = waveform_ring_f3;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 }
paul
New version of the waveform picker packet transmission...
r172 int send_waveform_CWF3_light( ring_node *ring_node_to_send, ring_node *ring_node_cwf3_light, rtems_id queue_id )
paul
CWF_F3 packets are now compliant with the ICD...
r38 {
paul
Header files inclusion reworked...
r40 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
*
* @param waveform points to the buffer containing the data that will be send.
* @param headerCWF points to a table of headers that have been prepared for the data transmission.
* @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
* contain information to setup the transmission of the data packets.
*
* By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
* from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
*
*/
paul
CWF_F3 packets are now compliant with the ICD...
r38 unsigned int i;
int ret;
rtems_status_code status;
paul
Integration of basic parameters functions in the flight software...
r179
paul
CWF_F3 packets are now compliant with the ICD...
r38 char *sample;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 int *dataPtr;
paul
CWF_F3 packets are now compliant with the ICD...
r38
ret = LFR_DEFAULT;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 dataPtr = (int*) ring_node_to_send->buffer_address;
paul
New version of the waveform picker packet transmission...
r172 ring_node_cwf3_light->coarseTime = ring_node_to_send->coarseTime;
ring_node_cwf3_light->fineTime = ring_node_to_send->fineTime;
paul
CWF_F3 packets are now compliant with the ICD...
r38 //**********************
// BUILD CWF3_light DATA
paul
Minor changes
r93 for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
paul
CWF_F3 packets are now compliant with the ICD...
r38 {
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 sample = (char*) &dataPtr[ (i * NB_WORDS_SWF_BLK) ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
paul
CWF_F3 packets are now compliant with the ICD...
r38 }
paul
New version of the waveform picker packet transmission...
r172 // SEND PACKET
status = rtems_message_queue_send( queue_id, &ring_node_cwf3_light, sizeof( ring_node* ) );
if (status != RTEMS_SUCCESSFUL) {
ret = LFR_DEFAULT;
paul
CWF_F3 packets are now compliant with the ICD...
r38 }
return ret;
}
paul
1.0.0.7...
r135 void compute_acquisition_time( unsigned int coarseTime, unsigned int fineTime,
unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime )
{
unsigned long long int acquisitionTimeAsLong;
unsigned char localAcquisitionTime[6];
double deltaT;
deltaT = 0.;
localAcquisitionTime[0] = (unsigned char) ( coarseTime >> 24 );
localAcquisitionTime[1] = (unsigned char) ( coarseTime >> 16 );
localAcquisitionTime[2] = (unsigned char) ( coarseTime >> 8 );
localAcquisitionTime[3] = (unsigned char) ( coarseTime );
paul
Sync
r147 localAcquisitionTime[4] = (unsigned char) ( fineTime >> 8 );
localAcquisitionTime[5] = (unsigned char) ( fineTime );
paul
1.0.0.7...
r135
acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 )
+ ( (unsigned long long int) localAcquisitionTime[1] << 32 )
paul
2.0.1.0...
r164 + ( (unsigned long long int) localAcquisitionTime[2] << 24 )
+ ( (unsigned long long int) localAcquisitionTime[3] << 16 )
+ ( (unsigned long long int) localAcquisitionTime[4] << 8 )
+ ( (unsigned long long int) localAcquisitionTime[5] );
paul
1.0.0.7...
r135
switch( sid )
{
case SID_NORM_SWF_F0:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ;
break;
case SID_NORM_SWF_F1:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ;
break;
case SID_NORM_SWF_F2:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ;
break;
case SID_SBM1_CWF_F1:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 4096. ;
break;
case SID_SBM2_CWF_F2:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
break;
case SID_BURST_CWF_F2:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
break;
case SID_NORM_CWF_F3:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF_SHORT_F3 * 65536. / 16. ;
break;
case SID_NORM_CWF_LONG_F3:
deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 16. ;
break;
default:
paul
New version of the waveform picker packet transmission...
r172 PRINTF1("in compute_acquisition_time *** ERR unexpected sid %d\n", sid)
paul
1.0.0.7...
r135 deltaT = 0.;
break;
}
acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT;
//
acquisitionTime[0] = (unsigned char) (acquisitionTimeAsLong >> 40);
acquisitionTime[1] = (unsigned char) (acquisitionTimeAsLong >> 32);
acquisitionTime[2] = (unsigned char) (acquisitionTimeAsLong >> 24);
acquisitionTime[3] = (unsigned char) (acquisitionTimeAsLong >> 16);
acquisitionTime[4] = (unsigned char) (acquisitionTimeAsLong >> 8 );
acquisitionTime[5] = (unsigned char) (acquisitionTimeAsLong );
}
paul
sync
r181 void build_snapshot_from_ring( ring_node *ring_node_to_send, unsigned char frequencyChannel, unsigned long long int acquisitionTimeF0_asLong )
paul
snapshot extraction for the waveform ring is operational...
r105 {
unsigned int i;
unsigned long long int centerTime_asLong;
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 unsigned long long int acquisitionTime_asLong;
unsigned long long int bufferAcquisitionTime_asLong;
paul
snapshot extraction for the waveform ring is operational...
r105 unsigned char *ptr1;
unsigned char *ptr2;
paul
Sync
r147 unsigned char *timeCharPtr;
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 unsigned char nb_ring_nodes;
unsigned long long int frequency_asLong;
unsigned long long int nbTicksPerSample_asLong;
unsigned long long int nbSamplesPart1_asLong;
unsigned long long int sampleOffset_asLong;
paul
snapshot extraction for the waveform ring is operational...
r105
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 unsigned int deltaT_F0;
unsigned int deltaT_F1;
unsigned long long int deltaT_F2;
paul
snapshot extraction for the waveform ring is operational...
r105
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 deltaT_F0 = 2731; // (2048. / 24576. / 2.) * 65536. = 2730.667;
deltaT_F1 = 16384; // (2048. / 4096. / 2.) * 65536. = 16384;
deltaT_F2 = 262144; // (2048. / 256. / 2.) * 65536. = 262144;
sampleOffset_asLong = 0x00;
paul
snapshot extraction for the waveform ring is operational...
r105
paul
sync
r181 // (1) get the f0 acquisition time => the value is passed in argument
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106
paul
rev 1.0.0.4
r110 // (2) compute the central reference time
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0;
paul
snapshot extraction for the waveform ring is operational...
r105
paul
rev 1.0.0.4
r110 // (3) compute the acquisition time of the current snapshot
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 switch(frequencyChannel)
{
case 1: // 1 is for F1 = 4096 Hz
acquisitionTime_asLong = centerTime_asLong - deltaT_F1;
nb_ring_nodes = NB_RING_NODES_F1;
frequency_asLong = 4096;
nbTicksPerSample_asLong = 16; // 65536 / 4096;
break;
case 2: // 2 is for F2 = 256 Hz
acquisitionTime_asLong = centerTime_asLong - deltaT_F2;
nb_ring_nodes = NB_RING_NODES_F2;
frequency_asLong = 256;
nbTicksPerSample_asLong = 256; // 65536 / 256;
break;
default:
acquisitionTime_asLong = centerTime_asLong;
frequency_asLong = 256;
nbTicksPerSample_asLong = 256;
break;
}
paul
snapshot extraction for the waveform ring is operational...
r105
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 //****************************************************************************
paul
rev 1.0.0.4
r110 // (4) search the ring_node with the acquisition time <= acquisitionTime_asLong
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 for (i=0; i<nb_ring_nodes; i++)
{
PRINTF1("%d ... ", i)
paul
sync
r181 bufferAcquisitionTime_asLong = get_acquisition_time( (unsigned char *) &ring_node_to_send->coarseTime );
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 if (bufferAcquisitionTime_asLong <= acquisitionTime_asLong)
{
PRINTF1("buffer found with acquisition time = %llx\n", bufferAcquisitionTime_asLong)
break;
}
ring_node_to_send = ring_node_to_send->previous;
}
paul
snapshot extraction for the waveform ring is operational...
r105
paul
rev 1.0.0.4
r110 // (5) compute the number of samples to take in the current buffer
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 sampleOffset_asLong = ((acquisitionTime_asLong - bufferAcquisitionTime_asLong) * frequency_asLong ) >> 16;
nbSamplesPart1_asLong = NB_SAMPLES_PER_SNAPSHOT - sampleOffset_asLong;
paul
sync
r181 PRINTF2("sampleOffset_asLong = %lld, nbSamplesPart1_asLong = %lld\n", sampleOffset_asLong, nbSamplesPart1_asLong)
paul
snapshot extraction for the waveform ring is operational...
r105
paul
rev 1.0.0.4
r110 // (6) compute the final acquisition time
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 acquisitionTime_asLong = bufferAcquisitionTime_asLong +
sampleOffset_asLong * nbTicksPerSample_asLong;
paul
snapshot extraction for the waveform ring is operational...
r105
paul
rev 1.0.0.4
r110 // (7) copy the acquisition time at the beginning of the extrated snapshot
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 ptr1 = (unsigned char*) &acquisitionTime_asLong;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // fine time
ptr2 = (unsigned char*) &ring_node_wf_snap_extracted.fineTime;
ptr2[2] = ptr1[ 4 + 2 ];
ptr2[3] = ptr1[ 5 + 2 ];
// coarse time
ptr2 = (unsigned char*) &ring_node_wf_snap_extracted.coarseTime;
paul
Sync
r147 ptr2[0] = ptr1[ 0 + 2 ];
ptr2[1] = ptr1[ 1 + 2 ];
ptr2[2] = ptr1[ 2 + 2 ];
ptr2[3] = ptr1[ 3 + 2 ];
paul
snapshot extraction for the waveform ring is operational...
r105
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 // re set the synchronization bit
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 timeCharPtr = (unsigned char*) &ring_node_to_send->coarseTime;
paul
Sync
r147 ptr2[0] = ptr2[0] | (timeCharPtr[0] & 0x80); // [1000 0000]
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106
paul
Sync
r147 if ( (nbSamplesPart1_asLong >= NB_SAMPLES_PER_SNAPSHOT) | (nbSamplesPart1_asLong < 0) )
{
nbSamplesPart1_asLong = 0;
}
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 // copy the part 1 of the snapshot in the extracted buffer
for ( i = 0; i < (nbSamplesPart1_asLong * NB_WORDS_SWF_BLK); i++ )
{
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 wf_snap_extracted[i] =
((int*) ring_node_to_send->buffer_address)[ i + (sampleOffset_asLong * NB_WORDS_SWF_BLK) ];
paul
snapshots extraction fully functionnal in SBM1 and SBM2
r106 }
// copy the part 2 of the snapshot in the extracted buffer
ring_node_to_send = ring_node_to_send->next;
for ( i = (nbSamplesPart1_asLong * NB_WORDS_SWF_BLK); i < (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK); i++ )
paul
snapshot extraction for the waveform ring is operational...
r105 {
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 wf_snap_extracted[i] =
((int*) ring_node_to_send->buffer_address)[ (i-(nbSamplesPart1_asLong * NB_WORDS_SWF_BLK)) ];
paul
snapshot extraction for the waveform ring is operational...
r105 }
paul
Minor changes
r93 }
paul
CWF_F3 packets are now compliant with the ICD...
r38
paul
2.0.1.1...
r168 void snapshot_resynchronization( unsigned char *timePtr )
paul
1.0.0.7...
r135 {
paul
2.0.1.1...
r168 unsigned long long int acquisitionTime;
unsigned long long int centerTime;
unsigned long long int previousTick;
unsigned long long int nextTick;
unsigned long long int deltaPreviousTick;
unsigned long long int deltaNextTick;
unsigned int deltaTickInF2;
double deltaPrevious;
double deltaNext;
paul
1.0.0.7...
r135
paul
2.0.1.1...
r168 acquisitionTime = get_acquisition_time( timePtr );
// compute center time
centerTime = acquisitionTime + 2731; // (2048. / 24576. / 2.) * 65536. = 2730.667;
previousTick = centerTime - (centerTime & 0xffff);
nextTick = previousTick + 65536;
paul
1.0.0.7...
r135
paul
2.0.1.1...
r168 deltaPreviousTick = centerTime - previousTick;
deltaNextTick = nextTick - centerTime;
deltaPrevious = ((double) deltaPreviousTick) / 65536. * 1000.;
deltaNext = ((double) deltaNextTick) / 65536. * 1000.;
paul
2.0.2.1
r185 PRINTF2("delta previous = %f ms, delta next = %f ms\n", deltaPrevious, deltaNext)
PRINTF2("delta previous = %llu, delta next = %llu\n", deltaPreviousTick, deltaNextTick)
paul
2.0.1.1...
r168
// which tick is the closest
if (deltaPreviousTick > deltaNextTick)
{
deltaTickInF2 = floor( (deltaNext * 256. / 1000.) ); // the division by 2 is important here
waveform_picker_regs->delta_snapshot = waveform_picker_regs->delta_snapshot + deltaTickInF2;
paul
printf removed or replaced by PRINTF macros...
r227 PRINTF1("correction of = + %u\n", deltaTickInF2)
paul
2.0.1.1...
r168 }
else
{
deltaTickInF2 = floor( (deltaPrevious * 256. / 1000.) ); // the division by 2 is important here
waveform_picker_regs->delta_snapshot = waveform_picker_regs->delta_snapshot - deltaTickInF2;
paul
printf removed or replaced by PRINTF macros...
r227 PRINTF1("correction of = - %u\n", deltaTickInF2)
paul
2.0.1.1...
r168 }
paul
1.0.0.7...
r135 }
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 //**************
// wfp registers
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 void reset_wfp_burst_enable( void )
paul
Sync
r97 {
/** This function resets the waveform picker burst_enable register.
*
* The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
*
*/
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // [1000 000] burst f2, f1, f0 enable f3, f2, f1, f0
waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable & 0x80;
paul
Sync
r97 }
void reset_wfp_status( void )
{
/** This function resets the waveform picker status register.
*
* All status bits are set to 0 [new_err full_err full].
*
*/
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 waveform_picker_regs->status = 0xffff;
paul
Sync
r97 }
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 void reset_wfp_buffer_addresses( void )
{
// F0
paul
Integration of basic parameters functions in the flight software...
r179 waveform_picker_regs->addr_data_f0_0 = current_ring_node_f0->previous->buffer_address; // 0x08
waveform_picker_regs->addr_data_f0_1 = current_ring_node_f0->buffer_address; // 0x0c
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // F1
paul
Integration of basic parameters functions in the flight software...
r179 waveform_picker_regs->addr_data_f1_0 = current_ring_node_f1->previous->buffer_address; // 0x10
waveform_picker_regs->addr_data_f1_1 = current_ring_node_f1->buffer_address; // 0x14
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // F2
paul
Integration of basic parameters functions in the flight software...
r179 waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->previous->buffer_address; // 0x18
waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address; // 0x1c
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 // F3
paul
Integration of basic parameters functions in the flight software...
r179 waveform_picker_regs->addr_data_f3_0 = current_ring_node_f3->previous->buffer_address; // 0x20
waveform_picker_regs->addr_data_f3_1 = current_ring_node_f3->buffer_address; // 0x24
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 }
void reset_waveform_picker_regs( void )
paul
Sync
r97 {
/** This function resets the waveform picker module registers.
*
* The registers affected by this function are located at the following offset addresses:
* - 0x00 data_shaping
* - 0x04 run_burst_enable
* - 0x08 addr_data_f0
* - 0x0C addr_data_f1
* - 0x10 addr_data_f2
* - 0x14 addr_data_f3
* - 0x18 status
* - 0x1C delta_snapshot
* - 0x20 delta_f0
* - 0x24 delta_f0_2
* - 0x28 delta_f1
* - 0x2c delta_f2
* - 0x30 nb_data_by_buffer
* - 0x34 nb_snapshot_param
* - 0x38 start_date
* - 0x3c nb_word_in_buffer
*
*/
paul
rev 1.0.0.4
r110 set_wfp_data_shaping(); // 0x00 *** R1 R0 SP1 SP0 BW
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
paul
rev 1.0.0.4
r110 reset_wfp_burst_enable(); // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
reset_wfp_buffer_addresses();
paul
rev 1.0.0.4
r110 reset_wfp_status(); // 0x18
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
set_wfp_delta_snapshot(); // 0x1c *** 300 s => 0x12bff
paul
Sync
r97 set_wfp_delta_f0_f0_2(); // 0x20, 0x24
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
paul
Sync
r97 set_wfp_delta_f1(); // 0x28
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
paul
Sync
r97 set_wfp_delta_f2(); // 0x2c
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
DEBUG_PRINTF1("delta_snapshot %x\n", waveform_picker_regs->delta_snapshot)
DEBUG_PRINTF1("delta_f0 %x\n", waveform_picker_regs->delta_f0)
DEBUG_PRINTF1("delta_f0_2 %x\n", waveform_picker_regs->delta_f0_2)
DEBUG_PRINTF1("delta_f1 %x\n", waveform_picker_regs->delta_f1)
DEBUG_PRINTF1("delta_f2 %x\n", waveform_picker_regs->delta_f2)
paul
rev 1.0.0.1
r98 // 2688 = 8 * 336
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 waveform_picker_regs->nb_data_by_buffer = 0xa7f; // 0x30 *** 2688 - 1 => nb samples -1
waveform_picker_regs->snapshot_param = 0xa80; // 0x34 *** 2688 => nb samples
waveform_picker_regs->start_date = 0x7fffffff; // 0x38
//
// coarse time and fine time registers are not initialized, they are volatile
//
waveform_picker_regs->buffer_length = 0x1f8;// buffer length in burst = 3 * 2688 / 16 = 504 = 0x1f8
paul
Sync
r97 }
void set_wfp_data_shaping( void )
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
Header files inclusion reworked...
r40 /** This function sets the data_shaping register of the waveform picker module.
*
* The value is read from one field of the parameter_dump_packet structure:\n
* bw_sp0_sp1_r0_r1
*
*/
paul
sy_lfr_n_swf_p implemented...
r32 unsigned char data_shaping;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
// waveform picker : [R1 R0 SP1 SP0 BW]
paul
sy_lfr_n_swf_p implemented...
r32
paul
R3 updates. TC handlers added for the new telecommands:...
r192 data_shaping = parameter_dump_packet.sy_lfr_common_parameters;
paul
sy_lfr_n_swf_p implemented...
r32
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 waveform_picker_regs->data_shaping =
paul
Major bug corrected on the handling of TC_LFR_LOAD_COMMON_PAR
r199 ( (data_shaping & 0x20) >> 5 ) // BW
+ ( (data_shaping & 0x10) >> 3 ) // SP0
+ ( (data_shaping & 0x08) >> 1 ) // SP1
paul
Rev 3.0.0.5...
r213 + ( (data_shaping & 0x04) << 1 ) // R0
paul
Major bug corrected on the handling of TC_LFR_LOAD_COMMON_PAR
r199 + ( (data_shaping & 0x02) << 3 ) // R1
paul
R2 parameter added to TC_LFR_LOAD_COMMON_PAR...
r195 + ( (data_shaping & 0x01) << 5 ); // R2
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
Integration of the VHDL_DEV option...
r90 void set_wfp_burst_enable_register( unsigned char mode )
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
Header files inclusion reworked...
r40 /** This function sets the waveform picker burst_enable register depending on the mode.
*
* @param mode is the LFR mode to launch.
*
* The burst bits shall be before the enable bits.
*
*/
paul
Integration of the VHDL_DEV option...
r90 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
// the burst bits shall be set first, before the enable bits
switch(mode) {
case(LFR_MODE_NORMAL):
waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
break;
case(LFR_MODE_BURST):
waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129 // waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
paul
spacecraft potential extraction upgraded
r130 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0c; // [1100] enable f3 AND f2
paul
Integration of the VHDL_DEV option...
r90 break;
case(LFR_MODE_SBM1):
waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
break;
case(LFR_MODE_SBM2):
waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
break;
default:
waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
break;
}
}
paul
Sync
r97
void set_wfp_delta_snapshot( void )
paul
Integration of the VHDL_DEV option...
r90 {
paul
Sync
r97 /** This function sets the delta_snapshot register of the waveform picker module.
paul
Integration of the VHDL_DEV option...
r90 *
paul
Sync
r97 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
* - sy_lfr_n_swf_p[0]
* - sy_lfr_n_swf_p[1]
paul
Header files inclusion reworked...
r40 *
*/
paul
Sync
r97 unsigned int delta_snapshot;
unsigned int delta_snapshot_in_T2;
paul
packet emission task added...
r33
paul
Sync
r97 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
+ parameter_dump_packet.sy_lfr_n_swf_p[1];
delta_snapshot_in_T2 = delta_snapshot * 256;
paul
Bug #177...
r160 waveform_picker_regs->delta_snapshot = delta_snapshot_in_T2 - 1; // max 4 bytes
paul
Sync
r95 }
paul
Sync
r97 void set_wfp_delta_f0_f0_2( void )
paul
Sync
r95 {
paul
Sync
r97 unsigned int delta_snapshot;
unsigned int nb_samples_per_snapshot;
float delta_f0_in_float;
delta_snapshot = waveform_picker_regs->delta_snapshot;
nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
delta_f0_in_float =nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 24576.) * 256.;
waveform_picker_regs->delta_f0 = delta_snapshot - floor( delta_f0_in_float );
paul
rev 2.0.2.3...
r191 waveform_picker_regs->delta_f0_2 = 0x30; // 48 = 11 0000, max 7 bits
paul
Integration of the VHDL_DEV option...
r90 }
paul
Sync
r95
paul
Sync
r97 void set_wfp_delta_f1( void )
paul
Sync
r95 {
paul
Sync
r97 unsigned int delta_snapshot;
unsigned int nb_samples_per_snapshot;
float delta_f1_in_float;
delta_snapshot = waveform_picker_regs->delta_snapshot;
nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
delta_f1_in_float = nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 4096.) * 256.;
waveform_picker_regs->delta_f1 = delta_snapshot - floor( delta_f1_in_float );
paul
Sync
r95 }
paul
Sync
r97 void set_wfp_delta_f2()
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
Sync
r97 unsigned int delta_snapshot;
unsigned int nb_samples_per_snapshot;
paul
Header files inclusion reworked...
r40
paul
Sync
r97 delta_snapshot = waveform_picker_regs->delta_snapshot;
nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
waveform_picker_regs->delta_f2 = delta_snapshot - nb_samples_per_snapshot / 2;
paul
Integration of the VHDL_DEV option...
r90 }
paul
sy_lfr_n_swf_p implemented...
r32
//*****************
// local parameters
paul
sequence_cnt field set for BP and ASM packets
r133
void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
paul
sy_lfr_n_swf_p implemented...
r32 {
paul
sequence_cnt field set for BP and ASM packets
r133 /** This function increments the parameter "sequence_cnt" depending on the sid passed in argument.
paul
Header files inclusion reworked...
r40 *
paul
sequence_cnt field set for BP and ASM packets
r133 * @param packet_sequence_control is a pointer toward the parameter sequence_cnt to update.
* @param sid is the source identifier of the packet being updated.
*
* REQ-LFR-SRS-5240 / SSS-CP-FS-590
* The sequence counters shall wrap around from 2^14 to zero.
* The sequence counter shall start at zero at startup.
*
* REQ-LFR-SRS-5239 / SSS-CP-FS-580
* All TM_LFR_SCIENCE_ packets are sent to ground, i.e. destination id = 0
paul
Header files inclusion reworked...
r40 *
*/
paul
sequence counters management added
r56 unsigned short *sequence_cnt;
unsigned short segmentation_grouping_flag;
unsigned short new_packet_sequence_control;
paul
sequence_cnt field set for BP and ASM packets
r133 rtems_mode initial_mode_set;
rtems_mode current_mode_set;
rtems_status_code status;
paul
sequence counters management added
r56
paul
sequence_cnt field set for BP and ASM packets
r133 //******************************************
// CHANGE THE MODE OF THE CALLING RTEMS TASK
status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &initial_mode_set );
if ( (sid == SID_NORM_SWF_F0) || (sid == SID_NORM_SWF_F1) || (sid == SID_NORM_SWF_F2)
|| (sid == SID_NORM_CWF_F3) || (sid == SID_NORM_CWF_LONG_F3)
|| (sid == SID_BURST_CWF_F2)
|| (sid == SID_NORM_ASM_F0) || (sid == SID_NORM_ASM_F1) || (sid == SID_NORM_ASM_F2)
|| (sid == SID_NORM_BP1_F0) || (sid == SID_NORM_BP1_F1) || (sid == SID_NORM_BP1_F2)
|| (sid == SID_NORM_BP2_F0) || (sid == SID_NORM_BP2_F1) || (sid == SID_NORM_BP2_F2)
|| (sid == SID_BURST_BP1_F0) || (sid == SID_BURST_BP2_F0)
|| (sid == SID_BURST_BP1_F1) || (sid == SID_BURST_BP2_F1) )
paul
sequence counters management added
r56 {
paul
Rev 1.0.0.6
r128 sequence_cnt = (unsigned short *) &sequenceCounters_SCIENCE_NORMAL_BURST;
paul
sequence counters management added
r56 }
paul
sequence_cnt field set for BP and ASM packets
r133 else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2)
|| (sid == SID_SBM1_BP1_F0) || (sid == SID_SBM1_BP2_F0)
|| (sid == SID_SBM2_BP1_F0) || (sid == SID_SBM2_BP2_F0)
|| (sid == SID_SBM2_BP1_F1) || (sid == SID_SBM2_BP2_F1) )
paul
sequence counters management added
r56 {
paul
Rev 1.0.0.6
r128 sequence_cnt = (unsigned short *) &sequenceCounters_SCIENCE_SBM1_SBM2;
paul
sequence counters management added
r56 }
else
{
paul
Rev 1.0.0.6
r128 sequence_cnt = (unsigned short *) NULL;
paul
sequence counters management added
r56 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
}
paul
Bug #861...
r84 if (sequence_cnt != NULL)
{
paul
Bug #117...
r155 segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
*sequence_cnt = (*sequence_cnt) & 0x3fff;
new_packet_sequence_control = segmentation_grouping_flag | (*sequence_cnt) ;
packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
paul
Rev 1.0.0.6
r128 // increment the sequence counter
paul
Bug #861...
r84 if ( *sequence_cnt < SEQ_CNT_MAX)
{
*sequence_cnt = *sequence_cnt + 1;
}
else
{
*sequence_cnt = 0;
}
paul
sequence counters management added
r56 }
paul
sequence_cnt field set for BP and ASM packets
r133
//***********************************
// RESET THE MODE OF THE CALLING TASK
status = rtems_task_mode( initial_mode_set, RTEMS_PREEMPT_MASK, &current_mode_set );
paul
sequence counters management added
r56 }