1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Blackbox code size savings by factoring common loops out into fuctions

This commit is contained in:
Nicholas Sherlock 2015-07-31 15:23:56 +09:00
parent 53860e461c
commit 0c4604eeef
5 changed files with 63 additions and 43 deletions

View file

@ -154,6 +154,20 @@ void blackboxWriteSignedVB(int32_t value)
blackboxWriteUnsignedVB(zigzagEncode(value));
}
void blackboxWriteSignedVBArray(int32_t *array, int count)
{
for (int i = 0; i < count; i++) {
blackboxWriteSignedVB(array[i]);
}
}
void blackboxWriteSigned16VBArray(int16_t *array, int count)
{
for (int i = 0; i < count; i++) {
blackboxWriteSignedVB(array[i]);
}
}
void blackboxWriteS16(int16_t value)
{
blackboxWrite(value & 0xFF);