@@ -385,7 +385,7 @@ static void setup_icdelay(hm2_modbus_inst_t *inst, unsigned baudrate, unsigned p
385385 } else {
386386 inst -> maxicharbits = 0 ;
387387 }
388- hal_set_ui32 (inst -> hal -> icdelay , inst -> maxicharbits );
388+ hal_set_uint (inst -> hal -> icdelay , inst -> maxicharbits );
389389}
390390
391391//
@@ -454,12 +454,12 @@ static int send_comms_change(hm2_modbus_inst_t *inst)
454454 inst -> cfg_tx .drivedelay = cc -> cmd .idrvdelay ? cc -> cmd .idrvdelay : 1 ;
455455
456456 // Expose to HAL
457- hal_set_ui32 (inst -> hal -> baudrate , baudrate );
458- hal_set_ui32 (inst -> hal -> parity , parity );
459- hal_set_ui32 (inst -> hal -> stopbits , stopbits );
460- hal_set_ui32 (inst -> hal -> rxdelay , inst -> cfg_rx .ifdelay );
461- hal_set_ui32 (inst -> hal -> txdelay , inst -> cfg_tx .ifdelay );
462- hal_set_ui32 (inst -> hal -> drvdelay , inst -> cfg_tx .drivedelay );
457+ hal_set_uint (inst -> hal -> baudrate , baudrate );
458+ hal_set_uint (inst -> hal -> parity , parity );
459+ hal_set_uint (inst -> hal -> stopbits , stopbits );
460+ hal_set_uint (inst -> hal -> rxdelay , inst -> cfg_rx .ifdelay );
461+ hal_set_uint (inst -> hal -> txdelay , inst -> cfg_tx .ifdelay );
462+ hal_set_uint (inst -> hal -> drvdelay , inst -> cfg_tx .drivedelay );
463463 // Redo the inter-character delay settings
464464 setup_icdelay (inst , baudrate , parity , stopbits , cc -> cmd .iicdelay );
465465
@@ -475,17 +475,17 @@ static void set_error(hm2_modbus_inst_t *inst, int errcode)
475475 if (handling_inits (inst )) {
476476 // No individual pins for init commands, use global
477477 hal_set_bool (inst -> hal -> fault , 1 );
478- hal_set_ui32 (inst -> hal -> faultcmd , inst -> cmdidx );
479- hal_set_ui32 (inst -> hal -> lasterror , errcode );
478+ hal_set_uint (inst -> hal -> faultcmd , inst -> cmdidx );
479+ hal_set_uint (inst -> hal -> lasterror , errcode );
480480 return ;
481481 }
482482 hm2_modbus_cmd_t * cc = current_cmd (inst );
483483 if (++ cc -> errors >= MAX_ERRORS || cc -> disabled ) {
484484 cc -> disabled = 1 ;
485485 hal_set_bool (inst -> hal -> cmds [inst -> cmdidx ].disabled , 1 );
486- hal_set_ui32 (inst -> hal -> cmds [inst -> cmdidx ].errorcode , errcode );
486+ hal_set_uint (inst -> hal -> cmds [inst -> cmdidx ].errorcode , errcode );
487487 }
488- hal_set_ui32 (inst -> hal -> cmds [inst -> cmdidx ].error , cc -> errors );
488+ hal_set_uint (inst -> hal -> cmds [inst -> cmdidx ].error , cc -> errors );
489489}
490490
491491//
@@ -632,8 +632,8 @@ static inline int next_command(hm2_modbus_inst_t *inst)
632632 inst -> cmds [i ].disabled = 0 ;
633633 inst -> cmds [i ].errors = 0 ;
634634 hal_set_bool (inst -> hal -> cmds [i ].disabled , 0 );
635- hal_set_ui32 (inst -> hal -> cmds [i ].error , 0 );
636- hal_set_ui32 (inst -> hal -> cmds [i ].errorcode , 0 );
635+ hal_set_uint (inst -> hal -> cmds [i ].error , 0 );
636+ hal_set_uint (inst -> hal -> cmds [i ].errorcode , 0 );
637637 // Honor the writeflush flag when coming out of disable.
638638 write_flush_cmd (inst , i );
639639 }
@@ -648,8 +648,8 @@ static inline int next_command(hm2_modbus_inst_t *inst)
648648 inst -> cmds [i ].disabled = 1 ;
649649 inst -> cmds [i ].errors = 0 ;
650650 hal_set_bool (inst -> hal -> cmds [i ].disabled , 1 );
651- hal_set_ui32 (inst -> hal -> cmds [i ].error , 0 );
652- hal_set_ui32 (inst -> hal -> cmds [i ].errorcode , EAGAIN );
651+ hal_set_uint (inst -> hal -> cmds [i ].error , 0 );
652+ hal_set_uint (inst -> hal -> cmds [i ].errorcode , EAGAIN );
653653 }
654654 }
655655 } while (inst -> cmdidx < inst -> ncmds && inst -> cmds [inst -> cmdidx ].disabled );
@@ -734,9 +734,9 @@ static void do_timeout(hm2_modbus_inst_t *inst)
734734 MSG_DBG ("Timeout reset cmd=%u %s(%d)\n" , inst -> cmdidx , state_names [inst -> state ], inst -> state );
735735 force_resend (inst );
736736 queue_reset (inst );
737- hal_set_ui32 (inst -> hal -> lasterror , ETIMEDOUT );
737+ hal_set_uint (inst -> hal -> lasterror , ETIMEDOUT );
738738 hal_set_bool (inst -> hal -> fault , 1 );
739- hal_set_ui32 (inst -> hal -> faultcmd , inst -> cmdidx );
739+ hal_set_uint (inst -> hal -> faultcmd , inst -> cmdidx );
740740 set_error (inst , ETIMEDOUT );
741741 set_state (inst , STATE_START );
742742 }
@@ -795,8 +795,8 @@ static void process(void *arg, long period)
795795 hal_set_bool (inst -> hal -> cmds [i ].disabled , 0 );
796796 write_flush_cmd (inst , i );
797797 }
798- hal_set_ui32 (inst -> hal -> cmds [i ].errorcode , 0 );
799- hal_set_ui32 (inst -> hal -> cmds [i ].error , 0 );
798+ hal_set_uint (inst -> hal -> cmds [i ].errorcode , 0 );
799+ hal_set_uint (inst -> hal -> cmds [i ].error , 0 );
800800 inst -> cmds [i ].errors = 0 ;
801801 }
802802 }
@@ -877,9 +877,9 @@ static void process(void *arg, long period)
877877 // If the next command is again the first, then we have no
878878 // messages we can send.
879879 if (next_command (inst )) {
880- hal_set_ui32 (inst -> hal -> lasterror , ENODATA );
880+ hal_set_uint (inst -> hal -> lasterror , ENODATA );
881881 hal_set_bool (inst -> hal -> fault , 1 );
882- hal_set_ui32 (inst -> hal -> faultcmd , 0 );
882+ hal_set_uint (inst -> hal -> faultcmd , 0 );
883883 break ;
884884 }
885885 }
@@ -1111,8 +1111,8 @@ static void process(void *arg, long period)
11111111 default :
11121112 MSG_ERR ("%s: error: Unknown state (%d) in process(), setting START state\n" , inst -> name , inst -> state );
11131113 hal_set_bool (inst -> hal -> fault , 1 );
1114- hal_set_ui32 (inst -> hal -> lasterror , EINVAL );
1115- hal_set_ui32 (inst -> hal -> faultcmd , inst -> cmdidx );
1114+ hal_set_uint (inst -> hal -> lasterror , EINVAL );
1115+ hal_set_uint (inst -> hal -> faultcmd , inst -> cmdidx );
11161116 set_state (inst , STATE_START );
11171117 break ;
11181118 }
@@ -2711,21 +2711,21 @@ int rtapi_app_main(void)
27112711 goto errout; \
27122712 } \
27132713 } while(0)
2714- CHECK (hal_param_new_ui32 (comp_id , HAL_RO , & (inst -> hal -> baudrate ), 0 , "%s.baudrate" , inst -> name ));
2715- CHECK (hal_param_new_ui32 (comp_id , HAL_RO , & (inst -> hal -> parity ), 0 , "%s.parity" , inst -> name ));
2716- CHECK (hal_param_new_ui32 (comp_id , HAL_RO , & (inst -> hal -> stopbits ), 0 , "%s.stopbits" , inst -> name ));
2717- CHECK (hal_param_new_ui32 (comp_id , HAL_RO , & (inst -> hal -> icdelay ), 0 , "%s.icdelay" , inst -> name ));
2718- CHECK (hal_param_new_ui32 (comp_id , HAL_RO , & (inst -> hal -> txdelay ), 0 , "%s.txdelay" , inst -> name ));
2719- CHECK (hal_param_new_ui32 (comp_id , HAL_RO , & (inst -> hal -> rxdelay ), 0 , "%s.rxdelay" , inst -> name ));
2720- CHECK (hal_param_new_ui32 (comp_id , HAL_RO , & (inst -> hal -> drvdelay ), 0 , "%s.drivedelay" , inst -> name ));
2714+ CHECK (hal_param_new_uint (comp_id , HAL_RO , & (inst -> hal -> baudrate ), 0 , "%s.baudrate" , inst -> name ));
2715+ CHECK (hal_param_new_uint (comp_id , HAL_RO , & (inst -> hal -> parity ), 0 , "%s.parity" , inst -> name ));
2716+ CHECK (hal_param_new_uint (comp_id , HAL_RO , & (inst -> hal -> stopbits ), 0 , "%s.stopbits" , inst -> name ));
2717+ CHECK (hal_param_new_uint (comp_id , HAL_RO , & (inst -> hal -> icdelay ), 0 , "%s.icdelay" , inst -> name ));
2718+ CHECK (hal_param_new_uint (comp_id , HAL_RO , & (inst -> hal -> txdelay ), 0 , "%s.txdelay" , inst -> name ));
2719+ CHECK (hal_param_new_uint (comp_id , HAL_RO , & (inst -> hal -> rxdelay ), 0 , "%s.rxdelay" , inst -> name ));
2720+ CHECK (hal_param_new_uint (comp_id , HAL_RO , & (inst -> hal -> drvdelay ), 0 , "%s.drivedelay" , inst -> name ));
27212721
27222722 CHECK (hal_pin_new_bool (comp_id , HAL_IN , & (inst -> hal -> suspend ), 0 , "%s.suspend" , inst -> name ));
27232723 CHECK (hal_pin_new_bool (comp_id , HAL_IN , & (inst -> hal -> reset ), 0 , "%s.reset" , inst -> name ));
27242724 CHECK (hal_pin_new_bool (comp_id , HAL_OUT , & (inst -> hal -> fault ), 0 , "%s.fault" , inst -> name ));
2725- CHECK (hal_pin_new_ui32 (comp_id , HAL_OUT , & (inst -> hal -> faultcmd ), 0 , "%s.fault-command" , inst -> name ));
2726- CHECK (hal_pin_new_ui32 (comp_id , HAL_OUT , & (inst -> hal -> lasterror ), 0 , "%s.last-error-code" , inst -> name ));
2725+ CHECK (hal_pin_new_uint (comp_id , HAL_OUT , & (inst -> hal -> faultcmd ), 0 , "%s.fault-command" , inst -> name ));
2726+ CHECK (hal_pin_new_uint (comp_id , HAL_OUT , & (inst -> hal -> lasterror ), 0 , "%s.last-error-code" , inst -> name ));
27272727
2728- hal_set_ui32 (inst -> hal -> baudrate , inst -> cfg_rx .baudrate = inst -> cfg_tx .baudrate = inst -> mbccb -> baudrate );
2728+ hal_set_uint (inst -> hal -> baudrate , inst -> cfg_rx .baudrate = inst -> cfg_tx .baudrate = inst -> mbccb -> baudrate );
27292729 unsigned parity = 0 ;
27302730 if (inst -> mbccb -> format & MBCCB_FORMAT_PARITYEN ) {
27312731 inst -> cfg_rx .flags |= HM2_PKTUART_CONFIG_PARITYEN ;
@@ -2743,22 +2743,22 @@ int rtapi_app_main(void)
27432743 inst -> cfg_tx .flags |= HM2_PKTUART_CONFIG_STOPBITS2 ;
27442744 stopbits = 2 ;
27452745 }
2746- hal_set_ui32 (inst -> hal -> parity , parity );
2747- hal_set_ui32 (inst -> hal -> stopbits , stopbits );
2746+ hal_set_uint (inst -> hal -> parity , parity );
2747+ hal_set_uint (inst -> hal -> stopbits , stopbits );
27482748 if (!inst -> mbccb -> rxdelay ) // Auto
2749- inst -> cfg_rx .ifdelay = hal_set_ui32 (inst -> hal -> rxdelay , calc_ifdelay (inst , inst -> mbccb -> baudrate , parity , stopbits ) - 1 );
2749+ inst -> cfg_rx .ifdelay = hal_set_uint (inst -> hal -> rxdelay , calc_ifdelay (inst , inst -> mbccb -> baudrate , parity , stopbits ) - 1 );
27502750 else // Manual
2751- inst -> cfg_rx .ifdelay = hal_set_ui32 (inst -> hal -> rxdelay , inst -> mbccb -> rxdelay );
2751+ inst -> cfg_rx .ifdelay = hal_set_uint (inst -> hal -> rxdelay , inst -> mbccb -> rxdelay );
27522752
27532753 if (!inst -> mbccb -> txdelay ) // Auto
2754- inst -> cfg_tx .ifdelay = hal_set_ui32 (inst -> hal -> txdelay , calc_ifdelay (inst , inst -> mbccb -> baudrate , parity , stopbits ) + 1 );
2754+ inst -> cfg_tx .ifdelay = hal_set_uint (inst -> hal -> txdelay , calc_ifdelay (inst , inst -> mbccb -> baudrate , parity , stopbits ) + 1 );
27552755 else // Manual
2756- inst -> cfg_tx .ifdelay = hal_set_ui32 (inst -> hal -> txdelay , inst -> mbccb -> txdelay );
2756+ inst -> cfg_tx .ifdelay = hal_set_uint (inst -> hal -> txdelay , inst -> mbccb -> txdelay );
27572757
27582758 if (!inst -> mbccb -> drvdelay ) // Auto
2759- inst -> cfg_tx .drivedelay = hal_set_ui32 (inst -> hal -> drvdelay , 1 );
2759+ inst -> cfg_tx .drivedelay = hal_set_uint (inst -> hal -> drvdelay , 1 );
27602760 else // Manual
2761- inst -> cfg_tx .drivedelay = hal_set_ui32 (inst -> hal -> drvdelay , inst -> mbccb -> drvdelay );
2761+ inst -> cfg_tx .drivedelay = hal_set_uint (inst -> hal -> drvdelay , inst -> mbccb -> drvdelay );
27622762
27632763 inst -> cfg_rx .filterrate = 0 ; // Zero means 2 times baudrate
27642764 inst -> cfg_rx .flags |= HM2_PKTUART_CONFIG_RXEN ;
@@ -2846,9 +2846,9 @@ int rtapi_app_main(void)
28462846 0 , "%s.command.%02d.disable" , inst -> name , c ));
28472847 CHECK (hal_pin_new_bool (comp_id , HAL_OUT , & (inst -> hal -> cmds [c ].disabled ),
28482848 0 , "%s.command.%02d.disabled" , inst -> name , c ));
2849- CHECK (hal_pin_new_ui32 (comp_id , HAL_OUT , & (inst -> hal -> cmds [c ].error ),
2849+ CHECK (hal_pin_new_uint (comp_id , HAL_OUT , & (inst -> hal -> cmds [c ].error ),
28502850 0 , "%s.command.%02d.errors" , inst -> name , c ));
2851- CHECK (hal_pin_new_ui32 (comp_id , HAL_OUT , & (inst -> hal -> cmds [c ].errorcode ),
2851+ CHECK (hal_pin_new_uint (comp_id , HAL_OUT , & (inst -> hal -> cmds [c ].errorcode ),
28522852 0 , "%s.command.%02d.error-code" , inst -> name , c ));
28532853 CHECK (hal_pin_new_bool (comp_id , HAL_IN , & (inst -> hal -> cmds [c ].reset ),
28542854 0 , "%s.command.%02d.reset" , inst -> name , c ));
@@ -2859,7 +2859,7 @@ int rtapi_app_main(void)
28592859 if (hasdisabled (cc )) {
28602860 cc -> disabled = 1 ;
28612861 hal_set_bool (inst -> hal -> cmds [c ].disabled , 1 );
2862- hal_set_ui32 (inst -> hal -> cmds [c ].errorcode , EAGAIN );
2862+ hal_set_uint (inst -> hal -> cmds [c ].errorcode , EAGAIN );
28632863 }
28642864
28652865 // Now create the pins associated with the command
0 commit comments