![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
Diff: Global.c
- Revision:
- 226:4a4d5bd5fcd7
- Parent:
- 225:f8fee6c586cc
- Child:
- 227:2774b56bfab0
diff -r f8fee6c586cc -r 4a4d5bd5fcd7 Global.c --- a/Global.c Tue Dec 12 05:53:39 2017 +0000 +++ b/Global.c Tue Dec 26 05:14:09 2017 +0000 @@ -41,8 +41,12 @@ int BuffADC_128Point [100]; int BuffADC_64Point [100]; int BuffADC_32Point [100]; + int BuffADC_16Point [100]; + + int BuffADC_10HFO [100]; int BuffADC_10v [100]; + int BuffADC_10v_OLD [100]; int BuffADC_10v_F [100]; int BuffADC_znak [100]; @@ -137,8 +141,9 @@ Gyro.ResetLevelCool = (unsigned int)((GyroP.Str.ResetLevelCool-0x7fff)&0xffff); //105 Gyro.ResetLevelHeat = (unsigned int)((GyroP.Str.ResetLevelHeat-0x7fff)&0xffff); Gyro.HFO_Gain = GyroP.Str.HFO_Gain; - Gyro.HFO_ref = (unsigned int)(GyroP.Str.HFO_ref)*0.82; + Gyro.HFO_ref = (unsigned int)(GyroP.Str.HFO_ref); Gyro.LG_Type = GyroP.Str.LG_Type; + Gyro.LG_Type = 1; Gyro.My_Addres = GyroP.Str.My_Addres; // Gyro.My_Addres = 0; Gyro.GLD_Serial = GyroP.Str.GLD_Serial; Gyro.FrqHZ = (7680000/GyroP.Str.FrqHZ); @@ -285,11 +290,22 @@ Cur_QEI=0; Last_QEI=0; } +void BUTTON_init(void) { + LPC_GPIO0->FIODIR &= ~(1 << 1); /* PORT2.10 defined as input */ + LPC_GPIOINT->IO0IntEnF |= (1 << 1); /* enable falling edge irq */ + NVIC_EnableIRQ(EINT3_IRQn); /* enable irq in nvic */ +} +/*void EINT3_IRQHandler() +{ + if(Gyro.EXT_Latch)Gyro.EXT_Latch=0; + else Gyro.EXT_Latch=1; + LPC_GPIOINT->IO2IntClr |= (1 << 10); +}*/ void GLD_Init(void) { int Dummy; // инициализация мусорки для очистки буфера приема. - + BUTTON_init(); if(Gyro.LG_Type==1)Spi.DAC_A=Gyro.HFO_Max; @@ -428,7 +444,6 @@ ///////////////////////////////////////////////////// ///////////////////////////////////////////////////// NVIC_EnableIRQ(EINT3_IRQn); - // LPC_GPIOINT->IO0IntEnF |= (1<<1); /* enable falling edge irq */ LPC_GPIOINT->IO0IntEnR |= (1<<1); /* enable rasing edge irq */ ///////////////////////////////////////////////////// ////////////////управление уартом//////////////////// @@ -444,7 +459,7 @@ ///////////////////////////////////////////////////// LPC_PINCON->PINSEL0 &= ~(3<<8); //e. P0.4 is GPIO pin (запись ( 00 ) в 9:8 бит PISEL0 выбор P0.4 как GPIO) LPC_PINCON->PINMODE0 |= (3<<8); //e. P0.4 is GPIO pin (запись ( 11 ) в 9:8 бит PINMODE0 "для включения подтягивающего резистора") - LPC_GPIO0->FIODIR |= (1<<4); //e. P0.4 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.4 как выход) + LPC_GPIO0->FIODIR |= (1<<4); //e. P0.4 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.4 как выход) ///////////////////////////////////////////////////// /////////////////////////////////////////////////////