Skip to content
Snippets Groups Projects
Commit d1782a3d authored by Jedian's avatar Jedian
Browse files

Starting enbeautylizing


Signed-off-by: default avatarJedian <jmb15@c3sl.ufpr.br>
parent 3f25a0d9
No related branches found
No related tags found
No related merge requests found
0
00000001
00000002
fffff
1
2
3
ffffff
4
5
6
......
......@@ -101,6 +101,8 @@ int hex2int (int tam, char *hex) {
if(hex[i] < 0)
hex[i]=0;
ans += hex[i] * pow16(tam-(i+1));
if(ans > 46)
return -1;
}
return ans;
}
......@@ -129,8 +131,8 @@ int int2hex (char *c, int i) {
int main(void) { // receive a string through the UART serial interface
int i, j;
volatile int state;
int i, j; // and responds with the i-eth hex-based fibonacci sequence number
volatile int state = 0;
volatile Tstatus status;
char filona[145], c;
int hdona = 0;
......@@ -143,11 +145,11 @@ int main(void) { // receive a string through the UART serial interface
uart = (void *)IO_UART_ADDR; // bottom of UART address range
i = -1;
ioctl(ctrl_util(2, 1, 1, 1));
Ud.ntx = 16;
ioctl(ctrl_util(2, 1, 1, 1)); // Speed = 2, intRX = 1, intTX = 1, rts = 1
do {
state = i = i+1;
state++;
// se tirar fode (b520 vira 15)
while(!proberx()) to_stdout('-');//i = 1 - i;
//to_stdout('\0');
......@@ -155,7 +157,8 @@ int main(void) { // receive a string through the UART serial interface
while((c=Getc()) != -1){
filona[tlona] = c;
// se tirar fode (b520 vira 15)
to_stdout('*');
//to_stdout('*');
// cmips_delay(1);
//to_stdout('\0');
// es
tlona++;
......@@ -168,6 +171,7 @@ int main(void) { // receive a string through the UART serial interface
while(filonx > 0){
qt = Strlen(filona+hdona);
valfib = hex2int(qt, (filona+hdona));
if(valfib != -1)
valfib = buf[valfib];
hdona += qt+1;
hdona %= 145;
......@@ -190,13 +194,11 @@ int main(void) { // receive a string through the UART serial interface
} while (p[j] != 0);
filonx--;
if(!filonx)
return state;
}
if(filonx == 0 && !fim)
fim = 1;
else if (filonx == 0 && fim)
return state+i;
} while (i<20);
} while (state);
return(state+i);
return state;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment