projects
/
my-code
/
atmel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean up + uart tx fix
[my-code/atmel.git]
/
hdw-tank
/
motor.asm
diff --git
a/hdw-tank/motor.asm
b/hdw-tank/motor.asm
index
9386180
..
3339c99
100644
(file)
--- a/
hdw-tank/motor.asm
+++ b/
hdw-tank/motor.asm
@@
-1,67
+1,63
@@
; motor functions
; motor functions
-;include "../include/m128def.inc"
-
.equ MOT_DIR_L = 0x02
.equ MOT_DIR_R = 0x03
.equ MOT_PWR_L = 0x04
.equ MOT_PWR_R = 0x07
.equ MOT_DIR_L = 0x02
.equ MOT_DIR_R = 0x03
.equ MOT_PWR_L = 0x04
.equ MOT_PWR_R = 0x07
-;.def tmp = r17
-
MOTOR_INIT:
; ports -> output
MOTOR_INIT:
; ports -> output
- in tmp,DDRB
- sbr tmp,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- sbr tmp,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out DDRB,tmp
+ in tmp
1
,DDRB
+ sbr tmp
1
,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ sbr tmp
1
,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out DDRB,tmp
1
MOTOR_STOP:
; output zero
MOTOR_STOP:
; output zero
- in tmp,PORTB
- cbr tmp,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- cbr tmp,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp
+ in tmp
1
,PORTB
+ cbr tmp
1
,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ cbr tmp
1
,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp
1
ret
MOTOR_FWD:
ret
MOTOR_FWD:
- in tmp,PORTB
- sbr tmp,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- sbr tmp,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp
+ in tmp
1
,PORTB
+ sbr tmp
1
,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ sbr tmp
1
,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp
1
ret
MOTOR_BWD:
ret
MOTOR_BWD:
- in tmp,PORTB
- cbr tmp,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- sbr tmp,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp
+ in tmp
1
,PORTB
+ cbr tmp
1
,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ sbr tmp
1
,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp
1
ret
MOTOR_RIGHT:
ret
MOTOR_RIGHT:
- in tmp,PORTB
- sbr tmp,(1<<MOT_DIR_L)
- cbr tmp,(1<<MOT_DIR_R)
- sbr tmp,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp
+ in tmp
1
,PORTB
+ sbr tmp
1
,(1<<MOT_DIR_L)
+ cbr tmp
1
,(1<<MOT_DIR_R)
+ sbr tmp
1
,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp
1
ret
MOTOR_LEFT:
ret
MOTOR_LEFT:
- in tmp,PORTB
- sbr tmp,(1<<MOT_DIR_R)
- cbr tmp,(1<<MOT_DIR_L)
- sbr tmp,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp
+ in tmp
1
,PORTB
+ sbr tmp
1
,(1<<MOT_DIR_R)
+ cbr tmp
1
,(1<<MOT_DIR_L)
+ sbr tmp
1
,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp
1
ret
ret