]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Added meaningful error message
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 23 Feb 2009 07:51:26 +0000 (08:51 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Tue, 16 Nov 2010 15:54:52 +0000 (16:54 +0100)
arch/h8300/generic/libs/boot/boot_fn.c
arch/h8300/generic/libs/boot/boot_fn.h

index 71507f1c9c320c90f13f02628cc753e66fc434cd..c76eceddc4e10bbd67b96256331a38210f0f84f0 100644 (file)
@@ -308,7 +308,7 @@ int FlPrepBlk(unsigned long badr, unsigned long len)
   int bl, blend, res;
   bl=FlAdr2Blk(badr);
   blend=FlAdr2Blk(badr+len-1);
-  if((bl<0)||(blend<0)) return -8;
+  if((bl<0)||(blend<0)) return -EBOOT_BLOCKADDR;
   for(;bl<=blend;bl++){
     if(FlTest(bl)){
       res=FlErase(bl);
index 1f1949d02ded0869554d648430e42c755068f4f7..2d8c616db30cc67496411006b805797a9978c63a 100644 (file)
@@ -1,8 +1,13 @@
 #ifndef _boot_fn_H
 #define _boot_fn_H
 
+#include <types.h>
+
 #define FLASH_ROW 128
 
+/* Error codes (returned as negative numbers) */
+#define EBOOT_BLOCKADDR                8
+
 volatile void FlWait(long n);
 void wdg_enable(int psel);
 void wdg_disable();