boolean_t active, boolean_t can_wake)
{
// Check range
- if((pin < 1) || (pin > 16)) {
+ if(pin > 15) {
return -1;
}
// Check programmable feature
- if(pull_type && (pin > 8)) {
+ if(pull_type && (pin > 7)) {
return -2;
}
// Set bits
- uint8_t index = pin - 1;
+ uint8_t index = pin;
if(pull_type) {
bit_set(pull_cache, index);
} else {
int8_t rpp_din_get(uint8_t pin, boolean_t var_thr)
{
// Check range
- if((pin < 1) || (pin > 16)) {
+ if(pin > 15) {
return -1;
}
// Check feature
- if(var_thr && (pin < 9)) {
+ if(var_thr && (pin < 8)) {
return -2;
}
// Use of variable threshold was requested
if(var_thr) {
#if rppCONFIG_DRV == 1
- if(drv_din_get_varthr(pin - 1) == 1) {
+ if(drv_din_get_varthr(pin) == 1) {
return HIGH;
}
#endif
return LOW;
}
- if(is_bit_set(in_cache, pin - 1)) {
+ if(is_bit_set(in_cache, pin)) {
return HIGH;
}
return LOW;
int8_t rpp_din_diag(uint8_t pin)
{
// Check range
- if((pin < 1) || (pin > 16)) {
+ if(pin > 15) {
return -1;
}
- if(is_bit_set(diag_cache, pin - 1)) {
+ if(is_bit_set(diag_cache, pin)) {
return HIGH;
}
return LOW;