Merge pull request #7473 from AlienWiiBF/DMAOPT_fix

Preinitialallize all SPI DMA option value defaults
This commit is contained in:
Michael Keller 2019-01-28 20:19:46 +13:00 committed by GitHub
commit 6c8b3a7193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -58,6 +58,11 @@ PG_REGISTER_ARRAY_WITH_RESET_FN(spiPinConfig_t, SPIDEV_COUNT, spiPinConfig, PG_S
void pgResetFn_spiPinConfig(spiPinConfig_t *spiPinConfig) void pgResetFn_spiPinConfig(spiPinConfig_t *spiPinConfig)
{ {
for (size_t i = 0; i < SPIDEV_COUNT; i++) {
spiPinConfig[i].txDmaopt = -1;
spiPinConfig[i].rxDmaopt = -1;
}
for (size_t i = 0 ; i < ARRAYLEN(spiDefaultConfig) ; i++) { for (size_t i = 0 ; i < ARRAYLEN(spiDefaultConfig) ; i++) {
const spiDefaultConfig_t *defconf = &spiDefaultConfig[i]; const spiDefaultConfig_t *defconf = &spiDefaultConfig[i];
spiPinConfig[defconf->device].ioTagSck = defconf->sck; spiPinConfig[defconf->device].ioTagSck = defconf->sck;