Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSC readPosition returns an int instead of an unsigned int. Doesn't match function header #26

Open
Ragiton opened this issue Apr 8, 2024 · 0 comments

Comments

@Ragiton
Copy link

Ragiton commented Apr 8, 2024

P1AM/src/P1_HSC.cpp

Lines 173 to 187 in b1a57aa

/*******************************************************************************
Description: Reads the current positon of the channel in counts. Value is a
32 bit unsigned interger and will roll under/over at 0xFFFFFFFF
Parameters: -none
Returns: -int current position in counts
Example Code:
*******************************************************************************/
int P1_HSC_Channel::readPosition(void){
return (int)P1.readAnalog(slotNumber,channelNumber);
}

This function returns an int when the function header says it will return an unsigned int. I'm not sure if the rollover will work properly this way. Can you please advise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant