Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pwm_output_set macro output, indfreg, value
- if PWM_BYTES == 1 ; shortcut for 8 outputs
- if value == 0
- BCF pwm_state, output ; just clear the output
- else
- BSF pwm_state, output ; just set the output
- endif ; value == 0
- else
- MOVLW pwm_state ; load pwm_state address into W
- ADDLW output / 8 ; add offset into the array to W
- MOVWF FSR#v(indfreg) ; load W into FSRx
- if value == 0
- BCF INDF#v(indfreg), output & 7 ; clear bit in pwm_state array
- else
- BSF INDF#v(indfreg), output & 7 ; set bit in pwm_state array
- endif ; value == 0
- endif
- endm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement