File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,11 @@ static int pic32_write_dqword_aligned(uint32_t addr, const uint32_t *data)
186186 pic32_fcw_wait_complete ();
187187 err = pic32_get_errs ();
188188 pic32_last_err = err ;
189- err &= ~FCW_INTFLAG_DONE_BIT ;
189+ if (!(err & FCW_INTFLAG_DONE_BIT )) {
190+ err = -1 ;
191+ } else {
192+ err &= ~FCW_INTFLAG_DONE_BIT ;
193+ }
190194 pic32_clear_errs ();
191195 return err ;
192196}
@@ -210,9 +214,13 @@ static int pic32_fcw_erase_sector(uint32_t addr)
210214 pic32_fcw_start_op (FCW_OP_ERASE_SECTOR );
211215 pic32_fcw_wait_complete ();
212216 err = pic32_get_errs ();
213- pic32_clear_errs ();
214217 pic32_last_err = err ;
215- err &= ~FCW_INTFLAG_DONE_BIT ;
218+ if (!(err & FCW_INTFLAG_DONE_BIT )) {
219+ err = -1 ;
220+ } else {
221+ err &= ~FCW_INTFLAG_DONE_BIT ;
222+ }
223+ pic32_clear_errs ();
216224 return err ;
217225}
218226
You can’t perform that action at this time.
0 commit comments