Fixed bug #879.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10483 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
78b0e26049
commit
aa5b03d54d
|
@ -422,7 +422,7 @@ void spi_lld_start(SPIDriver *spip) {
|
|||
STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD;
|
||||
}
|
||||
/* SPI setup and enable.*/
|
||||
spip->spi->CR1 = 0;
|
||||
spip->spi->CR1 &= ~SPI_CR1_SPE;
|
||||
spip->spi->CR1 = spip->config->cr1 | SPI_CR1_MSTR | SPI_CR1_SSM |
|
||||
SPI_CR1_SSI;
|
||||
spip->spi->CR2 = spip->config->cr2 | SPI_CR2_SSOE | SPI_CR2_RXDMAEN |
|
||||
|
|
|
@ -425,7 +425,7 @@ void spi_lld_start(SPIDriver *spip) {
|
|||
}
|
||||
|
||||
/* SPI setup and enable.*/
|
||||
spip->spi->CR1 = 0;
|
||||
spip->spi->CR1 &= ~SPI_CR1_SPE;
|
||||
spip->spi->CR1 = spip->config->cr1 | SPI_CR1_MSTR;
|
||||
spip->spi->CR2 = spip->config->cr2 | SPI_CR2_FRXTH | SPI_CR2_SSOE |
|
||||
SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN;
|
||||
|
|
|
@ -93,6 +93,8 @@
|
|||
dependencies and configuration directories. This makes possible
|
||||
to have multiple non-conflicting makefiles in the same project.
|
||||
Updated the various platform.mk implementing "smart build" mode.
|
||||
- HAL: Fixed STM32 SPI problem in spi_lld_start() (bug #879)(backported
|
||||
to 17.6.1 and 16.1.9).
|
||||
- HAL: Fixed invalid STM32 CAN3 filters initialization (bug #878)
|
||||
(backported to 17.6.1).
|
||||
- HAL: Fixed missing CAN definitions in STM32L432 registry entry (bug #877)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="cr2-adc_lld_start_conversion-(format)" val="4"/><content id="CR2-adc-null-port_wait_for_interrupt-(format)" val="4"/><content id="CR2-adc-adcp-adc_lld_start_conversion-(format)" val="4"/></contentList>"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="CR2-adc-adcp-adc_lld_start_conversion-(format)" val="4"/><content id="CR2-adc-null-port_wait_for_interrupt-(format)" val="4"/><content id="cr2-adc_lld_start_conversion-(format)" val="4"/></contentList>"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList/> "/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
|
||||
|
|
|
@ -32,7 +32,7 @@ static const SPIConfig hs_spicfg = {
|
|||
NULL,
|
||||
GPIOB,
|
||||
GPIOB_ARD_D15,
|
||||
SPI_CR1_BR_0,
|
||||
SPI_CR1_CPOL | SPI_CR1_BR_0,
|
||||
SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0
|
||||
};
|
||||
|
||||
|
@ -167,15 +167,25 @@ int main(void) {
|
|||
/*
|
||||
* Starting the transmitter and receiver threads.
|
||||
*/
|
||||
chThdCreateStatic(spi_thread_1_wa, sizeof(spi_thread_1_wa),
|
||||
NORMALPRIO + 1, spi_thread_1, NULL);
|
||||
chThdCreateStatic(spi_thread_2_wa, sizeof(spi_thread_2_wa),
|
||||
NORMALPRIO + 1, spi_thread_2, NULL);
|
||||
// chThdCreateStatic(spi_thread_1_wa, sizeof(spi_thread_1_wa),
|
||||
// NORMALPRIO + 1, spi_thread_1, NULL);
|
||||
// chThdCreateStatic(spi_thread_2_wa, sizeof(spi_thread_2_wa),
|
||||
// NORMALPRIO + 1, spi_thread_2, NULL);
|
||||
|
||||
/*
|
||||
* Normal main() thread activity, in this demo it does nothing.
|
||||
*/
|
||||
uint8_t byte = 0x55;
|
||||
while (true) {
|
||||
chThdSleepMilliseconds(500);
|
||||
spiStart(&SPID2, &hs_spicfg);
|
||||
|
||||
spiSelect(&SPID2);
|
||||
spiSend(&SPID2, 1, &byte);
|
||||
spiUnselect(&SPID2);
|
||||
|
||||
spiSelect(&SPID2);
|
||||
spiSend(&SPID2, 1, &byte);
|
||||
spiUnselect(&SPID2);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue