Daniel1956
Joined: 31 Jan 2019 Posts: 7 Location: Quebec
|
function too big for a ROM page |
Posted: Mon Mar 25, 2019 10:06 pm |
|
|
Hi!
I use a PIC16F1789 with the CCS 5.081 compiler.
in a Windows 10.
I have a big function that I can not compile because the compiler informs me that it is very big to be in a page of the ROM.
This is message:
D:\Bobinneuse\Firmware\bobineuse_V1-21.c:346:1: Error#71 Out of ROM, A segment or the program is too large parametre_bobinage
Seg 01000-017FF, 075B left, need 00949
Seg 01800-01FFF, 0800 left, need 00949
Seg 02000-027FF, 0800 left, need 00949
Seg 02800-02FFF, 0800 left, need 00949
Seg 03000-0339B, 039C left, need 00949
Seg 0339C-037FF, 0000 left, need 00949 Reserved
Seg 03800-03AC1, 02C2 left, need 00949
Seg 03AC2-03FFF, 0000 left, need 00949 Reserved
Seg 00000-00002, 0000 left, need 00949 Reserved
Seg 00003-00003, 0001 left, need 00949
Seg 00004-0003D, 0000 left, need 00949 Reserved
Seg 0003E-007FF, 0006 left, need 00949
Seg 00800-00FFF, 0045 left, need 00949
I know there is the solution to do two smaller functions to do the job but I wonder if there is another solution to this problem?
This is fonction:
int * parametre_bobinage(long *longeur_maximum, int *num_tab_min, int *position_max, short model, short fil, long requis)
{
switch(model)
{
case 1:
if(fil==16)
{
*longeur_maximum = BOBINE_1_16;
*num_tab_min = tableau_16[1];
*position_max = *tableau_16[tableau_16[6]];
return &tableau_16[tableau_16[1]];
}
else
{
*longeur_maximum = BOBINE_1_8;
*num_tab_min = tableau_5[1];
*position_max = *tableau_5[tableau_5[6]];
return &tableau_5[tableau_5[1]];
break;
}
break;
case 2:
if(fil==16)
{
*longeur_maximum = BOBINE_2_16;
*num_tab_min = tableau_16[2];
*position_max = tableau_16[tableau_16[7]];
return &tableau_16[tableau_16[2]];
}
else
{
*longeur_maximum = BOBINE_2_8;
*num_tab_min = tableau_5[2];
*position_max = *tableau_5[tableau_5[7]];
return &tableau_5[tableau_5[2]];
}
break;
case 3:
if(fil==16)
{
*longeur_maximum = BOBINE_3_16;
*num_tab_min = tableau_16[3];
*position_max = tableau_16[tableau_16[8]];
return &tableau_16[tableau_16[3]];
}
else
{
*longeur_maximum = BOBINE_3_8;
*num_tab_min = tableau_5[3];
*position_max = tableau_5[tableau_5[8]];
return &tableau_5[tableau_5[3]];
}
break;
case 4:
if(fil==16)
{
*longeur_maximum = BOBINE_4_16;
*num_tab_min = tableau_16[4];
*position_max = tableau_16[tableau_16[9]];
return &tableau_16[tableau_16[4]];
}
else
{
*longeur_maximum = BOBINE_4_8;
*num_tab_min = tableau_5[4];
*position_max = tableau_5[tableau_5[9]];
return &tableau_5[tableau_5[4]];
}
break;
case 5 || 0:
if(fil==16)
{
*longeur_maximum = BOBINE_5_16;
*num_tab_min = tableau_16[5];
*position_max = tableau_16[tableau_16[10]];
return &tableau_16[tableau_16[5]];
}
else
{
*longeur_maximum = BOBINE_5_8;
*num_tab_min = tableau_5[5];
*position_max = tableau_5[tableau_5[10]];
return &tableau_5[tableau_5[2]];
}
break;
case 6:
if(fil==16)
{
*longeur_maximum = BOBINE_5_16;
*num_tab_min = tableau_16[11];
*position_max = tableau_16[tableau_16[16]];
return &tableau_16[tableau_16[11]];
}
else
{
*longeur_maximum = BOBINE_5_8;
*num_tab_min = tableau_5[11];
*position_max = tableau_5[tableau_5[16]];
return &tableau_5[tableau_5[11]];
}
break;
}
if (*longeur_maximum >= requis)
{
SET_TIMER1(0); // LONGEUR_BOBINE = 0
}
else
{
bobine_requise(requis, *longeur_maximum, model);
key = 1;
}
aff_enroule(requis);
}
Regard,
Daniel
Last edited by Daniel1956 on Tue Mar 26, 2019 7:45 pm; edited 1 time in total |
|