|
@@
-22,9
+22,12
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3
|
|
22
|
|
|
22
|
|
|
23
|
unsigned char doubleSendCWF1 = 0;
|
|
23
|
unsigned char doubleSendCWF1 = 0;
|
|
24
|
unsigned char doubleSendCWF2 = 0;
|
|
24
|
unsigned char doubleSendCWF2 = 0;
|
|
|
|
|
25
|
unsigned char fullRecord;
|
|
25
|
|
|
26
|
|
|
26
|
rtems_isr waveforms_isr( rtems_vector_number vector )
|
|
27
|
rtems_isr waveforms_isr( rtems_vector_number vector )
|
|
27
|
{
|
|
28
|
{
|
|
|
|
|
29
|
unsigned int statusReg;
|
|
|
|
|
30
|
|
|
28
|
/** This is the interrupt sub routine called by the waveform picker core.
|
|
31
|
/** This is the interrupt sub routine called by the waveform picker core.
|
|
29
|
*
|
|
32
|
*
|
|
30
|
* This ISR launch different actions depending mainly on two pieces of information:
|
|
33
|
* This ISR launch different actions depending mainly on two pieces of information:
|
|
@@
-33,7
+36,6
rtems_isr waveforms_isr( rtems_vector_nu
|
|
33
|
*
|
|
36
|
*
|
|
34
|
*/
|
|
37
|
*/
|
|
35
|
|
|
38
|
|
|
36
|
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
|
|
|
|
|
37
|
new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff00f; // clear new_err and full_err
|
|
39
|
new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff00f; // clear new_err and full_err
|
|
38
|
|
|
40
|
|
|
39
|
#ifdef GSA
|
|
41
|
#ifdef GSA
|
|
@@
-71,17
+73,22
rtems_isr waveforms_isr( rtems_vector_nu
|
|
71
|
#ifdef GSA
|
|
73
|
#ifdef GSA
|
|
72
|
PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
|
|
74
|
PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
|
|
73
|
#else
|
|
75
|
#else
|
|
74
|
if ( (new_waveform_picker_regs->run_burst_enable & 0x7) == 0x0 ){ // if no channel is enable
|
|
76
|
statusReg = new_waveform_picker_regs->status;
|
|
75
|
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
|
|
77
|
fullRecord = fullRecord | ( statusReg & 0x7 );
|
|
|
|
|
78
|
// if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full
|
|
|
|
|
79
|
// if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
|
|
|
|
|
80
|
// rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
|
|
|
|
|
81
|
// }
|
|
|
|
|
82
|
// new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
|
|
|
|
|
83
|
// }
|
|
|
|
|
84
|
if ( fullRecord == 0x7 ){ // f2 f1 and f0 are full
|
|
|
|
|
85
|
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
|
|
|
|
|
86
|
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
|
|
|
|
|
87
|
}
|
|
|
|
|
88
|
fullRecord = 0x00;
|
|
76
|
}
|
|
89
|
}
|
|
77
|
else {
|
|
90
|
new_waveform_picker_regs->status = ( new_waveform_picker_regs->status & (~statusReg) )
|
|
78
|
if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full
|
|
91
|
| ( new_waveform_picker_regs->status & 0xfffffff8 );
|
|
79
|
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
|
|
|
|
|
80
|
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
|
|
|
|
|
81
|
}
|
|
|
|
|
82
|
new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
|
|
|
|
|
83
|
}
|
|
|
|
|
84
|
}
|
|
|
|
|
85
|
#endif
|
|
92
|
#endif
|
|
86
|
break;
|
|
93
|
break;
|
|
87
|
|
|
94
|
|
|
@@
-462,23
+469,41
void init_waveforms( void )
|
|
462
|
|
|
469
|
|
|
463
|
for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
|
|
470
|
for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
|
|
464
|
{
|
|
471
|
{
|
|
|
|
|
472
|
// //***
|
|
|
|
|
473
|
// // F0
|
|
|
|
|
474
|
// wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
|
|
|
|
|
475
|
// wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
|
|
|
|
|
476
|
// wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
|
|
|
|
|
477
|
|
|
|
|
|
478
|
// //***
|
|
|
|
|
479
|
// // F1
|
|
|
|
|
480
|
// wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
|
|
|
|
|
481
|
// wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
|
|
|
|
|
482
|
// wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
|
|
|
|
|
483
|
|
|
|
|
|
484
|
// //***
|
|
|
|
|
485
|
// // F2
|
|
|
|
|
486
|
// wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
|
|
|
|
|
487
|
// wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
|
|
|
|
|
488
|
// wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
|
|
|
|
|
489
|
|
|
465
|
//***
|
|
490
|
//***
|
|
466
|
// F0
|
|
491
|
// F0
|
|
467
|
wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
|
|
492
|
wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0; //
|
|
468
|
wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
|
|
493
|
wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0; //
|
|
469
|
wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
|
|
494
|
wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0; //
|
|
470
|
|
|
495
|
|
|
471
|
//***
|
|
496
|
//***
|
|
472
|
// F1
|
|
497
|
// F1
|
|
473
|
wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
|
|
498
|
wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0;
|
|
474
|
wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
|
|
499
|
wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0;
|
|
475
|
wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
|
|
500
|
wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0;
|
|
476
|
|
|
501
|
|
|
477
|
//***
|
|
502
|
//***
|
|
478
|
// F2
|
|
503
|
// F2
|
|
479
|
wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
|
|
504
|
wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0;
|
|
480
|
wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
|
|
505
|
wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0;
|
|
481
|
wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
|
|
506
|
wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0;
|
|
482
|
|
|
507
|
|
|
483
|
//***
|
|
508
|
//***
|
|
484
|
// F3
|
|
509
|
// F3
|
|
@@
-723,7
+748,7
int send_waveform_SWF( volatile int *wav
|
|
723
|
|
|
748
|
|
|
724
|
for (i=0; i<7; i++) // send waveform
|
|
749
|
for (i=0; i<7; i++) // send waveform
|
|
725
|
{
|
|
750
|
{
|
|
726
|
spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
|
|
751
|
spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
|
|
727
|
spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
|
|
752
|
spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
|
|
728
|
// BUILD THE DATA
|
|
753
|
// BUILD THE DATA
|
|
729
|
if (i==6) {
|
|
754
|
if (i==6) {
|
|
@@
-1089,10
+1114,10
void reset_new_waveform_picker_regs()
|
|
1089
|
// new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
|
|
1114
|
// new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
|
|
1090
|
new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
|
|
1115
|
new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
|
|
1091
|
new_waveform_picker_regs->delta_f0 = 0x3f5; // 0x20 *** 1013
|
|
1116
|
new_waveform_picker_regs->delta_f0 = 0x3f5; // 0x20 *** 1013
|
|
1092
|
new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7
|
|
1117
|
new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits]
|
|
1093
|
new_waveform_picker_regs->delta_f1 = 0x3c0; // 0x28 *** 960
|
|
1118
|
new_waveform_picker_regs->delta_f1 = 0x3c0; // 0x28 *** 960
|
|
1094
|
// new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240
|
|
1119
|
// new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240
|
|
1095
|
new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 2048
|
|
1120
|
new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 3072
|
|
1096
|
new_waveform_picker_regs->nb_data_by_buffer = 0x7ff; // 0x30 *** 2048 -1
|
|
1121
|
new_waveform_picker_regs->nb_data_by_buffer = 0x7ff; // 0x30 *** 2048 -1
|
|
1097
|
new_waveform_picker_regs->snapshot_param = 0x800; // 0x34 *** 2048
|
|
1122
|
new_waveform_picker_regs->snapshot_param = 0x800; // 0x34 *** 2048
|
|
1098
|
new_waveform_picker_regs->start_date = 0x00; // 0x38
|
|
1123
|
new_waveform_picker_regs->start_date = 0x00; // 0x38
|