mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Protect against null timerHardware
This commit is contained in:
parent
95544151f1
commit
355fc7bd7e
2 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue