Qt shows error
Unsolved
General and Desktop
-
Run the following code then this error shows :The program has unexpectedly finished.
void MainWindow::on_Tx_clicked()
{
bcm2835_spi_begin();
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0,0);
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS1,0);
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_128);
bcm2835_spi_setDataMode(BCM2835_SPI_MODE3);
bcm2835_spi_chipSelect(BCM2835_SPI_CS0);uint8_t data; data = bcm2835_spi_transfer((uint8_t)0x55); ui->textBrowser->setText(QString::number(data));
}
-
@Rameshwar said in Qt shows error:
The program has unexpectedly finished.
Use a debugger and find out where it crashes. Most likely you are de-referencing an uninitialized or no longer valid pointer.
Regards
-
Check return value from bcm2835_spi_begin() function;
Maybe 0...