ReactOS  0.4.15-dev-439-g292f67a
pcbeep.c File Reference
#include <freeldr.h>
Include dependency graph for pcbeep.c:

Go to the source code of this file.

Macros

#define CLOCK_TICK_RATE   1193182
 

Functions

static VOID Sound (USHORT Frequency)
 
VOID PcBeep (VOID)
 

Macro Definition Documentation

◆ CLOCK_TICK_RATE

#define CLOCK_TICK_RATE   1193182

Definition at line 13 of file pcbeep.c.

Function Documentation

◆ PcBeep()

VOID PcBeep ( VOID  )

Definition at line 34 of file pcbeep.c.

35 {
36  Sound(700);
38  Sound(0);
39 }
VOID StallExecutionProcessor(ULONG Microseconds)
Definition: pchw.c:60
static VOID Sound(USHORT Frequency)
Definition: pcbeep.c:17

Referenced by MachInit().

◆ Sound()

static VOID Sound ( USHORT  Frequency)
static

Definition at line 17 of file pcbeep.c.

18 {
19  USHORT Scale;
20 
21  if (Frequency == 0)
22  {
23  WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) & ~3);
24  return;
25  }
26 
27  Scale = CLOCK_TICK_RATE / Frequency;
28  WRITE_PORT_UCHAR((PUCHAR)0x43, 0xB6);
29  WRITE_PORT_UCHAR((PUCHAR)0x42, Scale & 0xFF);
30  WRITE_PORT_UCHAR((PUCHAR)0x42, Scale >> 8);
31  WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) | 3);
32 }
unsigned char * PUCHAR
Definition: retypes.h:3
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528
#define CLOCK_TICK_RATE
Definition: pcbeep.c:13
unsigned short USHORT
Definition: pedump.c:61
static LARGE_INTEGER Frequency
Definition: clock.c:41
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

Referenced by PcBeep().