comparison Small_CPU/Src/spi.c @ 90:83857eb3b12b kittz

+- stable
author Dmitry Romanov <kitt@bk.ru>
date Fri, 23 Nov 2018 18:14:56 +0300
parents ff7775cc34c4
children 22a1094545f3
comparison
equal deleted inserted replaced
89:ff7775cc34c4 90:83857eb3b12b
122 hspi1.Init.Direction = SPI_DIRECTION_2LINES; 122 hspi1.Init.Direction = SPI_DIRECTION_2LINES;
123 hspi1.Init.DataSize = SPI_DATASIZE_8BIT; 123 hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
124 hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; 124 hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
125 hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; 125 hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
126 hspi1.Init.NSS = SPI_NSS_HARD_INPUT; //SPI_NSS_SOFT; 126 hspi1.Init.NSS = SPI_NSS_HARD_INPUT; //SPI_NSS_SOFT;
127 hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_128; 127 hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64;
128 hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; 128 hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
129 hspi1.Init.TIMode = SPI_TIMODE_DISABLED; 129 hspi1.Init.TIMode = SPI_TIMODE_DISABLED;
130 hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; //_DISABLED; _ENABLED; 130 hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; //_DISABLED; _ENABLED;
131 hspi1.Init.CRCPolynomial = 7; 131 hspi1.Init.CRCPolynomial = 7;
132 HAL_SPI_Init(&hspi1); 132 HAL_SPI_Init(&hspi1);
323 global.dataSendToSlaveIsNotValidCount = 0; 323 global.dataSendToSlaveIsNotValidCount = 0;
324 } else { 324 } else {
325 // GPIO_new_DEBUG_LOW(); //For debug. 325 // GPIO_new_DEBUG_LOW(); //For debug.
326 global.dataSendToSlaveIsValid = 0; 326 global.dataSendToSlaveIsValid = 0;
327 global.dataSendToSlaveIsNotValidCount++; 327 global.dataSendToSlaveIsNotValidCount++;
328 global.check_sync_not_running++;
329 } 328 }
330 global.dataSendToMaster.power_on_reset = 0; 329 global.dataSendToMaster.power_on_reset = 0;
331 global.deviceDataSendToMaster.power_on_reset = 0; 330 global.deviceDataSendToMaster.power_on_reset = 0;
332 331
333 332