I am using writing code on a STM32F1 series micro in C.
Every things has worked great including usb serial communication (virtual com port).
I recently added some code to insert a decimal (we are not using any floating point numbers with the code) into a few numbers that will always have the same format - very simple.
The code below just inserts a decimal into the array.
I am using the standard _IO_putchar() function to send characters serially via printf().
When writing the code shown below, I get the error message "multiple definitions of _IO_putchar. Whats the deal? Even if I delete the function name, and simply paste the code into my main loop I still get the error. Any ideas?
void print_decV(void)
{
uint8_t counter, length, decimal_place = 0;
for(counter; counter < 5; counter++)
{
if(int_to_char[counter] != 0)
length = counter;
if(int_to_char[counter] == '.')
decimal_place = counter;
}
counter = 0;
if(length == 0)
printf("0");
else
{
for(counter; counter <= length; counter++)
{
if(counter == decimal_place)
printf(".");
else
printf("%i", int_to_char[counter]);
}
}
return;
}
Every things has worked great including usb serial communication (virtual com port).
I recently added some code to insert a decimal (we are not using any floating point numbers with the code) into a few numbers that will always have the same format - very simple.
The code below just inserts a decimal into the array.
I am using the standard _IO_putchar() function to send characters serially via printf().
When writing the code shown below, I get the error message "multiple definitions of _IO_putchar. Whats the deal? Even if I delete the function name, and simply paste the code into my main loop I still get the error. Any ideas?
void print_decV(void)
{
uint8_t counter, length, decimal_place = 0;
for(counter; counter < 5; counter++)
{
if(int_to_char[counter] != 0)
length = counter;
if(int_to_char[counter] == '.')
decimal_place = counter;
}
counter = 0;
if(length == 0)
printf("0");
else
{
for(counter; counter <= length; counter++)
{
if(counter == decimal_place)
printf(".");
else
printf("%i", int_to_char[counter]);
}
}
return;
}