Mercurial > public > hwos_code
comparison src/options.asm @ 185:f515712d8cd6
BUGFIX: Check min and max values after PC configuration properly
author | heinrichsweikamp |
---|---|
date | Sat, 18 Oct 2014 10:03:28 +0200 |
parents | be997abd1f73 |
children | effd7259f5a5 |
comparison
equal
deleted
inserted
replaced
184:faa06c58e977 | 185:f515712d8cd6 |
---|---|
173 bz option_check_enum8 ; ENUM8: Check if lower then max. value only | 173 bz option_check_enum8 ; ENUM8: Check if lower then max. value only |
174 | 174 |
175 movf opt_min,W | 175 movf opt_min,W |
176 cpfsgt INDF1 ; bigger then opt_min? | 176 cpfsgt INDF1 ; bigger then opt_min? |
177 bra option_check_reset ; No, reset option | 177 bra option_check_reset ; No, reset option |
178 movf INDF1,W | 178 option_check_enum8: ; ENUM8: Check max only |
179 cpfsgt opt_max ; bigger then INDF1? | 179 incf opt_max,W |
180 cpfslt INDF1 ; smaller then opt_max+1? | |
180 bra option_check_reset ; No, reset option | 181 bra option_check_reset ; No, reset option |
181 return ; in range, return | 182 return ; in range, return |
182 | 183 |
183 option_check_reset: | 184 option_check_reset: |
184 movff opt_default,INDF1 ; reset option to default | 185 movff opt_default,INDF1 ; reset option to default |
185 return ; Done. | 186 return ; Done. |
186 | 187 |
187 option_check_string: | 188 option_check_string: |
188 return | 189 return |
189 | |
190 option_check_enum8: | |
191 movf INDF1,W | |
192 cpfsgt opt_max ; bigger then INDF1? | |
193 bra option_check_reset ; No, reset option | |
194 return ; in range, return | |
195 | 190 |
196 ;============================================================================= | 191 ;============================================================================= |
197 ; Reset an option to its default value. | 192 ; Reset an option to its default value. |
198 ; INPUT: FSR0 = option handle | 193 ; INPUT: FSR0 = option handle |
199 ; OUTPUT: none | 194 ; OUTPUT: none |