def checkparams(pwm_freq, pwm_duty, num_samples):
    check_ok = True
    if ((pwm_freq < 20) or (pwm_freq > 100)):
        print('Allowed PWM freq is between in [20, 100] kHz interval.')
        check_ok = False
    if ((pwm_duty < 5) or (pwm_duty > 80)):
        print('Allowed PWM duty is between in [5, 80] percent interval.')
        check_ok = False
    if ((num_samples < 1) or (num_samples > 20000)):
        print('Allowed samples num is between in [1, 8192] interval.')
        check_ok = False
    if (check_ok == False):
        sys.exit(1)
def checkparams(pwm_freq, pwm_duty, num_samples):
    check_ok = True
    if ((pwm_freq < 20) or (pwm_freq > 100)):
        print('Allowed PWM freq is between in [20, 100] kHz interval.')
        check_ok = False
    if ((pwm_duty < 5) or (pwm_duty > 80)):
        print('Allowed PWM duty is between in [5, 80] percent interval.')
        check_ok = False
    if ((num_samples < 1) or (num_samples > 20000)):
        print('Allowed samples num is between in [1, 8192] interval.')
        check_ok = False
    if (check_ok == False):
        sys.exit(1)