nordic-auko / nRF5-ble-timesync-demo

nRF52 clock synchronization demo code
55 stars 50 forks source link

conflicting types of '__putchar()' #2

Closed pescara closed 4 years ago

pescara commented 4 years ago

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... : (

nordic-auko commented 4 years ago

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

m3x1m0m commented 4 years ago

@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

nordic-auko commented 4 years ago

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!

nordic-auko commented 4 years ago

Added SDK 16 examples