Thanks Semi...,
Ellipsis is very nice point.
I don't know sound knowledge about PIC stakes.
I must learn it.
Thanks for helping
HI-TECH C "can't generate code for this expression" Error.
Re: HI-TECH C "can't generate code for this expression" Error.
I do still see the same issue in the file.
Your function prototype is,
This should be changed to,
And on the function definition, it should be as follows,
I didn't look at the timer interrupt setting in to detail, but calling the display routine so fast from an interrupt routine is just bad practice. It is enough to update the display 60 times a second (Even 25 or 10 would be ok). Human eyes can't go faster than that.
Stack overflows normally appear when you run the program. When you call the display routine within an interrupt, in a re-entrant situation, this function would be call over an over which leads to a stack overflow. So as mentioned earlier, it is advisable not to call heavy functions within hardware interrupt. I mentioned a method before, so not going to repeat that.
Tab indents are wrong which is not nice in programming. For example, the switch block must be tabbed by 1 and there should be a blank line after the function definition as below. Also, nice to have a little comment to mention what it does.
Your function prototype is,
Code: Select all
void Display();
Code: Select all
void Display(int, int);
Code: Select all
void Display(int d0, int d1){
Stack overflows normally appear when you run the program. When you call the display routine within an interrupt, in a re-entrant situation, this function would be call over an over which leads to a stack overflow. So as mentioned earlier, it is advisable not to call heavy functions within hardware interrupt. I mentioned a method before, so not going to repeat that.
Tab indents are wrong which is not nice in programming. For example, the switch block must be tabbed by 1 and there should be a blank line after the function definition as below. Also, nice to have a little comment to mention what it does.
Code: Select all
// This function do this
int DWOP(int n){//DROBOT.LK PNT ENA
switch(n){
case 0:
return 0xC0;
case 1:
return 0xF9;
case 2:
return 0xA4;
case 3:
return 0xB0;
case 4:
return 0x99;
case 5:
return 0x92;
case 6:
return 0x82;
case 7:
return 0xF8;
case 8:
return 0x80;
case 9:
return 0x90;
default:
return 0xBF;
}
}