Skip to content

Commit 43e6ed0

Browse files
author
Martino Facchin
committed
pulseIn: remove PORTA support
it doesn't seem to be supported by "standard" AVR
1 parent ca18193 commit 43e6ed0

File tree

3 files changed

+0
-33
lines changed

3 files changed

+0
-33
lines changed

hardware/arduino/avr/cores/arduino/wiring_private.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ extern "C"{
4343
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
4444
#endif
4545

46-
uint16_t countPulseASM_A(const uint8_t port, const uint8_t bit, uint16_t maxloops, uint8_t state);
4746
uint16_t countPulseASM_B(const uint8_t port, const uint8_t bit, uint16_t maxloops, uint8_t state);
4847
uint16_t countPulseASM_C(const uint8_t port, const uint8_t bit, uint16_t maxloops, uint8_t state);
4948
uint16_t countPulseASM_D(const uint8_t port, const uint8_t bit, uint16_t maxloops, uint8_t state);

hardware/arduino/avr/cores/arduino/wiring_pulse.S

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,12 @@
2222

2323
#include <avr/io.h>
2424

25-
.global countPulseASM_A
2625
.global countPulseASM_B
2726
.global countPulseASM_C
2827
.global countPulseASM_D
2928

3029
.section .text
3130

32-
countPulseASM_A:
33-
push r17
34-
mov r24,r1
35-
mov r25,r1
36-
loop_a:
37-
adiw r24, 1
38-
cp r24, r20
39-
cpc r25, r21
40-
breq return_zero_a
41-
//check the pin state to be consistent with the mask
42-
in r17, PINA-0x20
43-
eor r17, r18
44-
and r17, r22
45-
cpi r17, 0
46-
breq loop_a
47-
//sbic PINA-0x20, 7
48-
//rjmp loop
49-
ret_delay_a:
50-
rjmp exit_a
51-
return_zero_a:
52-
mov r24,r1
53-
mov r25,r1
54-
exit_a:
55-
pop r17
56-
ret
57-
58-
5931
countPulseASM_B:
6032
push r17
6133
mov r24,r1

hardware/arduino/avr/cores/arduino/wiring_pulse.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout)
5858
unsigned long width = 0; // keep initialization out of time critical area
5959

6060
switch (port) {
61-
case PA:
62-
//portA
63-
countPulseASM = &countPulseASM_A;
64-
break;
6561
case PB:
6662
//portB
6763
countPulseASM = &countPulseASM_B;

0 commit comments

Comments
 (0)