@@ -51,13 +51,6 @@ SPI_Buttons::SPI_Buttons(uint16_t configuration_address, uint16_t configuration_
5151 this ->configuration_address_2 = configuration_address_2;
5252 restoreFlash ();
5353
54- this ->spiConfig .peripheral .BaudRatePrescaler = speedPresets[this ->conf .spi_speed ];
55- this ->spiConfig .peripheral .FirstBit = SPI_FIRSTBIT_LSB;
56- this ->spiConfig .peripheral .CLKPhase = SPI_PHASE_1EDGE;
57- this ->spiConfig .peripheral .CLKPolarity = SPI_POLARITY_LOW;
58-
59- initSPI ();
60-
6154 registerCommands ();
6255 this ->setCommandsEnabled (true );
6356 ready = true ;
@@ -112,7 +105,6 @@ void SPI_Buttons::setConfig(ButtonSourceConfig config){
112105 this ->spiConfig .peripheral .FirstBit = SPI_FIRSTBIT_LSB;
113106 this ->spiConfig .peripheral .CLKPhase = SPI_PHASE_1EDGE;
114107 this ->spiConfig .peripheral .CLKPolarity = SPI_POLARITY_LOW;
115-
116108 }else if (conf.mode == SPI_BtnMode::PISOSR){
117109 this ->conf .cutRight = false ;
118110 this ->spiConfig .cspol = false ;
@@ -126,9 +118,7 @@ void SPI_Buttons::setConfig(ButtonSourceConfig config){
126118 this ->spiConfig .peripheral .CLKPhase = SPI_PHASE_1EDGE;
127119 this ->spiConfig .peripheral .CLKPolarity = SPI_POLARITY_LOW;
128120 }
129- // spiPort.takeSemaphore();
130- // spiPort.configurePort(&this->spiConfig.peripheral);
131- // spiPort.giveSemaphore();
121+ this ->spiConfig .peripheral .BaudRatePrescaler = speedPresets[this ->conf .spi_speed ];
132122 initSPI ();
133123 if (config.numButtons == 64 ){ // Special case
134124 mask = 0xffffffffffffffff ;
@@ -202,7 +192,7 @@ uint8_t SPI_Buttons::readButtons(uint64_t* buf){
202192std::string SPI_Buttons::printModes (const std::vector<std::string>& names){
203193 std::string reply;
204194 for (uint8_t i = 0 ; i<names.size ();i++){
205- reply+= names[i] + " :" + std::to_string (i)+ " \n " ;
195+ reply += names[i] + " :" + std::to_string (i) + " \n " ;
206196 }
207197 return reply;
208198}
0 commit comments