wf_handler.c
1367 lines
| 54.8 KiB
| text/x-c
|
CLexer
/ src / wf_handler.c
|
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" | |||
|
r5 | ||
|
r87 | //***************** | |
// waveform headers | |||
|
r34 | // SWF | |
Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7]; | |||
Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7]; | |||
Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7]; | |||
// CWF | |||
|
r98 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |||
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |||
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |||
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[ NB_PACKETS_PER_GROUP_OF_CWF_LIGHT ]; | |||
|
r33 | ||
|
r87 | //************** | |
// waveform ring | |||
|
r92 | ring_node waveform_ring_f0[NB_RING_NODES_F0]; | |
|
r87 | ring_node waveform_ring_f1[NB_RING_NODES_F1]; | |
ring_node waveform_ring_f2[NB_RING_NODES_F2]; | |||
|
r131 | ring_node waveform_ring_f3[NB_RING_NODES_F3]; | |
|
r92 | ring_node *current_ring_node_f0; | |
ring_node *ring_node_to_send_swf_f0; | |||
|
r87 | ring_node *current_ring_node_f1; | |
ring_node *ring_node_to_send_swf_f1; | |||
ring_node *ring_node_to_send_cwf_f1; | |||
ring_node *current_ring_node_f2; | |||
ring_node *ring_node_to_send_swf_f2; | |||
ring_node *ring_node_to_send_cwf_f2; | |||
|
r131 | ring_node *current_ring_node_f3; | |
ring_node *ring_node_to_send_cwf_f3; | |||
|
r87 | ||
|
r105 | bool extractSWF = false; | |
|
r106 | bool swf_f0_ready = false; | |
bool swf_f1_ready = false; | |||
bool swf_f2_ready = false; | |||
|
r105 | ||
|
r106 | int wf_snap_extracted[ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET ]; | |
//********************* | |||
// Interrupt SubRoutine | |||
void reset_extractSWF( void ) | |||
{ | |||
extractSWF = false; | |||
swf_f0_ready = false; | |||
swf_f1_ready = false; | |||
swf_f2_ready = false; | |||
} | |||
|
r105 | ||
|
r21 | rtems_isr waveforms_isr( rtems_vector_number vector ) | |
{ | |||
|
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. | |||
* | |||
*/ | |||
|
r21 | ||
|
r106 | rtems_status_code status; | |
|
r166 | rtems_status_code spare_status; | |
|
r95 | ||
|
r129 | 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 | |
|
r33 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
|
r32 | { // in modes other than STANDBY and BURST, send the CWF_F3 data | |
|
r33 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full | |
|
r32 | // (1) change the receiving buffer for the waveform picker | |
|
r131 | ring_node_to_send_cwf_f3 = current_ring_node_f3; | |
current_ring_node_f3 = current_ring_node_f3->next; | |||
waveform_picker_regs->addr_data_f3 = current_ring_node_f3->buffer_address; | |||
|
r32 | // (2) send an event for the waveforms transmission | |
|
r33 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
|
r166 | spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
r32 | } | |
|
r130 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2); | |
|
r33 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] | |
|
r32 | } | |
} | |||
|
r33 | switch(lfrCurrentMode) | |
|
r21 | { | |
//******** | |||
// STANDBY | |||
case(LFR_MODE_STANDBY): | |||
|
r33 | break; | |
|
r21 | ||
//****** | |||
// NORMAL | |||
case(LFR_MODE_NORMAL): | |||
|
r94 | if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits | |
{ | |||
|
r166 | spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
r94 | } | |
if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits | |||
{ | |||
|
r92 | // change F0 ring node | |
ring_node_to_send_swf_f0 = current_ring_node_f0; | |||
current_ring_node_f0 = current_ring_node_f0->next; | |||
waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; | |||
|
r90 | // change F1 ring node | |
ring_node_to_send_swf_f1 = current_ring_node_f1; | |||
current_ring_node_f1 = current_ring_node_f1->next; | |||
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |||
// change F2 ring node | |||
ring_node_to_send_swf_f2 = current_ring_node_f2; | |||
current_ring_node_f2 = current_ring_node_f2->next; | |||
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |||
|
r94 | // | |
|
r118 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) | |
|
r95 | { | |
|
r166 | spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
r95 | } | |
|
r118 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000] | |
|
r95 | } | |
break; | |||
//****** | |||
// BURST | |||
case(LFR_MODE_BURST): | |||
if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |||
// (1) change the receiving buffer for the waveform picker | |||
ring_node_to_send_cwf_f2 = current_ring_node_f2; | |||
current_ring_node_f2 = current_ring_node_f2->next; | |||
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |||
// (2) send an event for the waveforms transmission | |||
if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { | |||
|
r166 | spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
r95 | } | |
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |||
} | |||
break; | |||
//***** | |||
// SBM1 | |||
case(LFR_MODE_SBM1): | |||
if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit | |||
// (1) change the receiving buffer for the waveform picker | |||
ring_node_to_send_cwf_f1 = current_ring_node_f1; | |||
current_ring_node_f1 = current_ring_node_f1->next; | |||
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |||
|
r112 | // (2) send an event for the the CWF1 task for transmission (and snapshot extraction if needed) | |
|
r106 | status = rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ); | |
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bits = 0 | |||
|
r95 | } | |
if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit | |||
|
r106 | swf_f0_ready = true; | |
|
r105 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1111 1110 1110 1110] f0 bits = 0 | |
|
r95 | } | |
|
r105 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit | |
|
r106 | swf_f2_ready = true; | |
|
r105 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0 | |
|
r33 | } | |
break; | |||
|
r23 | ||
//***** | |||
// SBM2 | |||
case(LFR_MODE_SBM2): | |||
|
r87 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |
|
r33 | // (1) change the receiving buffer for the waveform picker | |
|
r87 | ring_node_to_send_cwf_f2 = current_ring_node_f2; | |
current_ring_node_f2 = current_ring_node_f2->next; | |||
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |||
|
r33 | // (2) send an event for the waveforms transmission | |
|
r106 | status = rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ); | |
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |||
|
r33 | } | |
|
r90 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit | |
|
r106 | swf_f0_ready = true; | |
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1111 1110 1110 1110] f0 bits = 0 | |||
|
r90 | } | |
if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit | |||
|
r106 | swf_f1_ready = true; | |
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1, f0 bits = 0 | |||
|
r90 | } | |
|
r33 | break; | |
|
r23 | ||
|
r21 | //******** | |
// DEFAULT | |||
default: | |||
|
r33 | break; | |
|
r21 | } | |
} | |||
|
r106 | //************ | |
// RTEMS TASKS | |||
|
r18 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
{ | |||
|
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 | |||
* | |||
*/ | |||
|
r5 | rtems_event_set event_out; | |
|
r35 | rtems_id queue_id; | |
|
r82 | rtems_status_code status; | |
|
r168 | bool resynchronisationEngaged; | |
resynchronisationEngaged = false; | |||
|
r5 | ||
|
r34 | init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 ); | |
init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 ); | |||
init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 ); | |||
|
r11 | ||
|
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) | |||
} | |||
|
r35 | ||
BOOT_PRINTF("in WFRM ***\n") | |||
|
r18 | ||
while(1){ | |||
|
r21 | // wait for an RTEMS_EVENT | |
|
r34 | rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1 | |
|
r105 | | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM, | |
|
r21 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
|
r168 | if(resynchronisationEngaged == false) | |
{ // engage resynchronisation | |||
snapshot_resynchronization( (unsigned char *) ring_node_to_send_swf_f0->buffer_address); | |||
resynchronisationEngaged = true; | |||
} | |||
else | |||
{ // reset delta_snapshot to the nominal value | |||
PRINTF("no resynchronisation, reset delta_snapshot to the nominal value\n") | |||
set_wfp_delta_snapshot(); | |||
resynchronisationEngaged = false; | |||
} | |||
// | |||
|
r35 | if (event_out == RTEMS_EVENT_MODE_NORMAL) | |
{ | |||
|
r106 | DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_NORMAL\n") | |
|
r92 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
|
r87 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |||
|
r94 | } | |
|
r105 | if (event_out == RTEMS_EVENT_MODE_SBM1) | |
|
r94 | { | |
|
r106 | DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM1\n") | |
|
r94 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
|
r106 | send_waveform_SWF((volatile int*) wf_snap_extracted , SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
|
r94 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
|
r35 | } | |
|
r106 | if (event_out == RTEMS_EVENT_MODE_SBM2) | |
{ | |||
DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM2\n") | |||
send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |||
send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |||
send_waveform_SWF((volatile int*) wf_snap_extracted , SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |||
} | |||
|
r5 | } | |
} | |||
|
r17 | ||
|
r32 | rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
{ | |||
|
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 | |||
* | |||
*/ | |||
|
r32 | rtems_event_set event_out; | |
|
r35 | rtems_id queue_id; | |
|
r82 | rtems_status_code status; | |
|
r32 | ||
|
r92 | init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 ); | |
init_header_continuous_cwf3_light_table( headerCWF_F3_light ); | |||
|
r32 | ||
|
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) | |||
} | |||
|
r35 | ||
BOOT_PRINTF("in CWF3 ***\n") | |||
|
r32 | ||
while(1){ | |||
// wait for an RTEMS_EVENT | |||
|
r33 | rtems_event_receive( RTEMS_EVENT_0, | |
|
r32 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
|
r129 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
|| (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode==LFR_MODE_SBM2) ) | |||
|
r98 | { | |
|
r92 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
{ | |||
|
r129 | PRINTF("send CWF_LONG_F3\n") | |
|
r131 | send_waveform_CWF( | |
|
r157 | (volatile int*) ring_node_to_send_cwf_f3->buffer_address, | |
|
r131 | SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |
|
r92 | } | |
else | |||
{ | |||
|
r129 | PRINTF("send CWF_F3 (light)\n") | |
|
r131 | send_waveform_CWF3_light( | |
|
r157 | (volatile int*) ring_node_to_send_cwf_f3->buffer_address, | |
|
r131 | headerCWF_F3_light, queue_id ); | |
|
r129 | } | |
|
r33 | } | |
|
r92 | else | |
{ | |||
|
r129 | PRINTF1("in CWF3 *** lfrCurrentMode is %d, no data will be sent\n", lfrCurrentMode) | |
|
r33 | } | |
} | |||
} | |||
rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2 | |||
{ | |||
|
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 | |||
* | |||
*/ | |||
|
r33 | rtems_event_set event_out; | |
|
r35 | rtems_id queue_id; | |
|
r82 | rtems_status_code status; | |
|
r33 | ||
init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST ); | |||
|
r34 | init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 ); | |
|
r33 | ||
|
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) | |||
} | |||
|
r35 | ||
BOOT_PRINTF("in CWF2 ***\n") | |||
|
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); | |||
if (event_out == RTEMS_EVENT_MODE_BURST) | |||
{ | |||
|
r91 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
|
r33 | } | |
|
r87 | if (event_out == RTEMS_EVENT_MODE_SBM2) | |
|
r33 | { | |
|
r91 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
|
r112 | // launch snapshot extraction if needed | |
if (extractSWF == true) | |||
{ | |||
ring_node_to_send_swf_f2 = ring_node_to_send_cwf_f2; | |||
// extract the snapshot | |||
build_snapshot_from_ring( ring_node_to_send_swf_f2, 2 ); | |||
// 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; | |||
swf_f0_ready = false; | |||
swf_f1_ready = false; | |||
} | |||
|
r33 | } | |
} | |||
} | |||
rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1 | |||
{ | |||
|
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 | |||
* | |||
*/ | |||
|
r33 | rtems_event_set event_out; | |
|
r35 | rtems_id queue_id; | |
|
r82 | rtems_status_code status; | |
|
r33 | ||
init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 ); | |||
|
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) | |||
} | |||
|
r35 | ||
BOOT_PRINTF("in CWF1 ***\n") | |||
|
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); | |||
|
r91 | send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
|
r112 | // launch snapshot extraction if needed | |
if (extractSWF == true) | |||
{ | |||
ring_node_to_send_swf_f1 = ring_node_to_send_cwf_f1; | |||
// 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; | |||
} | |||
|
r32 | } | |
} | |||
|
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; | |||
BOOT_PRINTF("in SWBD ***\n") | |||
while(1){ | |||
// wait for an RTEMS_EVENT | |||
|
r106 | rtems_event_receive( RTEMS_EVENT_MODE_SBM1 | RTEMS_EVENT_MODE_SBM2, | |
|
r105 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
|
r106 | if (event_out == RTEMS_EVENT_MODE_SBM1) | |
{ | |||
build_snapshot_from_ring( ring_node_to_send_swf_f1, 1 ); | |||
|
r112 | swf_f1_ready = true; // the snapshot has been extracted and is ready to be sent | |
|
r106 | } | |
else | |||
{ | |||
PRINTF1("in SWBD *** unexpected rtems event received %x\n", (int) event_out) | |||
} | |||
|
r105 | } | |
} | |||
|
r17 | //****************** | |
// general functions | |||
|
r87 | ||
|
r139 | void WFP_init_rings( void ) | |
|
r87 | { | |
|