Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LGstaandart by
Diff: MTimer.c
- Revision:
- 88:b5c1d9d338d1
- Parent:
- 49:53277d871197
- Child:
- 89:a0d344db227e
--- a/MTimer.c Thu Mar 24 09:16:55 2016 +0000 +++ b/MTimer.c Thu Mar 24 10:15:56 2016 +0000 @@ -32,6 +32,66 @@ } + + + + + + + +///////////////////////////////////////////////////// +/////////////////////EVENT/////////////////////////// +///////////////////////////////////////////////////// +void Event_1Hz(void)// событие раз в 1 Гц +{ + if (Event1Hz) { + Event1Hz--; + Discharg (); + BackLight (); + } +} +void Event_1KHz(void)// событие раз в 1 кГц +{ + if (Event1K) { + Event1K --; + Time1K++; + if (Time1K == 1000) { + Time1K = 0; + Event1Hz ++; + Time1Hz++; + } + } +} +void Event_100KHz(void)// событие раз в 100 кГц +{ + if (Event100K) { + Event100K --; + Time100K++; + PinCheng(); // чтение регистра состояния выводов(вибро, полсветка, поджиг, LED) и управление выводами. + if (OutBufCon1Count) { + OutBufCon1Count--; // обратный отсчет для управления ногой и формирование задержки на выдачу + } + if (Time100K == 100) { + Time100K = 0; + Event1K ++; + } + } +} +void Event_Vibro(void)// событие от вибр +{ + if (EventVibro) { + EventVibro --; + } +} +///////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////// + + + + + + + ////////////////////////////////////////////////////////////////////// /////////////////////////включение таймера 1////////////////////////// ////////////////////////////////////////////////////////////////////// @@ -118,6 +178,6 @@ VibroOut(); - Event100K --; + Event100K --; } \ No newline at end of file