avr: make REED module usable with one and two output pins.

This commit is contained in:
Martin Preuss
2024-10-06 01:31:44 +02:00
parent adcb037976
commit d7705590fe
3 changed files with 30 additions and 20 deletions

View File

@@ -124,15 +124,20 @@ REED_Init:
ldi r17, (reedDataEnd-reedDataBegin)
rcall Utils_FillSram ; (r17, x)
cbi REEDOUT_PORT, REEDOUT_PINNUM ; set common reed port to low
sbi REEDOUT_DDR, REEDOUT_PINNUM ; set common reed output port as output
cbi REED1_PORT, REED1_PINNUM ; disable internal pullup for DATA
cbi REED1_DDR, REED1_PINNUM ; set reed1 port as input
cbi REED2_PORT, REED2_PINNUM ; disable internal pullup for DATA
cbi REED2_DDR, REED2_PINNUM ; set reed2 port as input
cbi REEDOUT1_PORT, REEDOUT1_PINNUM ; set common reed port to low
sbi REEDOUT1_DDR, REEDOUT1_PINNUM ; set common reed output port as output
.ifdef REEDOUT2_DDR
cbi REEDOUT2_PORT, REEDOUT2_PINNUM ; set common reed port to low
sbi REEDOUT2_DDR, REEDOUT2_PINNUM ; set common reed output port as output
.endif
rcall reedSetupConfig ; initial setup from EEPROM, if possible
ret