41 lines
783 B
C++
41 lines
783 B
C++
#include "intensity.h"
|
|
#include "config.h"
|
|
#include "state.h"
|
|
#include "display.h"
|
|
#include "buzzer.h"
|
|
|
|
|
|
const char* IntensityMenuItem::getTitle()
|
|
{
|
|
return UniqueString("Intensity");
|
|
}
|
|
|
|
|
|
const char* IntensityMenuItem::getValue()
|
|
{
|
|
return FormatPercentageFixedWidth(GetExposureIntensity());
|
|
}
|
|
|
|
|
|
void IntensityMenuItem::incValue()
|
|
{
|
|
uint16_t exposureIntensity = GetExposureIntensity();
|
|
|
|
if (exposureIntensity < 100)
|
|
{
|
|
SetExposureIntensity(exposureIntensity + IntensityStep);
|
|
Buzzer::select();
|
|
}
|
|
}
|
|
|
|
|
|
void IntensityMenuItem::decValue()
|
|
{
|
|
uint16_t exposureIntensity = GetExposureIntensity();
|
|
|
|
if (exposureIntensity > IntensityStep)
|
|
{
|
|
SetExposureIntensity(exposureIntensity - IntensityStep);
|
|
Buzzer::select();
|
|
}
|
|
} |