2020-11-25 12:05:59 -05:00
|
|
|
#include "IGpSystemServices.h"
|
|
|
|
|
|
2020-07-03 02:46:43 -04:00
|
|
|
#include "PLApplication.h"
|
2020-01-04 01:19:01 -05:00
|
|
|
#include "PLCore.h"
|
2020-11-25 12:05:59 -05:00
|
|
|
#include "PLDrivers.h"
|
2020-07-03 02:46:43 -04:00
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
|
|
namespace PortabilityLayer
|
2020-01-04 01:19:01 -05:00
|
|
|
{
|
2020-07-03 02:46:43 -04:00
|
|
|
namespace Utils
|
|
|
|
|
{
|
|
|
|
|
void MakePStr(unsigned char *dest, size_t sz, const char *src)
|
|
|
|
|
{
|
|
|
|
|
assert(sz <= 255);
|
|
|
|
|
dest[0] = static_cast<uint8_t>(sz);
|
|
|
|
|
memcpy(dest + 1, src, sz);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-09 23:45:27 -04:00
|
|
|
|
|
|
|
|
static BeepFunction_t gs_beepFunction = nullptr;
|
2020-07-03 02:46:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SysBeep(int duration)
|
|
|
|
|
{
|
2021-05-09 23:45:27 -04:00
|
|
|
if (!PLDrivers::GetSystemServices()->Beep())
|
|
|
|
|
if (PortabilityLayer::gs_beepFunction != nullptr)
|
|
|
|
|
PortabilityLayer::gs_beepFunction(duration);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetBeepFunction(BeepFunction_t beepFunction)
|
|
|
|
|
{
|
|
|
|
|
PortabilityLayer::gs_beepFunction = beepFunction;
|
2020-07-03 02:46:43 -04:00
|
|
|
}
|