Manprocoder
New Contributor
2 years agoPRINTF FUNCTION ERROR
#include <stdio.h>
#include "system.h"
#include "io.h"
int main(){
//result variable
int ready = 0, crc_seq=0;
//declare pointer
int *base = (int*) CRC_0_BASE;
//Generator Poly 0xd5
int genPoly = 213 & 0xff;
//0x0a55, 0x0a56, 0x0a57, 0x0a58, 0x0a59
int data[5] = {2645, 2646, 2647, 2648, 2649};
//write genPoly down to design
*(base) = genPoly;
for(int i=0; i < 5; i++){
ready = *(base+3)&0x1;
printf("\nHello Nios II!");
if(ready ==1){
*(base+1) = data[i]&0xffff; //0x0a55
crc_seq = *(base+2);
printf("\ncrc_seq = %d", crc_seq);
//decimalToBinary(crc_seq);
}else{
printf("\ncrc calculator is busy");
}
}
return 0;
}
My issue: i do not see any contents of printf function in this code. Please help me. Thanks.
My issue: i do not see any contents of printf function in this code. Please help me. Thanks.