comparison code_part1/OSTC_code_asm_part1/definitions.asm @ 681:6e456a6398e0

Hardware4 support
author heinrichsweikamp
date Fri, 25 Jan 2013 18:00:49 +0100
parents 3c0af4480866
children 839eac136bd8
comparison
equal deleted inserted replaced
680:c6220d340684 681:6e456a6398e0
136 global win_height, win_width, win_bargraph 136 global win_height, win_width, win_bargraph
137 137
138 letter res .26 ;letter buffer 138 letter res .26 ;letter buffer
139 win_color1 res 1 139 win_color1 res 1
140 win_color2 res 1 140 win_color2 res 1
141 win_color3 res 1
141 win_top res 1 ; Box/text position (0..239). 142 win_top res 1 ; Box/text position (0..239).
142 win_height res 1 ; Box/text height (1..240) 143 win_height res 1 ; Box/text height (1..240)
143 win_leftx2 res 1 ; Box/text position (0..159) 144 win_leftx2 res 1 ; Box/text position (0..159)
144 win_width res 1 ; box width (1..160) 145 win_width res 1 ; box width (1..160)
145 win_font res 1 146 win_font res 1
146 win_invert res 1 147 win_invert res 1
147 win_bargraph res 1 ; PLED_box swicth to black after this position (0..159). 148 win_bargraph res 1 ; DISP_box swicth to black after this position (0..159).
148 win_flags res 1 ; flip_screen flag, transparent fonts, etc... 149 win_flags res 1 ; flip_screen flag, transparent fonts, etc...
149 150
150 pressureSum res 2 ; Stabilize surface presure by a long averaging window [mbar] 151 pressureSum res 2 ; Stabilize surface presure by a long averaging window [mbar]
151 pressureCount res 1 ; Count of pressure values. 152 pressureCount res 1 ; Count of pressure values.
152 pressureAvg res 2 ; save averaged pressure x16, for altimeter_menu 153 pressureAvg res 2 ; save averaged pressure x16, for altimeter_menu
194 flag11 res 1 195 flag11 res 1
195 flag12 res 1 196 flag12 res 1
196 flag13 res 1 197 flag13 res 1
197 flag14 res 1 198 flag14 res 1
198 flag15 res 1 199 flag15 res 1
199 200 flag16 res 1
200 oled1_temp res 1 ; Temp variables for display output 201
201 oled2_temp res 1 202 DISPLAY1_temp res 1 ; Temp variables for display output
202 oled3_temp res 1 203 DISPLAY2_temp res 1
203 oled4_temp res 1 ; Used in "Displaytext" 204 DISPLAY3_temp res 1
205 DISPLAY4_temp res 1 ; Used in "Displaytext"
204 206
205 global hi,lo ; Make them visible from C-code 207 global hi,lo ; Make them visible from C-code
206 lo res 1 ; bin to dec conversion routine 208 lo res 1 ; bin to dec conversion routine
207 hi res 1 209 hi res 1
208 lo_temp res 1 210 lo_temp res 1
339 apnoe_timeout_counter res 1 ; counts minutes for apnoe timeout 341 apnoe_timeout_counter res 1 ; counts minutes for apnoe timeout
340 apnoe_surface_mins res 1 ; Surface interval mins for Apnoe mode 342 apnoe_surface_mins res 1 ; Surface interval mins for Apnoe mode
341 apnoe_surface_secs res 1 ; Surface interval secs for Apnoe mode 343 apnoe_surface_secs res 1 ; Surface interval secs for Apnoe mode
342 customfunction_temp1 res 1 ; used in GETCUSTOM8 and GETCUSTOM15 344 customfunction_temp1 res 1 ; used in GETCUSTOM8 and GETCUSTOM15
343 345
344 decoplan_page res 1 ; used in PLED_MultiGF,... 346 decoplan_page res 1 ; used in DISP_MultiGF,...
345 temp10 res 2 ; used in customview 347 temp10 res 2 ; used in customview
346 348
347 fatal_error_code res 1 ; holds error code value 349 fatal_error_code res 1 ; holds error code value
348 350
349 convert_value_temp res 3 ; used in menu_battery_state_convert_date 351 convert_value_temp res 3 ; used in menu_battery_state_convert_date
368 370
369 movlw low(tag) 371 movlw low(tag)
370 movff WREG,temp10+0 372 movff WREG,temp10+0
371 movlw high(tag) 373 movlw high(tag)
372 movff WREG,temp10+1 374 movff WREG,temp10+1
373 call PLED_resetdebugger 375 call DISP_resetdebugger
374 @end: 376 @end:
375 Endif 377 Endif
376 ENDM 378 ENDM
377 ;============================================================================= 379 ;=============================================================================
378 ; C-code Routines 380 ; C-code Routines
395 397
396 ;============================================================================= 398 ;=============================================================================
397 ;I/O Ports (I=Input, O=Output) 399 ;I/O Ports (I=Input, O=Output)
398 ; 400 ;
399 #DEFINE sensor_SDO PORTA,1 ;O 401 #DEFINE sensor_SDO PORTA,1 ;O
400 #DEFINE oled_rw PORTA,2 ;0 402 #DEFINE DISPLAY_rw PORTA,2 ;0
401 #DEFINE oled_hv PORTA,3 ;O 403 #DEFINE DISPLAY_hv PORTA,3 ;O
402 #DEFINE sensor_SDI PORTA,4 ;I 404 #DEFINE sensor_SDI PORTA,4 ;I
403 #DEFINE oled_cs PORTA,5 ;O 405 #DEFINE DISPLAY_cs PORTA,5 ;O
404 #DEFINE sensor_CLK PORTA,7 ;O 406 #DEFINE sensor_CLK PORTA,7 ;O
405 407
406 #DEFINE SWITCH2 PORTB,0 ;I (Right) 408 #DEFINE SWITCH2 PORTB,0 ;I (Right)
407 #DEFINE SWITCH1 PORTB,1 ;I (Left) 409 #DEFINE SWITCH1 PORTB,1 ;I (Left)
408 #DEFINE oled_vdd PORTB,2 ;O 410 #DEFINE DISPLAY_vdd PORTB,2 ;O
409 #DEFINE LED_blue PORTB,3 ;0 411 #DEFINE LED_blue PORTB,3 ;0
410 #DEFINE LED_red PORTB,4 ;O 412 #DEFINE LED_red PORTB,4 ;O
411 413
412 #DEFINE CHRG_OUT PORTC,1 ;O 414 #DEFINE CHRG_OUT PORTC,1 ;O
413 #DEFINE CHRG_IN PORTC,2 ;I 415 #DEFINE CHRG_IN PORTC,2 ;I
414 416
415 #DEFINE oled_d1 PORTD,0 ;O 417 #DEFINE DISPLAY_d1 PORTD,0 ;O
416 #DEFINE oled_d2 PORTD,1 ;O 418 #DEFINE DISPLAY_d2 PORTD,1 ;O
417 #DEFINE oled_d3 PORTD,2 ;O 419 #DEFINE DISPLAY_d3 PORTD,2 ;O
418 #DEFINE oled_d4 PORTD,3 ;O 420 #DEFINE DISPLAY_d4 PORTD,3 ;O
419 #DEFINE oled_d5 PORTD,4 ;O 421 #DEFINE DISPLAY_d5 PORTD,4 ;O
420 #DEFINE oled_d6 PORTD,5 ;O 422 #DEFINE DISPLAY_d6 PORTD,5 ;O
421 #DEFINE oled_d7 PORTD,6 ;O 423 #DEFINE DISPLAY_d7 PORTD,6 ;O
422 #DEFINE oled_d8 PORTD,7 ;O 424 #DEFINE DISPLAY_d8 PORTD,7 ;O
423 425
424 #DEFINE oled_rs PORTE,0 ;0 426 #DEFINE DISPLAY_rs PORTE,0 ;0
425 #DEFINE oled_nreset PORTE,1 ;0 427 #DEFINE DISPLAY_nreset PORTE,1 ;0
426 #DEFINE oled_e_nwr PORTE,2 ;0 428 #DEFINE DISPLAY_e_nwr PORTE,2 ;0
427 429
428 ; Bank0 flags 430 ; Bank0 flags
429 #DEFINE win_flip_screen win_flags,0 ; 180° rotation of the OLED screen. 431 #DEFINE win_flip_screen win_flags,0 ; 180° rotation of the DISPLAY screen.
432 #DEFINE win_display_type win_flags,1 ; =1: Display1, =0: Display0
430 433
431 ; Flags 434 ; Flags
432 #DEFINE tts_extra_time flag1,0 ; Showing "Future TTS" customview 435 #DEFINE tts_extra_time flag1,0 ; Showing "Future TTS" customview
433 #DEFINE uart_dump_screen flag1,1 ; Screen copy to USB. 436 #DEFINE uart_dump_screen flag1,1 ; Screen copy to USB.
434 #DEFINE pre_zero_flag flag1,2 ; leading zeros 437 #DEFINE pre_zero_flag flag1,2 ; leading zeros
468 #DEFINE second_FD flag4,7 ; 2nd 0xFD in EEPROM found 471 #DEFINE second_FD flag4,7 ; 2nd 0xFD in EEPROM found
469 #DEFINE second_FA flag4,7 ; 2nd 0xFA in EEPROM found 472 #DEFINE second_FA flag4,7 ; 2nd 0xFA in EEPROM found
470 473
471 #DEfINE timeout_display flag5,0 ; =1: The divemode timeout is displayed 474 #DEfINE timeout_display flag5,0 ; =1: The divemode timeout is displayed
472 #DEFINE eeprom_blockwrite flag5,1 ; EEPROM blockwrite active 475 #DEFINE eeprom_blockwrite flag5,1 ; EEPROM blockwrite active
473 #DEFINE oled_brightness_high flag5,2 ; =1: High brightness, =0: Eco mode 476 #DEFINE DISPLAY_brightness_high flag5,2 ; =1: High brightness, =0: Eco mode
474 #DEFINE low_battery_state flag5,3 ;=1 if battery low 477 #DEFINE low_battery_state flag5,3 ;=1 if battery low
475 #DEFINE DP_done flag5,4 ; valconv 478 #DEFINE DP_done flag5,4 ; valconv
476 #DEFINE DP_done2 flag5,5 ; valconv 479 #DEFINE DP_done2 flag5,5 ; valconv
477 #DEFINE pressure_refresh flag5,6 ; Pressure and temperature refreshed 480 #DEFINE pressure_refresh flag5,6 ; Pressure and temperature refreshed
478 #DEFINE no_sensor_int flag5,7 ; block any further access to pressure sensor 481 #DEFINE no_sensor_int flag5,7 ; block any further access to pressure sensor
542 545
543 #DEFINE internal_eeprom_write2 flag13,0 ;=1: start routine to access internal EEPROM BANK 1 via the UART 546 #DEFINE internal_eeprom_write2 flag13,0 ;=1: start routine to access internal EEPROM BANK 1 via the UART
544 #DEFINE button_delay_done flag13,1 ;=1: Button was pressed for more then 500ms, start counting 547 #DEFINE button_delay_done flag13,1 ;=1: Button was pressed for more then 500ms, start counting
545 #DEFINE display_set_active flag13,2 ;=1: De/Activate gases underwater menu is visible 548 #DEFINE display_set_active flag13,2 ;=1: De/Activate gases underwater menu is visible
546 #DEFINE deco_mode_changed flag13,3 ;=1: The Decomode was changes, show decomode description! 549 #DEFINE deco_mode_changed flag13,3 ;=1: The Decomode was changes, show decomode description!
547 #DEFINE pled_velocity_display flag13,4 ;=1: Velocity is displayed 550 #DEFINE DISP_velocity_display flag13,4 ;=1: Velocity is displayed
548 #DEFINE depth_greater_100m flag13,5 ;=1: Depth is greater then 100m 551 #DEFINE depth_greater_100m flag13,5 ;=1: Depth is greater then 100m
549 #DEFINE display_set_setpoint flag13,6 ;=1: SetPoint list active 552 #DEFINE display_set_setpoint flag13,6 ;=1: SetPoint list active
550 #DEFINE toggle_customview flag13,7 ;=1: Next customview 553 #DEFINE toggle_customview flag13,7 ;=1: Next customview
551 554
552 #DEFINE enter_error_sleep flag14,0 ;=1: Sleep immediately displaying the error using LED codes 555 #DEFINE enter_error_sleep flag14,0 ;=1: Sleep immediately displaying the error using LED codes