Invalid conversion from 'int' to 'uint8_t* {aka unsigned char*}' [-fpermissive]

You are passing a fixed number to the function instead of a pointer for the 2nd argument.

#define RSRV2_R   0x14      //reserved

  (void) I2CWrite ( TLI493D_A0, RSRV2_R, senReg[RSRV2_R]);

The code generates a warning on an UNO because the compiler options are set to be more permissive of errors than on the Nano 33 BLE, the code is still incorrect on an UNO.

/home/test/Arduino/TLI_493D_SerialPrint_stucked/hall3d.cpp: In function 'void WriteMirrorToSensorReg()':
/home/test/Arduino/TLI_493D_SerialPrint_stucked/hall3d.cpp:345:57: warning: invalid conversion from 'int' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
   (void) I2CWrite ( TLI493D_A0, RSRV2_R, senReg[RSRV2_R]);
                                                         ^
In file included from /home/jdbarney/Arduino/TLI_493D_SerialPrint_stucked/hall3d.cpp:2:0:
/home/test/Arduino/TLI_493D_SerialPrint_stucked/interface.h:8:9: note:   initializing argument 2 of 'uint8_t I2CWrite(uint8_t, uint8_t*, uint8_t)'
 uint8_t I2CWrite( uint8_t addr, uint8_t * wData, uint8_t wLength);
         ^~~~~~~~
/home/test/Arduino/TLI_493D_SerialPrint_stucked/interface.cpp: In function 'uint8_t I2CWrite(uint8_t, uint8_t*, uint8_t)':
/home/test/Arduino/TLI_493D_SerialPrint_stucked/interface.cpp:18:17: warning: for increment expression has no effect [-Wunused-value]
   for (i=0;i++;i< wLength){
                ~^~~~~~~~~
/home/test/Arduino/TLI_493D_SerialPrint_stucked/interface.cpp:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

In addition to the error you are asking about, the for statement is written incorrectly in the I2CWrite function.

1 Like