![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: SPI.c
- Revision:
- 95:dd51e577e114
- Parent:
- 92:c892f0311aa7
- Child:
- 96:1c8536458119
diff -r 9822cbe4d8f5 -r dd51e577e114 SPI.c --- a/SPI.c Sun Mar 27 16:48:52 2016 +0000 +++ b/SPI.c Mon Mar 28 11:33:45 2016 +0000 @@ -8,10 +8,10 @@ unsigned int Temp_ADC_5; -unsigned int Buff_ADC_1 [16]; -unsigned int Buff_ADC_2 [16]; -unsigned int Buff_ADC_3 [16]; -unsigned int Buff_ADC_4 [16]; +unsigned int Buff_ADC_1 [32]; +unsigned int Buff_ADC_2 [32]; +unsigned int Buff_ADC_3 [32]; +unsigned int Buff_ADC_4 [32]; unsigned int Buff_ADC_5 [256]; unsigned int Buff_AMP [256]; @@ -48,19 +48,18 @@ LPC_SSP0->DR = (Spi.DAC_B); //e. передача 12 бит } - LPC_DAC->CR = (((SinPLC[CountV64]*35)+24300)); + //LPC_DAC->CR = (((SinPLC[CountV64]*35)+24300));// модулятор while (LPC_SSP0->SR & RX_SSP_notEMPT) //если буфер SPI не пуст. DummySPI = LPC_SSP0->DR; //очистить буфер. - Buff_ADC_1 [CountV255] = Spi.ADC1; // ампл ацп. - Buff_ADC_2 [CountV255] = Spi.ADC2; - Buff_ADC_3 [CountV255] = Spi.ADC3; - Buff_ADC_4 [CountV255] = Spi.ADC4; - Buff_ADC_5 [CountV255] = Spi.ADC5; - - - + Buff_ADC_1 [CountV31] = Spi.ADC1; + Buff_ADC_2 [CountV31] = Spi.ADC2; + Buff_ADC_3 [CountV31] = Spi.ADC3; + Buff_ADC_4 [CountV31] = Spi.ADC4; + Buff_ADC_5 [CountV255] = Spi.ADC5; // ампл ацп. + + Temp_AMP += Buff_ADC_5[CountV255]; Temp_AMP -= Buff_ADC_5[(CountV255-32) & 0xff]; // заполнение буфера накопленых приращений за 8 тактов Buff_AMP[CountV255] = (unsigned int) (Temp_AMP); @@ -69,7 +68,7 @@ Temp_ADC_2 -= Buff_ADC_2[(CountV31-32) & 0xff]; Temp_ADC_3 += Buff_ADC_3[CountV31]; - Temp_ADC_3 -= Buff_ADC_3[(CountV31-23) & 0xff]; + Temp_ADC_3 -= Buff_ADC_3[(CountV31-32) & 0xff]; Temp_ADC_4 += Buff_ADC_4[CountV31]; Temp_ADC_4 -= Buff_ADC_4[(CountV31-32) & 0xff];