File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -692,6 +692,24 @@ extern int hal_get_signal_value_by_name(
692692extern int hal_get_param_value_by_name (
693693 const char * name , hal_type_t * type , hal_data_u * * data );
694694
695+ /***********************************************************************
696+ * MISC HELPER FUNCTIONS *
697+ ************************************************************************/
698+
699+ /** hal_extend_counter() extends a counter value with nbits to 64 bits.
700+
701+ For some hardware counters it may be desireable to extend their
702+ range beyond their native width.
703+
704+ This function maintains a 64bit counter value and deals with wrap
705+ arounds. Increments between updates need to be less than 2**(nbits-1).
706+ Call with current 64bit counter value to be updated as @param old,
707+ new lower-bit counter value read from hardware as @param newlow
708+ and width of counter as @param nbits.
709+ @returns new counter 64bit counter value.
710+ Code by Jeff Epler. */
711+ extern rtapi_s64 hal_extend_int (rtapi_s64 old , rtapi_s64 newlow , int nbits );
712+
695713/***********************************************************************
696714* EXECUTION RELATED FUNCTIONS *
697715************************************************************************/
You can’t perform that action at this time.
0 commit comments