nordic-auko/nRF5-ble-timesync-demo

conflicting types of '__putchar()'

pescara opened this issue · 4 comments

Hi
I downloaded your code and tryied to build it in Segger Embedded Studio. But there the error comes:
"conflicting types of '__putchar()'

(1) you declare it in stdio.h as follow:
int __putchar(int, __printf_tag_ptr);

(2) then in rectarget.c it is defined as following:
int __putchar(int ch, FILE * p_file)
{
UNUSED_PARAMETER(p_file);
UNUSED_VARIABLE(app_uart_put((uint8_t)ch));
return ch;
}
Can you help me?
Is is ok if I just uncomment the (2) declaration? Will it still run? I'm very very pleased for any help since my thesis will highly depend on it... : (

Hello,
it looks like this file has been updated in more recent nRF5 SDK versions.
Can you try the attached retarget.c (copied from nRF5 SDK 16.0.0)?

retarget.zip

@nordic-auko Tested it and it seems like a functioning workaround. Can you update it? Should I generate a PR? Also I think the project should embed a .gitignore like the following
gitignore.zip

Thanks, @m3x1m0m !
I plan to bump this repo to the latest SDK version sooner rather than later anyway, so there's no need for a PR.
And thanks for the tip regarding .gitignore!

Added SDK 16 examples