1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

[LED_STRIP] Protect against null timerHardware (#8157)

[LED_STRIP] Protect against null timerHardware
This commit is contained in:
Michael Keller 2019-05-05 22:33:35 +12:00 committed by GitHub
commit ca1ab44195
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -58,6 +58,11 @@ bool ws2811LedStripHardwareInit(ioTag_t ioTag)
}
const timerHardware_t *timerHardware = timerGetByTag(ioTag);
if (timerHardware == NULL) {
return false;
}
TIM_TypeDef *timer = timerHardware->tim;
timerChannel = timerHardware->channel;

View file

@ -86,6 +86,11 @@ bool ws2811LedStripHardwareInit(ioTag_t ioTag)
DMA_InitTypeDef DMA_InitStructure;
const timerHardware_t *timerHardware = timerGetByTag(ioTag);
if (timerHardware == NULL) {
return false;
}
timer = timerHardware->tim;
#if defined(USE_DMA_SPEC)