Merge pull request #3199 from hierophect/litex-build-hotfix
Litex: fix microcontroller common-hal interface
This commit is contained in:
commit
a5725941a0
|
@ -41,12 +41,19 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) {
|
|||
claimed_pins[pin_port] &= ~(1<<pin_number);
|
||||
}
|
||||
|
||||
void common_hal_reset_pin(const mcu_pin_obj_t* pin) {
|
||||
reset_pin_number(0, pin->number);
|
||||
}
|
||||
|
||||
void claim_pin(const mcu_pin_obj_t* pin) {
|
||||
// Set bit in claimed_pins bitmask.
|
||||
claimed_pins[0] |= 1<<pin->number;
|
||||
}
|
||||
|
||||
void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) {
|
||||
claim_pin(pin);
|
||||
}
|
||||
|
||||
bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) {
|
||||
return !(claimed_pins[pin_port] & 1<<pin_number);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue