/* Uses the scalar orientation value to convert from body frame to chip frame  */
void inv_convert_to_chip(unsigned short orientation, const long *input, long *output)
/* Uses the scalar orientation value to convert from body frame to chip frame  */
void inv_convert_to_chip(unsigned short orientation, const long *input, long *output)
{
    output[orientation & 0x03]      = input[0] * SIGNSET(orientation & 0x004);
    output[(orientation>>3) & 0x03] = input[1] * SIGNSET(orientation & 0x020);
    output[(orientation>>6) & 0x03] = input[2] * SIGNSET(orientation & 0x100);
}