[Nut-upsdev] R: Small fixes needed for Riello driver

Tim Rice tim at multitalents.net
Wed Apr 10 15:41:32 UTC 2013


On Wed, 10 Apr 2013, Elio Parisi wrote:

> Sorry... now it should be ok.
> 

drivers/riello_ser.c
......
-extern BYTE commbyte;
-extern int wait_packet;
-extern int foundnak;
-extern int foundbadcrc;
-extern int buf_ptr_length;
-extern BYTE requestSENTR;
+extern uint8_t commbyte;
+extern uint8_t wait_packet;
+extern uint8_t foundnak;
+extern uint8_t foundbadcrc;
+extern uint8_t buf_ptr_length;
+extern uint8_t requestSENTR;
......

You did intend to change the int's to uint8_t, right?

.....
-       BYTE commb = 0;
+       uint8_t commb = 0;

        realt = time(NULL);
        while (wait_packet) {
                serial_read(1000, &commb);
                nowt = time(NULL);
-               commbyte = (BYTE) commb;
+               commbyte = (uint8_t) commb;
                           ^^^^^^^^^
                riello_parse_serialport(typedev, bufIn, gpser_error_control);
.....

If commbyte and comb are both uint8_t, there is no need for the cast.


-- 
Tim Rice				Multitalents
tim at multitalents.net





More information about the Nut-upsdev mailing list