![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
Diff: SPI.c
- Revision:
- 89:a0d344db227e
- Parent:
- 86:398da56ef751
- Child:
- 92:c892f0311aa7
--- a/SPI.c Thu Mar 24 10:15:56 2016 +0000 +++ b/SPI.c Thu Mar 24 12:57:10 2016 +0000 @@ -24,9 +24,9 @@ 1016, 1023 }; -void SPI_Exchange() +void SPI_Exchange(void) { - unsigned int Dummy; + unsigned int DummySPI; Spi.ADC5 = LPC_SSP0->DR; Spi.ADC4 = LPC_SSP0->DR; @@ -49,8 +49,8 @@ } LPC_DAC->CR = (((SinPLC[CountV64]*35)+21300)); - while (LPC_SSP0->SR & RX_SSP_notEMPT) //если буфер SPI не пуст. - Dummy = LPC_SSP0->DR; //очистить буфер. + while (LPC_SSP0->SR & RX_SSP_notEMPT) //если буфер SPI не пуст. + DummySPI = LPC_SSP0->DR; //очистить буфер. Buff_ADC_1 [CountV255] = Spi.ADC1; // ампл ацп. @@ -76,14 +76,4 @@ Temp_ADC_5 += Buff_ADC_1[CountV255]; Temp_ADC_5 -= Buff_ADC_1[(CountV255-32) & 0xff]; -} -void Init_SPI_Exchange() -{ - ResetCS(ADC); //prepare ADC for sampling - SetDAC(DAC); - LPC_GPIO2->FIOSET |= 0x0000004; // turn on the LED -//LPC_GPIO2->FIOSET |= 0x0000004; // turn on the LED -//LPC_GPIO2->FIOSET |= 0x0000004; // turn on the LED - SetCS(ADC); //start ADC sampling - ResetDAC(DAC); } \ No newline at end of file