[hal] Don't write a 0 length led string to the FPGA (#6271)

Due to something weird in the FPGA, calling strobeLoad() with a string length of 0 causes both CPUs to spin at 100%, basically shutting down everything else on the robot.

If a 0 length string happens to be passed, just bail out early.
This commit is contained in:
Thad House
2024-01-20 09:32:16 -08:00
committed by GitHub
parent 1241dfdf68
commit 7957f4a625

View File

@@ -198,6 +198,10 @@ void HAL_WriteAddressableLEDData(HAL_AddressableLEDHandle handle,
return;
}
if (length == 0) {
return;
}
std::memcpy(led->ledBuffer, data, length * sizeof(HAL_AddressableLEDData));
asm("dmb");