development #4
@@ -10,8 +10,8 @@ void staffVolumeUp(int *maxVolume);
|
|||||||
/**
|
/**
|
||||||
* @brief Used to decrease the maximum staff volume. If the max volume is set lower than what the current user volume is, then the user volume will also be lowered.
|
* @brief Used to decrease the maximum staff volume. If the max volume is set lower than what the current user volume is, then the user volume will also be lowered.
|
||||||
*
|
*
|
||||||
* @param maxVolume Variable used to keep track of the max volume
|
* @param maxVolume Pointer to the variable used to keep track of the max volume
|
||||||
* @param userVolume Pointer to the variable used to keep track of the user volume
|
* @param userVolume Pointer to the variable used to keep track of the user volume
|
||||||
* @param oldUserVolume Pointer to the variable used to keep track of the user volume when in mute or lowered
|
* @param oldUserVolume Pointer to the variable used to keep track of the user volume when in mute or lowered
|
||||||
*/
|
*/
|
||||||
void staffVolumeDown(int maxVolume, int *userVolume, int *oldUserVolume);
|
void staffVolumeDown(int *maxVolume, int *userVolume, int *oldUserVolume);
|
||||||
@@ -51,7 +51,7 @@ void loop()
|
|||||||
// SW2 - Staff Volume Down
|
// SW2 - Staff Volume Down
|
||||||
if (reader.debounceReadNC(BTN_STAFF_DWN))
|
if (reader.debounceReadNC(BTN_STAFF_DWN))
|
||||||
{
|
{
|
||||||
staffVolumeDown(maxVolume, &userVolume, &oldUserVolume);
|
staffVolumeDown(&maxVolume, &userVolume, &oldUserVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remote D - Mute
|
// Remote D - Mute
|
||||||
|
|||||||
@@ -29,30 +29,30 @@ void staffVolumeUp(int *maxVolume)
|
|||||||
/**
|
/**
|
||||||
* @brief Used to decrease the maximum staff volume. If the max volume is set lower than what the current user volume is, then the user volume will also be lowered.
|
* @brief Used to decrease the maximum staff volume. If the max volume is set lower than what the current user volume is, then the user volume will also be lowered.
|
||||||
*
|
*
|
||||||
* @param maxVolume Variable used to keep track of the max volume
|
* @param maxVolume Pointer to the variable used to keep track of the max volume
|
||||||
* @param userVolume Pointer to the variable used to keep track of the user volume
|
* @param userVolume Pointer to the variable used to keep track of the user volume
|
||||||
* @param oldUserVolume Pointer to the variable used to keep track of the user volume when in mute or lowered
|
* @param oldUserVolume Pointer to the variable used to keep track of the user volume when in mute or lowered
|
||||||
*/
|
*/
|
||||||
void staffVolumeDown(int maxVolume, int *userVolume, int *oldUserVolume)
|
void staffVolumeDown(int *maxVolume, int *userVolume, int *oldUserVolume)
|
||||||
{
|
{
|
||||||
if (maxVolume > STAFF_STEPS)
|
if (*maxVolume > STAFF_STEPS)
|
||||||
{
|
{
|
||||||
maxVolume -= STAFF_STEPS;
|
*maxVolume -= STAFF_STEPS;
|
||||||
|
|
||||||
if (*userVolume > maxVolume)
|
if (*userVolume > *maxVolume)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (*userVolume - maxVolume); i++)
|
for (int i = 0; i < (*userVolume - *maxVolume); i++)
|
||||||
{
|
{
|
||||||
potDecrement();
|
potDecrement();
|
||||||
}
|
}
|
||||||
|
|
||||||
*userVolume = maxVolume;
|
*userVolume = *maxVolume;
|
||||||
*oldUserVolume = *userVolume;
|
*oldUserVolume = *userVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*oldUserVolume > maxVolume)
|
if (*oldUserVolume > *maxVolume)
|
||||||
{
|
{
|
||||||
*oldUserVolume = maxVolume;
|
*oldUserVolume = *maxVolume;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user