Hallo Christoph2,

in deiner Funktion müssen die 8-Bit-Variablen uint8_t sein und die out-Variable natürlich int16_t.

Gruß Dirk