MOTOR_INIT:
; ports -> output
- in tmp_motor,DDRB
- sbr tmp_motor,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- sbr tmp_motor,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out DDRB,tmp_motor
+ in tmp1,DDRB
+ sbr tmp1,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ sbr tmp1,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out DDRB,tmp1
MOTOR_STOP:
; output zero
- in tmp_motor,PORTB
- cbr tmp_motor,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- cbr tmp_motor,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp_motor
+ in tmp1,PORTB
+ cbr tmp1,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ cbr tmp1,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp1
ret
MOTOR_FWD:
- in tmp_motor,PORTB
- sbr tmp_motor,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- sbr tmp_motor,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp_motor
+ in tmp1,PORTB
+ sbr tmp1,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ sbr tmp1,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp1
ret
MOTOR_BWD:
- in tmp_motor,PORTB
- cbr tmp_motor,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
- sbr tmp_motor,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp_motor
+ in tmp1,PORTB
+ cbr tmp1,(1<<MOT_DIR_L)|(1<<MOT_DIR_R)
+ sbr tmp1,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp1
ret
MOTOR_RIGHT:
- in tmp_motor,PORTB
- sbr tmp_motor,(1<<MOT_DIR_L)
- cbr tmp_motor,(1<<MOT_DIR_R)
- sbr tmp_motor,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp_motor
+ in tmp1,PORTB
+ sbr tmp1,(1<<MOT_DIR_L)
+ cbr tmp1,(1<<MOT_DIR_R)
+ sbr tmp1,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp1
ret
MOTOR_LEFT:
- in tmp_motor,PORTB
- sbr tmp_motor,(1<<MOT_DIR_R)
- cbr tmp_motor,(1<<MOT_DIR_L)
- sbr tmp_motor,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
- out PORTB,tmp_motor
+ in tmp1,PORTB
+ sbr tmp1,(1<<MOT_DIR_R)
+ cbr tmp1,(1<<MOT_DIR_L)
+ sbr tmp1,(1<<MOT_PWR_L)|(1<<MOT_PWR_R)
+ out PORTB,tmp1
ret
UART_INIT:
; baudrate
- ldi uart_rxtx,UART_BR_H
- sts UBRR0H,uart_rxtx
- ldi uart_rxtx,UART_BR_L
- out UBRR0L,uart_rxtx
+ ldi tmp1,UART_BR_H
+ sts UBRR0H,tmp1
+ ldi tmp1,UART_BR_L
+ out UBRR0L,tmp1
; enable
- ldi uart_rxtx,(1<<RXEN)|(1<<TXEN)
- out UCSR0B,uart_rxtx
+ ldi tmp1,(1<<RXEN)|(1<<TXEN)
+ out UCSR0B,tmp1
; frame format -> 8n1
- ldi uart_rxtx,(1<<UCSZ00)|(1<<UCSZ01)
- sts UCSR0C,uart_rxtx
+ ldi tmp1,(1<<UCSZ00)|(1<<UCSZ01)
+ sts UCSR0C,tmp1
ret
UART_INT_RX_INIT:
- in uart_rxtx,UCSR0B
- sbr uart_rxtx,(1<<RXCIE0)
- out UCSR0B,uart_rxtx
+ in tmp1,UCSR0B
+ sbr tmp1,(1<<RXCIE0)
+ out UCSR0B,tmp1
ret
UART_INT_TX_INIT:
- in uart_rxtx,UCSR0B
- sbr uart_rxtx,(1<<TXCIE0)
- out UCSR0B,uart_rxtx
+ in tmp1,UCSR0B
+ sbr tmp1,(1<<TXCIE0)
+ out UCSR0B,tmp1
ret
UART_TX:
; transmit content of uart_rxtx
- sbis UCSR0A,TXC0
+ sbis UCSR0A,UDRE
rjmp UART_TX
out UDR0,uart_rxtx