mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-30 08:23:01 +00:00
PC speaker: correct frequency in real mode
damn it
This commit is contained in:
parent
2f9d1e8c0f
commit
72c1116a89
1 changed files with 5 additions and 1 deletions
|
@ -122,7 +122,11 @@ void DivPlatformPCSpeaker::beepFreq(int freq) {
|
|||
gettimeofday(&ie.time,NULL);
|
||||
ie.type=EV_SND;
|
||||
ie.code=SND_TONE;
|
||||
ie.value=freq;
|
||||
if (freq>0) {
|
||||
ie.value=chipClock/freq;
|
||||
} else {
|
||||
ie.value=0;
|
||||
}
|
||||
if (write(beepFD,&ie,sizeof(struct input_event))<0) {
|
||||
perror("error while writing frequency!");
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue