Hi Mike,
You don't need to generate an error because the function writes to the error flag if there is no error, too.
To simulate the error situation you need to declare bErrFlag as a 32-bit value like in this example:
static frac16_t f16Result;
static frac16_t f16Y, f16X;
static uint32_t bErrFlag;
void main(void)
{
bErrFlag = 0x12345678:
f16Y = FRAC16(0.9); /* f16Y = 0.9 */
f16X = FRAC16(0.3); /* f16X = 0.3 */
/* f16Result = atan(f16Y / f16X); f16Result * 180 => angle [degree] */
f16Result = GFLIB_AtanYX_F16(f16Y, f16X, (bool_t *)&bErrFlag);
}
You will see bErrFlag is set to 0 by the function. This should not be the case if the function returns the error flag as a 16 bit bool type.