diff --git a/tgy.asm b/tgy.asm index 77a888c..a7e27eb 100644 --- a/tgy.asm +++ b/tgy.asm @@ -201,9 +201,10 @@ ; These are now defaults which can be adjusted via throttle calibration ; (stick high, stick low, (stick neutral) at start). ; These might be a bit wide for most radios, but lines up with POWER_RANGE. +.equ RC_PULS_DIVIDER = 8 .equ STOP_RC_PULS = 1060 ; Stop motor at or below this pulse length .equ FULL_RC_PULS = 1860 ; Full speed at or above this pulse length -.equ MAX_RC_PULS = 2400 ; Throw away any pulses longer than this +.equ MAX_RC_PULS = 2400 / RC_PULS_DIVIDER ; Throw away any pulses longer than this .equ MIN_RC_PULS = 100 ; Throw away any pulses shorter than this .equ MID_RC_PULS = (STOP_RC_PULS + FULL_RC_PULS) / 2 ; Neutral when RC_PULS_REVERSE = 1 @@ -451,9 +452,9 @@ eeprom_end: .byte 1 eeprom_defaults_w: .db low(EEPROM_SIGN), high(EEPROM_SIGN) - .db byte1(FULL_RC_PULS * CPU_MHZ), byte2(FULL_RC_PULS * CPU_MHZ) - .db byte1(STOP_RC_PULS * CPU_MHZ), byte2(STOP_RC_PULS * CPU_MHZ) - .db byte1(MID_RC_PULS * CPU_MHZ), byte2(MID_RC_PULS * CPU_MHZ) + .db byte1(FULL_RC_PULS * CPU_MHZ / RC_PULS_DIVIDER), byte2(FULL_RC_PULS * CPU_MHZ / RC_PULS_DIVIDER) + .db byte1(STOP_RC_PULS * CPU_MHZ / RC_PULS_DIVIDER), byte2(STOP_RC_PULS * CPU_MHZ / RC_PULS_DIVIDER) + .db byte1(MID_RC_PULS * CPU_MHZ / RC_PULS_DIVIDER), byte2(MID_RC_PULS * CPU_MHZ / RC_PULS_DIVIDER) .if USE_I2C .equ BL_REVISION = 2 .db BL_REVISION, 144 ; Revision, SetMask -- Settings mask should encode MOTOR_REVERSE bit