Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/surfmode.asm @ 486:c7b663939737
making waitms speed-independent, desat-time fix
author | heinrichsweikamp |
---|---|
date | Sat, 15 Oct 2011 15:03:53 +0200 |
parents | 8e1fb9cdd62a |
children | a5235ae970af |
comparison
equal
deleted
inserted
replaced
485:e83f883c96b2 | 486:c7b663939737 |
---|---|
235 call nofly_timeout60 ; checks if nofly time is > 0 | 235 call nofly_timeout60 ; checks if nofly time is > 0 |
236 bcf oneminupdate | 236 bcf oneminupdate |
237 return | 237 return |
238 | 238 |
239 nofly_timeout60: | 239 nofly_timeout60: |
240 movf desaturation_time_buffer+0,W; Is Desat null ? | |
241 iorwf desaturation_time_buffer+1,W | |
242 rcall nofly_timeout60_0 ; No... | |
243 | |
240 movf nofly_time+0,W ; Is nofly null ? | 244 movf nofly_time+0,W ; Is nofly null ? |
241 iorwf nofly_time+1,W | 245 iorwf nofly_time+1,W |
242 bnz nofly_timeout60_1 ; No... | 246 bnz nofly_timeout60_1 ; No... |
243 | 247 |
244 bcf nofly_active ; Clear flag | 248 bcf nofly_active ; Clear flag |
245 bcf LED_blue ; Clear led. | 249 bcf LED_blue ; Clear led. |
250 return | |
251 | |
252 nofly_timeout60_0: | |
253 movlw d'1' | |
254 subwf desaturation_time_buffer+0,F | |
255 movlw d'0' | |
256 subwfb desaturation_time_buffer+1,F ; reduce by one | |
246 return | 257 return |
247 | 258 |
248 nofly_timeout60_1: | 259 nofly_timeout60_1: |
249 bsf nofly_active ; Set flag | 260 bsf nofly_active ; Set flag |
250 movlw d'1' | 261 movlw d'1' |
296 movff WREG,char_I_desaturation_multiplier | 307 movff WREG,char_I_desaturation_multiplier |
297 | 308 |
298 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode | 309 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode |
299 movlb b'00000001' ; select ram bank 1 | 310 movlb b'00000001' ; select ram bank 1 |
300 ostc_debug 'J' ; Sends debug-information to screen if debugmode active | 311 ostc_debug 'J' ; Sends debug-information to screen if debugmode active |
301 | |
302 movff int_O_desaturation_time+0,desaturation_time_buffer+0 | |
303 movff int_O_desaturation_time+1,desaturation_time_buffer+1 | |
304 | |
305 return | 312 return |
306 | 313 |
307 ;============================================================================= | 314 ;============================================================================= |
308 | 315 |
309 test_charger: | 316 test_charger: |
404 movff temp2,EEDATA | 411 movff temp2,EEDATA |
405 write_int_eeprom d'51' ; write byte stored in EEDATA | 412 write_int_eeprom d'51' ; write byte stored in EEDATA |
406 return | 413 return |
407 | 414 |
408 show_cv_active: ; CV mode | 415 show_cv_active: ; CV mode |
409 ; Enable only when USB power attached | 416 ; Enable RS232 only when USB power attached |
410 btfss RCSTA,7 ; RS232 already enabled? | 417 btfss RCSTA,7 ; RS232 already enabled? |
411 call enable_rs232 ; No, start UART module | 418 call enable_rs232 ; No, start UART module |
412 bsf LED_red | 419 bsf LED_red |
413 WAITMS d'100' | 420 WAITMS d'100' |
414 bcf LED_red | 421 bcf LED_red |