projects
/
my-code
/
atmel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new prescaler + debug outs
[my-code/atmel.git]
/
hdw-tank
/
motor.asm
diff --git
a/hdw-tank/motor.asm
b/hdw-tank/motor.asm
index
3339c99
..
9e59e26
100644
(file)
--- a/
hdw-tank/motor.asm
+++ b/
hdw-tank/motor.asm
@@
-1,24
+1,24
@@
; motor functions
; motor functions
-.equ MOT_
DIR_L = 0x02
-.equ MOT_
DIR_R = 0x03
-.equ MOT_
PWR_L = 0x04
-.equ MOT_
PWR_R = 0x07
+.equ MOT_
1_1 = 0x04
+.equ MOT_
1_2 = 0x02
+.equ MOT_
2_1 = 0x07
+.equ MOT_
2_2 = 0x03
MOTOR_INIT:
; ports -> output
in tmp1,DDRB
MOTOR_INIT:
; ports -> output
in tmp1,DDRB
- sbr tmp1,(1<<MOT_
DIR_L)|(1<<MOT_DIR_R
)
- sbr tmp1,(1<<MOT_
PWR_L)|(1<<MOT_PWR_R
)
+ sbr tmp1,(1<<MOT_
1_1)|(1<<MOT_1_2
)
+ sbr tmp1,(1<<MOT_
2_1)|(1<<MOT_2_2
)
out DDRB,tmp1
MOTOR_STOP:
; output zero
in tmp1,PORTB
out DDRB,tmp1
MOTOR_STOP:
; output zero
in tmp1,PORTB
- cbr tmp1,(1<<MOT_
DIR_L)|(1<<MOT_DIR_R
)
- cbr tmp1,(1<<MOT_
PWR_L)|(1<<MOT_PWR_R
)
+ cbr tmp1,(1<<MOT_
1_1)|(1<<MOT_1_2
)
+ cbr tmp1,(1<<MOT_
2_1)|(1<<MOT_2_2
)
out PORTB,tmp1
ret
out PORTB,tmp1
ret
@@
-26,8
+26,8
@@
MOTOR_STOP:
MOTOR_FWD:
in tmp1,PORTB
MOTOR_FWD:
in tmp1,PORTB
- sbr tmp1,(1<<MOT_
DIR_L)|(1<<MOT_DIR_R
)
-
sbr tmp1,(1<<MOT_PWR_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