Skip to content

Commit

Permalink
Test valid attenuation range
Browse files Browse the repository at this point in the history
  • Loading branch information
chipfunk committed Feb 15, 2024
1 parent b8b5971 commit 49c978c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion muses_72323.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extern "C"
/** \typedef The clock-divider */
typedef uint8_t muses_72323_soft_step_clock_divider_t;

/** \typedef volume-attenuation in 0.25dB steps [0..480] */
/** \typedef volume-attenuation in 0.25dB steps [0..447] */
typedef uint16_t muses_72323_attenuation_t;

/**
Expand Down
7 changes: 7 additions & 0 deletions muses_72323_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ test_set_volume ()
assert(error == MUSES_72323_ERROR_NONE);
assert(command == 0b1110111110000000);

for (muses_72323_attenuation_t att = 0; att < 448; att++)
{
error = muses_72323_set_volume (&command, chip_address, channel, att,
use_soft_step);
assert(error == MUSES_72323_ERROR_NONE);
}

use_soft_step = true;
error = muses_72323_set_volume (&command, chip_address, channel, attenuation,
use_soft_step);
Expand Down

0 comments on commit 49c978c

Please sign in to comment.