tone.c
来自「嵌入式系统基础课件」· C语言 代码 · 共 15 行
C
15 行
#include "libepc.h"
#include "tetris.h"
/* ------------------------------------------------------------ */
/* Play a tone on the speaker for 1/4th of a second. */
/* ------------------------------------------------------------ */
void Tone(int hertz)
{
DWORD32 timer = Now_Plus(0) + 250 ; /* 0.25 secs */
Sound(hertz) ;
while (Now_Plus(0) < timer) ;
Sound(0) ;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?