Mercurial > public > hwos_code
comparison src/options.asm @ 110:d39493c786a2
BUGFIX: OSTC settings via USB issues
author | heinrichsweikamp |
---|---|
date | Tue, 10 Jun 2014 10:14:18 +0200 |
parents | 223579e905c3 |
children | f3062a611eef |
comparison
equal
deleted
inserted
replaced
109:1aeb01c0e4ff | 110:d39493c786a2 |
---|---|
168 ; Switch on type | 168 ; Switch on type |
169 movf opt_type,W ; Type == STRING ? | 169 movf opt_type,W ; Type == STRING ? |
170 xorlw 2 | 170 xorlw 2 |
171 bz option_check_string ; String: Do not reset strings | 171 bz option_check_string ; String: Do not reset strings |
172 | 172 |
173 movf opt_type,W ; Type == ENUM8 ? | |
174 xorlw 1 | |
175 bz option_check_enum8 ; ENUM8: Check if lower then max. value only | |
176 | |
173 movf opt_min,W | 177 movf opt_min,W |
174 cpfsgt INDF1 ; bigger then opt_min? | 178 cpfsgt INDF1 ; bigger then opt_min? |
175 bra option_check_reset ; No, reset option | 179 bra option_check_reset ; No, reset option |
176 movf INDF1,W | 180 movf INDF1,W |
177 cpfsgt opt_max ; bigger then INDF1? | 181 cpfsgt opt_max ; bigger then INDF1? |
182 movff opt_default,INDF1 ; reset option to default | 186 movff opt_default,INDF1 ; reset option to default |
183 return ; Done. | 187 return ; Done. |
184 | 188 |
185 option_check_string: | 189 option_check_string: |
186 return | 190 return |
191 | |
192 option_check_enum8: | |
193 movf INDF1,W | |
194 cpfsgt opt_max ; bigger then INDF1? | |
195 bra option_check_reset ; No, reset option | |
196 return ; in range, return | |
187 | 197 |
188 ;============================================================================= | 198 ;============================================================================= |
189 ; Reset an option to its default value. | 199 ; Reset an option to its default value. |
190 ; INPUT: FSR0 = option handle | 200 ; INPUT: FSR0 = option handle |
191 ; OUTPUT: none | 201 ; OUTPUT: none |