Wrong DMA initializations.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14259 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
a600cc9c36
commit
570bc7b49b
|
@ -17,6 +17,18 @@
|
|||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
|
||||
void spi_cb(SPIDriver *spip) {
|
||||
|
||||
(void)spip;
|
||||
}
|
||||
|
||||
SPIConfig spicfg1 = {
|
||||
.end_cb = spi_cb,
|
||||
.ssline = 4U,
|
||||
.SSPCR0 = 0U,
|
||||
.SSPCPSR = 0U
|
||||
};
|
||||
|
||||
semaphore_t blinker_sem;
|
||||
|
||||
/*
|
||||
|
@ -58,6 +70,11 @@ int main(void) {
|
|||
*/
|
||||
palSetLineMode(25U, PAL_MODE_OUTPUT_PUSHPULL | PAL_RP_PAD_DRIVE12);
|
||||
|
||||
/*
|
||||
* Settin up SPI0.
|
||||
*/
|
||||
spiStart(&SPID0, &spicfg1);
|
||||
|
||||
/*
|
||||
* Creates the blinker thread.
|
||||
*/
|
||||
|
|
|
@ -203,8 +203,8 @@ void spi_lld_start(SPIDriver *spip) {
|
|||
}
|
||||
|
||||
/* DMA setup.*/
|
||||
dmaChannelSetSourceX(spip->dmarx, (uint32_t)&spip->spi->SSPDR);
|
||||
dmaChannelSetDestinationX(spip->dmatx, (uint32_t)&spip->spi->SSPDR);
|
||||
dmaChannelSetDestinationX(spip->dmarx, (uint32_t)&spip->spi->SSPDR);
|
||||
dmaChannelSetSourceX(spip->dmatx, (uint32_t)&spip->spi->SSPDR);
|
||||
}
|
||||
|
||||
/* Configuration-dependent DMA settings.*/
|
||||
|
|
Loading…
Reference in New Issue