• R/O
  • SSH
  • HTTPS

nos: Commit


Commit MetaInfo

Révision367 (tree)
l'heure2009-10-28 16:01:55
Auteuruchan_nos

Message de Log

BEEP用タイマ設定メソッドを追加

Change Summary

Modification

--- bitnos5/trunk/kernel/pit.cpp (revision 366)
+++ bitnos5/trunk/kernel/pit.cpp (revision 367)
@@ -35,3 +35,26 @@
3535 {
3636 timman->IntHandler();
3737 }
38+
39+void PIT::BeetSetCounter(int cnt)
40+{
41+ io_out8(PIT::Port::CR, PIT::CH::CH2 | PIT::CountAccessMode::LH | PIT::CountMode::M3Bin);
42+ io_out8(PIT::Port::Cnt2, cnt & 0x00ff);
43+ io_out8(PIT::Port::Cnt2, (cnt >> 8) & 0x00ff);
44+}
45+
46+void PIT::BeepOn()
47+{
48+ uint8_t reg = io_in8(PIT::Port::System);
49+ reg |= 0x03;
50+ reg &= 0x0f;
51+ io_out8(PIT::Port::System, reg);
52+}
53+
54+void PIT::BeepOff()
55+{
56+ uint8_t reg = io_in8(PIT::Port::System);
57+ reg &= 0x0d;
58+ io_out8(PIT::Port::System, reg);
59+}
60+
--- bitnos5/trunk/include/bitnos/pit.h (revision 366)
+++ bitnos5/trunk/include/bitnos/pit.h (revision 367)
@@ -59,6 +59,12 @@
5959 static void Init();
6060
6161 static void IntHandler();
62+
63+ static void BeetSetCounter(int cnt);
64+
65+ static void BeepOn();
66+
67+ static void BeepOff();
6268 };
6369
6470 #endif /* PIT_H_ */
Afficher sur ancien navigateur de dépôt.