Subversion Repositories Kolibri OS

Rev

Rev 5558 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5558 Rev 6878
Line 75... Line 75...
75
        jne     @f
75
        jne     @f
76
        call    read_gpio0
76
        call    read_gpio0
77
        and     al, not 1               ; Clear bit 0
77
        and     al, not 1               ; Clear bit 0
78
        call    write_gpio0
78
        call    write_gpio0
79
        jmp     event_wait
79
        jmp     event_wait
80
 
80
  @@:
-
 
81
        cmp     ah, 'e'
-
 
82
        jne     @f
-
 
83
        call    read_adc0
-
 
84
        mov     ecx, eax
-
 
85
        mcall   47, 0x00040100,,25 shl 16 + 25, 0x40000000, 0x00ffffff          ; 4 digits hex number in ecx
-
 
86
        jmp     event_wait
81
  @@:
87
  @@:
82
        jmp     event_wait              ; Just read the key, ignore it and jump to event_wait.
88
        jmp     event_wait              ; Just read the key, ignore it and jump to event_wait.
Line 83... Line 89...
83
 
89
 
84
button:                                 ; Buttonpress event handler
90
button:                                 ; Buttonpress event handler
Line 148... Line 154...
148
        mov     [IOCTL.io_code], 2
154
        mov     [IOCTL.io_code], 2
149
        mov     [IOCTL.input], eax
155
        mov     [IOCTL.input], eax
150
        mcall   68, 17, IOCTL
156
        mcall   68, 17, IOCTL
151
        ret
157
        ret
Line -... Line 158...
-
 
158
 
-
 
159
; Read ADC0
-
 
160
read_adc0:
-
 
161
        mov     [IOCTL.io_code], 3
-
 
162
        mcall   68, 17, IOCTL
-
 
163
        ret
152
 
164
 
153
;  *********************************************
165
;  *********************************************
154
;  *************   DATA AREA   *****************
166
;  *************   DATA AREA   *****************
155
;  *********************************************
167
;  *********************************************
156
;
168
;
157
; Data can be freely mixed with code to any parts of the image.
169
; Data can be freely mixed with code to any parts of the image.
Line 158... Line 170...
158
; Only the header information is required at the beginning of the image.
170
; Only the header information is required at the beginning of the image.
159
 
171
 
160
text    db  "This is an 86DUINO GPIO demo program    "
172
text    db  "This is an 86DUINO GPIO demo program    "
-
 
173
        db  "                                        "
Line 161... Line 174...
161
        db  "                                        "
174
        db  "press q/w to toggle GPIO 0 pin 0        "
Line 162... Line 175...
162
        db  "press q/w to toggle GPIO 0 pin 0        ", 0
175
        db  "or e to read ADC0 channel               ", 0