diff --git a/project/Core/Src/modbus-tcp.c b/project/Core/Src/modbus-tcp.c index b32bde2..ea4d1f0 100644 --- a/project/Core/Src/modbus-tcp.c +++ b/project/Core/Src/modbus-tcp.c @@ -8,8 +8,11 @@ char registers[MAX_REG]; static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err){ int i; + int j; int len; char *pc; + char *textstring; + char text[200]; uint8_t bg_red = 0; uint8_t bg_green = 0; uint8_t bg_blue = 0; @@ -19,57 +22,53 @@ static err_t modbus_incomming_data(void *arg, struct tcp_pcb *pcb, struct pbuf * uint8_t nr_img = 0; uint32_t result_bg = 0; uint32_t result_txt = 0; - uint32_t result = 0; - char text[200]; - - for(i = 0; i < 100;i++){ - text[i] = 95; // _ + for(i = 0; i < 100; i++){ + text[i] = 95; } text[199] = '\0'; if (p != NULL){ printf("data not null\n"); - //here im going to procces the modbusdata + // here im going to procces the modbusdata tcp_recved( pcb, p->tot_len ); pc = (char*)p->payload; - len =p->tot_len; + len = p->tot_len; - //putting the bufer in the register array - for( i=0; i