Skip to content

Commit

Permalink
Replace empty LED macro definitions with automatic helper macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
sim- committed Sep 13, 2015
1 parent d7f80f6 commit 4f1f2b0
Show file tree
Hide file tree
Showing 29 changed files with 41 additions and 238 deletions.
14 changes: 7 additions & 7 deletions afro.inc
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,28 @@
;*********************
; PORT D definitions *
;*********************
.equ WarnLED = 2
.equ red_led = 2
.equ AnFET = 3
.equ BnFET = 4
.equ CnFET = 5
.equ StatLED = 7
.equ green_led = 7

.equ INIT_PD = 0
.equ DIR_PD = (1<<AnFET)+(1<<BnFET)+(1<<CnFET)+(1<<WarnLED)+(1<<StatLED)
.equ DIR_PD = (1<<AnFET)+(1<<BnFET)+(1<<CnFET)+(1<<red_led)+(1<<green_led)

.equ AnFET_port = PORTD
.equ BnFET_port = PORTD
.equ CnFET_port = PORTD

.MACRO RED_on
sbi PORTD, WarnLED
sbi PORTD, red_led
.ENDMACRO
.MACRO RED_off
cbi PORTD, WarnLED
cbi PORTD, red_led
.ENDMACRO
.MACRO GRN_on
cbi PORTD, StatLED
cbi PORTD, green_led
.ENDMACRO
.MACRO GRN_off
sbi PORTD, StatLED
sbi PORTD, green_led
.ENDMACRO
16 changes: 8 additions & 8 deletions afro2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
.equ i2c_clk = 5 ; ADC5/SCL
.equ i2c_data = 4 ; ADC4/SDA
.equ ApFET = 3 ; o
.equ StatLED = 2 ; o
.equ green_led = 2 ; o
.equ mux_b = 1 ; ADC1 phase input
.equ mux_a = 0 ; ADC0 phase input

.equ O_POWER = 18
.equ O_GROUND = 1

.equ INIT_PC = (1<<i2c_clk)+(1<<i2c_data)
.equ DIR_PC = (1<<ApFET)+(1<<StatLED)
.equ DIR_PC = (1<<ApFET)+(1<<green_led)

.equ ApFET_port = PORTC

Expand All @@ -58,26 +58,26 @@
.equ CnFET = 5
.equ BnFET = 4
.equ AnFET = 3
.equ WarnLED = 2
.equ red_led = 2
;.equ = 1
;.equ = 0 USART_RX

.equ INIT_PD = 0
.equ DIR_PD = (1<<AnFET)+(1<<BnFET)+(1<<CnFET)+(1<<WarnLED)
.equ DIR_PD = (1<<AnFET)+(1<<BnFET)+(1<<CnFET)+(1<<red_led)

.equ AnFET_port = PORTD
.equ BnFET_port = PORTD
.equ CnFET_port = PORTD

.MACRO RED_on
sbi PORTD, WarnLED
sbi PORTD, red_led
.ENDMACRO
.MACRO RED_off
cbi PORTD, WarnLED
cbi PORTD, red_led
.ENDMACRO
.MACRO GRN_on
sbi PORTC, StatLED
sbi PORTC, green_led
.ENDMACRO
.MACRO GRN_off
cbi PORTC, StatLED
cbi PORTC, green_led
.ENDMACRO
9 changes: 0 additions & 9 deletions arctictiger.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions birdie70a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions bs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,3 @@
.equ DIR_PB = (1<<CnFET)

.equ CnFET_port = PORTB

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions bs40a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,3 @@
.equ DIR_PB = (1<<AnFET)

.equ AnFET_port = PORTB

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions bs_nfet.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,3 @@
.equ DIR_PB = (1<<CnFET)

.equ CnFET_port = PORTB

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
6 changes: 3 additions & 3 deletions diy0.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
; PORT D definitions *
;*********************
.equ red_led = 7
.equ blue_led = 5
.equ green_led = 5
.equ ApFET = 4
.equ io1 = 3
.equ io2 = 2
Expand All @@ -32,10 +32,10 @@
cbi DDRD, red_led
.ENDMACRO
.MACRO GRN_on
sbi DDRD, blue_led
sbi DDRD, green_led
.ENDMACRO
.MACRO GRN_off
cbi DDRD, blue_led
cbi DDRD, green_led
.ENDMACRO

;*********************
Expand Down
9 changes: 0 additions & 9 deletions dlu40a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions dlux.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@
.equ AnFET_port = PORTD
.equ ApFET_port = PORTD

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO

;*********************
; PORT C definitions *
;*********************
Expand Down
9 changes: 0 additions & 9 deletions dys_nfet.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,3 @@
.equ ApFET_port = PORTD
.equ BpFET_port = PORTD
.equ CpFET_port = PORTD

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions hk200a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions hm135a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
4 changes: 0 additions & 4 deletions hxt200a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
.MACRO RED_off
cbi DDRC, red_led
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO

;*********************
; PORT C definitions *
Expand Down
9 changes: 0 additions & 9 deletions kda.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions kda_nfet.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions kda_nfet_ni.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions rb50a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions rb70a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions rct50a.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,3 @@

.equ INIT_PB = 0
.equ DIR_PB = 0

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions tbs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,3 @@
.equ CnFET_port = PORTD
.equ CpFET_port = PORTD
.equ BnFET_port = PORTD

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
9 changes: 0 additions & 9 deletions tbs_hv.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,3 @@
.equ CnFET_port = PORTD
.equ CpFET_port = PORTD
.equ BnFET_port = PORTD

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
23 changes: 23 additions & 0 deletions tgy.asm
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,29 @@ eeprom_defaults_w:
.endif
.endmacro

;-- LED macros -----------------------------------------------------------

.if !defined(red_led)
.macro RED_on
.endmacro
.macro RED_off
.endmacro
.endif

.if !defined(green_led)
.macro GRN_on
.endmacro
.macro GRN_off
.endmacro
.endif

.if !defined(blue_led)
.macro BLUE_on
.endmacro
.macro BLUE_off
.endmacro
.endif

;-- FET driving macros ---------------------------------------------------
; Careful: "if" conditions split over multiple lines (with backslashes)
; work with arva, but avrasm2.exe silently produces wrong results.
Expand Down
9 changes: 0 additions & 9 deletions tgy.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,3 @@
.equ AnFET_port = PORTB
.equ BnFET_port = PORTB
.equ CnFET_port = PORTB
.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
Loading

0 comments on commit 4f1f2b0

Please sign in to comment.