diff options
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c index de954fd..81bf1d9 100644 --- a/device-functions.c +++ b/device-functions.c @@ -2680,6 +2680,34 @@ static int inverse_interpolation (int x1, int x2, float y1, float y2, float y_ne } +float min_possible_hw_rise_time (int channel, float use_ampl) +{ + // special function to let rise time go to the lowest hardware-possible value, not just the specified minimum - for AVRQ + float min_so_far, try_this; + + int i, j, actual_pol; + + if (use_ampl<0.0) { + actual_pol=1; + } else { + actual_pol=0; + } + + min_so_far = globals.Flash.max_rise_time[channel]; + + for (i=0;i<ampl_ranges;i++) { + for (j=0;j<std_range_size;j++) { + try_this = globals.Flash.rise_time_pwl[channel][i][actual_pol][j]; + if ((try_this > 0.0) && (try_this < min_so_far)) { + min_so_far = try_this; + } + } + } + + return min_so_far; +} + + int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int *relay_range,int *atten_range, int *UseNegData,int *entry,int *word_out,int *actual_pol,int *word_out_aux) { |