Dmitry Kovalev
/
LG2
fork
Fork of LG by
Diff: MTimer.c
- Revision:
- 89:a0d344db227e
- Parent:
- 88:b5c1d9d338d1
- Child:
- 92:c892f0311aa7
diff -r b5c1d9d338d1 -r a0d344db227e MTimer.c --- a/MTimer.c Thu Mar 24 10:15:56 2016 +0000 +++ b/MTimer.c Thu Mar 24 12:57:10 2016 +0000 @@ -18,17 +18,11 @@ unsigned int CountV31=0; unsigned int CountV255=0 ; unsigned int CountV64 = 0; -unsigned int init_timer (unsigned int TimerInterval ) +unsigned int Init_TIM1 (unsigned int TimerInterval ) { - //start DAC prepearing for writing - //Match Register 0 LPC_TIM1->MR0 = TimerInterval; - //Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs LPC_TIM1->MCR = 3; /* Interrupt and Reset on MR1 */ NVIC_EnableIRQ(TIMER1_IRQn); - //LPC_GPIO0->FIOSET |= (1<<5); - - return 0; } @@ -42,6 +36,9 @@ ///////////////////////////////////////////////////// /////////////////////EVENT/////////////////////////// ///////////////////////////////////////////////////// +///////////////////////////////////////////////////// +///////////////////// 1Hz /////////////////////////// +///////////////////////////////////////////////////// void Event_1Hz(void)// событие раз в 1 Гц { if (Event1Hz) { @@ -50,6 +47,9 @@ BackLight (); } } +///////////////////////////////////////////////////// +///////////////////// 1kHz ////////////////////////// +///////////////////////////////////////////////////// void Event_1KHz(void)// событие раз в 1 кГц { if (Event1K) { @@ -62,6 +62,9 @@ } } } +///////////////////////////////////////////////////// +///////////////////// 100kHz ////////////////////////// +///////////////////////////////////////////////////// void Event_100KHz(void)// событие раз в 100 кГц { if (Event100K) { @@ -77,16 +80,18 @@ } } } +///////////////////////////////////////////////////// +//////////////////vibro EVENT//////////////////////// +///////////////////////////////////////////////////// void Event_Vibro(void)// событие от вибр { if (EventVibro) { EventVibro --; } } -///////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////// - - +///////////////////////////////////////////////////// +///////////////////////////////////////////////////// +///////////////////////////////////////////////////// @@ -100,16 +105,11 @@ LPC_TIM1->TCR = 1; return; } - - ////////////////////////////////////////////////////////////////////// /////////////////////////прерывание таймера 1////////////////////////// ////////////////////////////////////////////////////////////////////// __irq void TIMER1_IRQHandler (void) { -//LoopOn - - // Init_SPI_Exchange();// CS ResetCS(ADC); //prepare ADC for sampling SetDAC(DAC);