##// END OF EJS Templates
3.2.0.7...
paul -
r357:0781840df513 R3++ draft
parent child
Show More
@@ -64,7 +64,7 option(FSW_debug_tch "?" OFF)
64 64 set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE)
65 65 set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE)
66 66 set(SW_VERSION_N3 "0" CACHE STRING "Choose N3 FSW Version." FORCE)
67 set(SW_VERSION_N4 "6" CACHE STRING "Choose N4 FSW Version." FORCE)
67 set(SW_VERSION_N4 "7" CACHE STRING "Choose N4 FSW Version." FORCE)
68 68
69 69 if(FSW_verbose)
70 70 add_definitions(-DPRINT_MESSAGES_ON_CONSOLE)
@@ -372,6 +372,12 rtems_task avgv_task(rtems_task_argument
372 372 static int32_t v[MOVING_AVERAGE] = {0};
373 373 static int32_t e1[MOVING_AVERAGE] = {0};
374 374 static int32_t e2[MOVING_AVERAGE] = {0};
375 static int old_v = 0;
376 static int old_e1 = 0;
377 static int old_e2 = 0;
378 int current_v;
379 int current_e1;
380 int current_e2;
375 381 int32_t average_v;
376 382 int32_t average_e1;
377 383 int32_t average_e2;
@@ -400,6 +406,9 rtems_task avgv_task(rtems_task_argument
400 406
401 407 // initialize values
402 408 indexOfOldValue = MOVING_AVERAGE - 1;
409 current_v = 0;
410 current_e1 = 0;
411 current_e2 = 0;
403 412 average_v = 0;
404 413 average_e1 = 0;
405 414 average_e2 = 0;
@@ -418,10 +427,17 rtems_task avgv_task(rtems_task_argument
418 427 }
419 428 else
420 429 {
430 current_v = waveform_picker_regs->v;
431 current_e1 = waveform_picker_regs->e1;
432 current_e2 = waveform_picker_regs->e2;
433 if ( (current_v != old_v)
434 && (current_e1 != old_e1)
435 && (current_e2 != old_e2))
436 {
421 437 // get new values
422 newValue_v = getIntFromShort( waveform_picker_regs->v );
423 newValue_e1 = getIntFromShort( waveform_picker_regs->e1 );
424 newValue_e2 = getIntFromShort( waveform_picker_regs->e2 );
438 newValue_v = getIntFromShort( current_v );
439 newValue_e1 = getIntFromShort( current_e1 );
440 newValue_e2 = getIntFromShort( current_e2 );
425 441
426 442 // compute the moving average
427 443 average_v = average_v + newValue_v - v[k];
@@ -432,7 +448,7 rtems_task avgv_task(rtems_task_argument
432 448 v[k] = newValue_v;
433 449 e1[k] = newValue_e1;
434 450 e2[k] = newValue_e2;
435 }
451
436 452 if (k == (MOVING_AVERAGE-1))
437 453 {
438 454 k = 0;
@@ -446,6 +462,11 rtems_task avgv_task(rtems_task_argument
446 462 hk_lfr_sc_e1_f3_as_int16 = (int16_t) (average_e1 / MOVING_AVERAGE );
447 463 hk_lfr_sc_e2_f3_as_int16 = (int16_t) (average_e2 / MOVING_AVERAGE );
448 464 }
465 old_v = current_v;
466 old_e1 = current_e1;
467 old_e2 = current_e2;
468 }
469 }
449 470
450 471 PRINTF("in AVGV *** deleting task\n");
451 472
General Comments 0
You need to be logged in to leave comments. Login now