mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-07-16 19:41:22 +08:00
Add 28 day code
This commit is contained in:
1
28_day/beepdown/!cons_9x.bat
Normal file
1
28_day/beepdown/!cons_9x.bat
Normal file
@@ -0,0 +1 @@
|
||||
command
|
||||
1
28_day/beepdown/!cons_nt.bat
Normal file
1
28_day/beepdown/!cons_nt.bat
Normal file
@@ -0,0 +1 @@
|
||||
cmd.exe
|
||||
5
28_day/beepdown/Makefile
Normal file
5
28_day/beepdown/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
APP = beepdown
|
||||
STACK = 1k
|
||||
MALLOC = 40k
|
||||
|
||||
include ../app_make.txt
|
||||
19
28_day/beepdown/beepdown.c
Normal file
19
28_day/beepdown/beepdown.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "apilib.h"
|
||||
|
||||
void HariMain(void)
|
||||
{
|
||||
int i, timer;
|
||||
timer = api_alloctimer();
|
||||
api_inittimer(timer, 128);
|
||||
for (i = 20000000; i >= 20000; i -= i / 100) {
|
||||
/* 20KHz~20Hz,即人类可以听到的声音范围*/
|
||||
/* i以1%的速度递减*/
|
||||
api_beep(i);
|
||||
api_settimer(timer, 1); /* 0.01秒*/
|
||||
if (api_getkey(1) != 128) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
api_beep(0);
|
||||
api_end();
|
||||
}
|
||||
1
28_day/beepdown/make.bat
Normal file
1
28_day/beepdown/make.bat
Normal file
@@ -0,0 +1 @@
|
||||
..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
Reference in New Issue
Block a user