From: slade_rich Date: Tue, 10 Aug 2004 01:23:04 +0000 (+0000) Subject: Will no longer exit if #pragma maxram has not been defined. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=cec76eccf6ccffcd833c6108053bc2f90d84b842;p=fw%2Fsdcc Will no longer exit if #pragma maxram has not been defined. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3427 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/pic/device.c b/src/pic/device.c index d83c48c4..67b168d3 100644 --- a/src/pic/device.c +++ b/src/pic/device.c @@ -39,8 +39,9 @@ static PIC_device Pics[] = { {"p16f627", "16f627", "pic16f627", "f627"}, /* processor name */ (memRange *)NULL, (memRange *)NULL, - 0, /* max ram address (calculated) */ - 0x80, /* Bank Mask */ + 0, /* max ram address (calculated) */ + 0x1ff, /* default max ram address */ + 0x80, /* Bank Mask */ }, { @@ -48,6 +49,7 @@ static PIC_device Pics[] = { (memRange *)NULL, (memRange *)NULL, 0, + 0x1ff, 0x80, }, @@ -56,6 +58,7 @@ static PIC_device Pics[] = { (memRange *)NULL, (memRange *)NULL, 0, + 0xcf, 0x80, }, @@ -64,6 +67,7 @@ static PIC_device Pics[] = { (memRange *)NULL, (memRange *)NULL, 0, + 0x1ff, 0x180, }, @@ -72,6 +76,7 @@ static PIC_device Pics[] = { (memRange *)NULL, (memRange *)NULL, 0, + 0x1ff, 0x180, }, @@ -80,6 +85,7 @@ static PIC_device Pics[] = { (memRange *)NULL, (memRange *)NULL, 0, + 0x1ff, 0x80, }, @@ -618,3 +624,11 @@ int getConfigWord(int address) return 0; } + +/*-----------------------------------------------------------------* +* +*-----------------------------------------------------------------*/ +void setDefMaxRam(void) +{ + setMaxRAM(pic->defMaxRAMaddrs); // Max RAM has not been included, so use default setting +} diff --git a/src/pic/device.h b/src/pic/device.h index 9b944cf1..d961b339 100644 --- a/src/pic/device.h +++ b/src/pic/device.h @@ -80,6 +80,7 @@ typedef struct PIC_device { memRange *sfr; /* SFR memory map */ int maxRAMaddress; /* maximum value for a data address */ + int defMaxRAMaddrs; /* default maximum value for a data address */ int bankMask; /* Bitmask that is ANDed with address to extract banking bits */ // int hasAliasedRAM:1; /* True if there are bank independent registers */ @@ -99,5 +100,6 @@ int isREGinBank(regs *reg, int bank); int REGallBanks(regs *reg); void addMemRange(memRange *r, int type); void setMaxRAM(int size); +void setDefMaxRam(void); #endif /* __DEVICE_H__ */ diff --git a/src/pic/pcode.c b/src/pic/pcode.c index f8a573ff..db50767e 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -5404,12 +5404,13 @@ void AnalyzeBanking(void) pBlock *pb; if(!picIsInitialized()) { - fprintf(stderr,"Temporary ERROR: at the moment you have to use\n"); - fprintf(stderr,"an include file create by inc2h.pl. See SDCC source:\n"); - fprintf(stderr,"support/scripts/inc2h.pl\n"); - fprintf(stderr,"this is a nuisance bug that will be fixed shortly\n"); +// fprintf(stderr,"Temporary ERROR: at the moment you have to use\n"); +// fprintf(stderr,"an include file create by inc2h.pl. See SDCC source:\n"); +// fprintf(stderr,"support/scripts/inc2h.pl\n"); +// fprintf(stderr,"this is a nuisance bug that will be fixed shortly\n"); - exit(1); +// exit(1); + setDefMaxRam(); // Max RAM has not been included, so use default setting } /* Phase x - Flow Analysis - Used Banks