kopia lustrzana https://github.com/OpenRTX/OpenRTX
MD-UV3x0: using HR_C6000 DAC for "beep" tones
rodzic
a815588b8c
commit
3469feb065
|
@ -82,6 +82,7 @@ openrtx_inc = ['openrtx/include',
|
|||
'platform/drivers/USB',
|
||||
'platform/drivers/GPIO',
|
||||
'platform/drivers/tones',
|
||||
'platform/drivers/audio',
|
||||
'platform/drivers/baseband',
|
||||
'platform/drivers/backlight',
|
||||
'platform/drivers/chSelector']
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <peripherals/rtc.h>
|
||||
#include <interfaces/audio.h>
|
||||
#include <chSelector.h>
|
||||
#include <Cx000_dac.h>
|
||||
|
||||
#ifdef CONFIG_SCREEN_BRIGHTNESS
|
||||
#include <backlight.h>
|
||||
|
@ -190,20 +191,12 @@ void platform_ledOff(led_t led)
|
|||
|
||||
void platform_beepStart(uint16_t freq)
|
||||
{
|
||||
// calculate appropriate volume.
|
||||
uint8_t vol = platform_getVolumeLevel();
|
||||
// Since beeps have been requested, we do not want to have 0 volume.
|
||||
// We also do not want the volume to be excessive.
|
||||
if (vol < 10)
|
||||
vol = 5;
|
||||
if (vol > 176)
|
||||
vol = 176;
|
||||
toneGen_beepOn((float)freq, vol, 0);
|
||||
Cx000dac_startBeep(freq);
|
||||
}
|
||||
|
||||
void platform_beepStop()
|
||||
{
|
||||
toneGen_beepOff();
|
||||
Cx000dac_stopBeep();
|
||||
}
|
||||
|
||||
datetime_t platform_getCurrentTime()
|
||||
|
|
Ładowanie…
Reference in New Issue