Browse Source

refactor: Simplify pwm polarity setup

Changes DT=0 on some layouts
main
Mathias Rasmussen 4 years ago
parent
commit
21d5351ad6
  1. 9
      targets/A.inc
  2. 13
      targets/B.inc
  3. 7
      targets/Base.inc
  4. 9
      targets/C.inc
  5. 11
      targets/D.inc
  6. 9
      targets/E.inc
  7. 9
      targets/F.inc
  8. 9
      targets/G.inc
  9. 13
      targets/H.inc
  10. 9
      targets/I.inc
  11. 9
      targets/J.inc
  12. 11
      targets/K.inc
  13. 9
      targets/L.inc
  14. 9
      targets/M.inc
  15. 13
      targets/N.inc
  16. 11
      targets/O.inc
  17. 9
      targets/P.inc
  18. 9
      targets/Q.inc
  19. 9
      targets/R.inc
  20. 13
      targets/S.inc
  21. 13
      targets/T.inc
  22. 9
      targets/U.inc
  23. 13
      targets/V.inc
  24. 15
      targets/Z.inc

9
targets/A.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

13
targets/B.inc

@ -54,18 +54,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
IF FETON_DELAY == 0
mov PCA0POL, #00h ; Pwm noninverted
ELSE
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

7
targets/Base.inc

@ -29,6 +29,13 @@ cON LIT 'clr'
cOFF LIT 'setb'
ENDIF
Set_Pwm_Polarity MACRO
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1 - PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF COMP_PORT == 0
CMP_CN0 EQU CMP0CN0

9
targets/C.inc

@ -55,14 +55,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

11
targets/D.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 0
Set_Pwm_Polarity MACRO
;mov PCA0POL, #00h ; Damping noninverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
; Damping noninverted, pwm noninverted
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/E.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/F.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/G.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

13
targets/H.inc

@ -54,18 +54,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
IF FETON_DELAY == 0
mov PCA0POL, #00h ; Pwm noninverted
ELSE
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/I.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/J.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

11
targets/K.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 0
Set_Pwm_Polarity MACRO
;mov PCA0POL, #00h ; Damping noninverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
; Damping noninverted, pwm noninverted
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/L.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/M.inc

@ -54,14 +54,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

13
targets/N.inc

@ -54,18 +54,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
IF FETON_DELAY == 0
mov PCA0POL, #00h ; Pwm noninverted
ELSE
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

11
targets/O.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 0
Set_Pwm_Polarity MACRO
; mov PCA0POL, #00h ; Damping noninverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
; Damping noninverted, pwm noninverted
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/P.inc

@ -54,14 +54,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/Q.inc

@ -55,14 +55,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/R.inc

@ -53,14 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

13
targets/S.inc

@ -53,17 +53,8 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
IF FETON_DELAY == 0
mov PCA0POL, #00h ; Pwm noninverted
ELSE
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

13
targets/T.inc

@ -54,18 +54,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
IF FETON_DELAY == 0
mov PCA0POL, #00h ; Pwm noninverted
ELSE
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

9
targets/U.inc

@ -54,14 +54,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

13
targets/V.inc

@ -55,18 +55,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 1
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
IF FETON_DELAY == 0
mov PCA0POL, #00h ; Pwm noninverted
ELSE
; Damping inverted, pwm noninverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDIF
ENDM
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

15
targets/Z.inc

@ -53,18 +53,9 @@ P0_SKIP EQU 0FFh
PWM_ACTIVE_HIGH EQU 0
COMPWM_ACTIVE_HIGH EQU 1
Set_Pwm_Polarity MACRO
IF FETON_DELAY == 0
mov PCA0POL, #02h ; Pwm inverted
ELSE
; mov PCA0POL, #03h ; Damping inverted, pwm inverted
IF PCA0_POWER_MODULE == PCA0CPM0
mov PCA0POL, #((COMPWM_ACTIVE_HIGH SHL 1) + (1 - PWM_ACTIVE_HIGH))
ELSE
mov PCA0POL, #(((1-PWM_ACTIVE_HIGH) SHL 1) + COMPWM_ACTIVE_HIGH)
ENDIF
ENDIF
ENDM
; Damping inverted, pwm inverted
IF FETON_DELAY == 0
PCA0_POWER_MODULE EQU PCA0CPM0

Loading…
Cancel
Save