Target:
Source:
Actions:
Compare was calculated based on this common ancestor commit:
18e20227b986
Time | Author | Commit | Description | |
---|---|---|---|---|
r371:88d90c878c97
|
|
|||
r372:fc82b08705ba
|
|
|||
r373:a5fd85da05a7
|
|
|||
r374:79e8ac429728
|
|
@@ -1,4 +1,4 | |||
|
1 |
header/lfr_common_headers = https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/ |
|
|
1 | header/lfr_common_headers = https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/USERS/JEANDET/lfr_common_headers | |
|
2 | 2 | |
|
3 | 3 | LFR_basic-parameters = https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/USERS/CHUST/LFR_basic-parameters |
|
4 | 4 |
@@ -1,2 +1,2 | |||
|
1 | 1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters |
|
2 | e904b329ff977514bf36af92617afefd22fd06ab header/lfr_common_headers | |
|
2 | 1b9238c8848953d545d6ff9c9b8b15d19a597fb6 header/lfr_common_headers |
@@ -136,6 +136,7 rtems_task load_task( rtems_task_argumen | |||
|
136 | 136 | rtems_task hous_task( rtems_task_argument argument ); |
|
137 | 137 | rtems_task avgv_task( rtems_task_argument argument ); |
|
138 | 138 | rtems_task dumb_task( rtems_task_argument unused ); |
|
139 | rtems_task scrubbing_task( rtems_task_argument unused ); | |
|
139 | 140 | |
|
140 | 141 | void init_housekeeping_parameters( void ); |
|
141 | 142 | void increment_seq_counter(unsigned short *packetSequenceControl); |
@@ -37,6 +37,8 | |||
|
37 | 37 | #define CAL_NB_PTS 256 |
|
38 | 38 | #define CAL_DATA_MASK 0xfff |
|
39 | 39 | #define CAL_F_DIVISOR 38 // 25 MHz => 160 256 (39 - 1) |
|
40 | #define CAL_F_DIVISOR_MIN 38 | |
|
41 | #define CAL_F_DIVISOR_MAX (38*2*2*2*2) | |
|
40 | 42 | // INTERLEAVED MODE |
|
41 | 43 | #define CAL_FS_INTER 240384.615 |
|
42 | 44 | #define CAL_NB_PTS_INTER 384 |
@@ -13,7 +13,7 else() | |||
|
13 | 13 | set(CMAKE_C_FLAGS_RELEASE "-O3") |
|
14 | 14 | endif() |
|
15 | 15 | |
|
16 | set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") | |
|
16 | set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <FLAGS> -Xlinker -Map=<TARGET>.map <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") | |
|
17 | 17 | |
|
18 | 18 | include_directories("${rtems_dir}/sparc-rtems/leon3/lib/include") |
|
19 | 19 |
@@ -15,6 +15,7 | |||
|
15 | 15 | |
|
16 | 16 | #include <rtems.h> |
|
17 | 17 | |
|
18 | ||
|
18 | 19 | /* configuration information */ |
|
19 | 20 | |
|
20 | 21 | #define CONFIGURE_INIT |
@@ -26,7 +27,7 | |||
|
26 | 27 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
27 | 28 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
|
28 | 29 | |
|
29 |
#define CONFIGURE_MAXIMUM_TASKS 2 |
|
|
30 | #define CONFIGURE_MAXIMUM_TASKS 23 // number of tasks concurrently active including INIT | |
|
30 | 31 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
|
31 | 32 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) |
|
32 | 33 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 |
@@ -376,6 +377,8 void create_names( void ) // create all | |||
|
376 | 377 | Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' ); |
|
377 | 378 | Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' ); |
|
378 | 379 | Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' ); |
|
380 | Task_name[TASKID_SCRB] = rtems_build_name( 'S', 'C', 'R', 'B' ); | |
|
381 | Task_name[TASKID_CALI] = rtems_build_name( 'C', 'A', 'L', 'I' ); | |
|
379 | 382 | |
|
380 | 383 | // rate monotonic period names |
|
381 | 384 | name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' ); |
@@ -561,6 +564,14 int create_all_tasks( void ) // create a | |||
|
561 | 564 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] |
|
562 | 565 | ); |
|
563 | 566 | } |
|
567 | if (status == RTEMS_SUCCESSFUL) // SCRUBBING TASK | |
|
568 | { | |
|
569 | status = rtems_task_create( | |
|
570 | Task_name[TASKID_SCRB], TASK_PRIORITY_SCRB, RTEMS_MINIMUM_STACK_SIZE, | |
|
571 | RTEMS_DEFAULT_MODES, | |
|
572 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SCRB] | |
|
573 | ); | |
|
574 | } | |
|
564 | 575 | if (status == RTEMS_SUCCESSFUL) // HOUS |
|
565 | 576 | { |
|
566 | 577 | status = rtems_task_create( |
@@ -577,6 +588,14 int create_all_tasks( void ) // create a | |||
|
577 | 588 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVGV] |
|
578 | 589 | ); |
|
579 | 590 | } |
|
591 | if (status == RTEMS_SUCCESSFUL) // CALI | |
|
592 | { | |
|
593 | status = rtems_task_create( | |
|
594 | Task_name[TASKID_CALI], TASK_PRIORITY_CALI, RTEMS_MINIMUM_STACK_SIZE, | |
|
595 | RTEMS_DEFAULT_MODES, | |
|
596 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CALI] | |
|
597 | ); | |
|
598 | } | |
|
580 | 599 | |
|
581 | 600 | return status; |
|
582 | 601 | } |
@@ -746,6 +765,13 int start_all_tasks( void ) // start all | |||
|
746 | 765 | BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") |
|
747 | 766 | } |
|
748 | 767 | } |
|
768 | if (status == RTEMS_SUCCESSFUL) // SCRUBBING | |
|
769 | { | |
|
770 | status = rtems_task_start( Task_id[TASKID_SCRB], scrubbing_task, 1 ); | |
|
771 | if (status!=RTEMS_SUCCESSFUL) { | |
|
772 | BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") | |
|
773 | } | |
|
774 | } | |
|
749 | 775 | if (status == RTEMS_SUCCESSFUL) // LOAD |
|
750 | 776 | { |
|
751 | 777 | status = rtems_task_start( Task_id[TASKID_LOAD], load_task, 1 ); |
@@ -753,6 +779,13 int start_all_tasks( void ) // start all | |||
|
753 | 779 | BOOT_PRINTF("in INIT *** Error starting TASK_LOAD\n") |
|
754 | 780 | } |
|
755 | 781 | } |
|
782 | if (status == RTEMS_SUCCESSFUL) // CALI | |
|
783 | { | |
|
784 | status = rtems_task_start( Task_id[TASKID_CALI], load_task, 1 ); | |
|
785 | if (status!=RTEMS_SUCCESSFUL) { | |
|
786 | BOOT_PRINTF("in INIT *** Error starting TASK_LOAD\n") | |
|
787 | } | |
|
788 | } | |
|
756 | 789 | |
|
757 | 790 | return status; |
|
758 | 791 | } |
@@ -521,6 +521,65 rtems_task dumb_task( rtems_task_argumen | |||
|
521 | 521 | } |
|
522 | 522 | } |
|
523 | 523 | |
|
524 | rtems_task scrubbing_task( rtems_task_argument unused ) | |
|
525 | { | |
|
526 | /** This RTEMS taks is used to avoid entering IDLE task and also scrub memory to increase scubbing frequency. | |
|
527 | * | |
|
528 | * @param unused is the starting argument of the RTEMS task | |
|
529 | * | |
|
530 | * The scrubbing reads continuously memory when no other tasks are ready. | |
|
531 | * | |
|
532 | */ | |
|
533 | ||
|
534 | BOOT_PRINTF("in SCRUBBING *** \n"); | |
|
535 | volatile int i=0; | |
|
536 | volatile float valuef = 1.; | |
|
537 | volatile uint32_t* RAM=(uint32_t*)0x40000000; | |
|
538 | volatile uint32_t value; | |
|
539 | while(1){ | |
|
540 | i=(i+1)%(1024*1024); | |
|
541 | valuef += 10.f*(float)RAM[i]; | |
|
542 | } | |
|
543 | } | |
|
544 | ||
|
545 | rtems_task calibration_sweep_task( rtems_task_argument unused ) | |
|
546 | { | |
|
547 | /** This RTEMS taks is used to change calibration signal smapling frequency between snapshots. | |
|
548 | * | |
|
549 | * @param unused is the starting argument of the RTEMS task | |
|
550 | * | |
|
551 | * If calibration is enabled, this task will divide by two the calibration signal smapling frequency between snapshots. | |
|
552 | * When minimum sampling frequency is reach it will jump to maximum sampling frequency to loop indefinitely. | |
|
553 | * | |
|
554 | */ | |
|
555 | rtems_event_set event_out; | |
|
556 | BOOT_PRINTF("in calibration sweep *** \n"); | |
|
557 | rtems_interval ticks_per_seconds = rtems_clock_get_ticks_per_second(); | |
|
558 | while(1){ | |
|
559 | // Waiting for next F0 snapshot | |
|
560 | rtems_event_receive(RTEMS_EVENT_CAL_SWEEP_WAKE, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); | |
|
561 | if(time_management_regs->calDACCtrl & BIT_CAL_ENABLE) | |
|
562 | { | |
|
563 | unsigned int delta_snapshot; | |
|
564 | delta_snapshot = (parameter_dump_packet.sy_lfr_n_swf_p[0] * CONST_256) | |
|
565 | + parameter_dump_packet.sy_lfr_n_swf_p[1]; | |
|
566 | // We are woken almost in the center of a snapshot -> let's wait for sy_lfr_n_swf_p / 2 | |
|
567 | rtems_task_wake_after( ticks_per_seconds * delta_snapshot / 2); | |
|
568 | if(time_management_regs->calDivisor >= CAL_F_DIVISOR_MAX){ | |
|
569 | time_management_regs->calDivisor = CAL_F_DIVISOR_MIN; | |
|
570 | } | |
|
571 | else{ | |
|
572 | time_management_regs->calDivisor *= 2; | |
|
573 | } | |
|
574 | } | |
|
575 | ||
|
576 | ||
|
577 | ||
|
578 | } | |
|
579 | ||
|
580 | } | |
|
581 | ||
|
582 | ||
|
524 | 583 | //***************************** |
|
525 | 584 | // init housekeeping parameters |
|
526 | 585 |
@@ -204,6 +204,7 inline void waveform_isr_normal_sbm1_sbm | |||
|
204 | 204 | } |
|
205 | 205 | // send an event to the WFRM task for resynchro activities |
|
206 | 206 | status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_SWF_RESYNCH ); |
|
207 | status = rtems_event_send( Task_id[TASKID_CALI], RTEMS_EVENT_CAL_SWEEP_WAKE ); | |
|
207 | 208 | } |
|
208 | 209 | |
|
209 | 210 | //*** |