Subversion Repositories svn.mios

Rev

Rev 52 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
53 tk 1
; $Id: mios_display.inc 53 2008-01-30 22:52:41Z tk $
1 tk 2
;
3
; MIOS Display Handler
4
;
5
; ==========================================================================
6
;
7
;  Copyright 1998-2006 Thorsten Klose (tk@midibox.org)
8
;  Licensed for personal non-commercial use only.
9
;  All other rights reserved.
10
;
11
; ==========================================================================
12
 
13
;; --------------------------------------------------------------------------
14
;;  FUNCTION: USER_DISPLAY_Init
15
;;  C_DECLARATION: void DISPLAY_Init(void)
16
;;  DESCRIPTION: This function is called by MIOS when the display content
17
;;  should be initialized. Thats the case during startup and after a
18
;;  temporary message has been printed on the screen
19
;;  IN:  -
20
;;  C_IN:  -
21
;;  OUT: -
22
;;  C_OUT: -
23
;;  ISR: no
24
;; --------------------------------------------------------------------------
25
 
26
;; --------------------------------------------------------------------------
27
;;  FUNCTION: USER_DISPLAY_Tick
28
;;  C_DECLARATION: void DISPLAY_Tick(void)
29
;;  DESCRIPTION: This function is called by MIOS in the mainloop when no
30
;;  temporary message is shown on the screen.
31
;;  IN:  -
32
;;  C_IN:  -
33
;;  OUT: -
34
;;  C_OUT: -
35
;;  ISR: no
36
;; --------------------------------------------------------------------------
37
 
38
;; --------------------------------------------------------------------------
39
;;  Display Handler: Called from MainLoop
40
;; --------------------------------------------------------------------------
41
MIOS_DISPLAY_Handler
42
	;; leave routine if user tasks have been suspended
43
	btfsc	MIOS_BOX_STAT, MIOS_BOX_STAT_SUSPEND_USER
44
	return
45
 
46
	;; continue if display message counter == 0
47
	SET_BSR	MIOS_MESSAGE_CTR
48
	decf	MIOS_MESSAGE_CTR, W, BANKED
49
	bz	MIOS_DISPLAY_DoInit
50
	movf	MIOS_MESSAGE_CTR, W, BANKED
51
	skpz
52
	return			; leave routine when display counter > 1
53
 
54
	;; call common display routine
55
	goto	USER_DISPLAY_Tick
56
 
57
MIOS_DISPLAY_DoInit
58
	;; clear semaphore
59
	clrf	MIOS_MESSAGE_CTR, BANKED
60
	;; a message was displayed - reinitialize screen
61
	goto	USER_DISPLAY_Init