ํ๋ก๊ทธ๋จ์ ์คํํ๋ ค๊ณ ํฉ๋๋ค (์๋ ์ฒจ๋ถ). ์ค๋ฅ์์ด ํฐ๋ฏธ๋์์์ด ํ๋ก๊ทธ๋จ์ ์คํํ ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ RIOT ์์์ด ๊ฐ๋จํ ํ๋ก๊ทธ๋จ์ ์คํํ๋ ค๊ณ ํ ๋ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋๋ก ๋์์ฃผ์ธ์. ๋ฏธ๋ฆฌ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
๊ทธ๋ฆผ 1 : ์ค๋ฅ, ๊ทธ๋ฆผ 2 : ๋ด ์ฝ๋
ํ์ผ ๋์ ๋น ์ค์ ์ถ๊ฐํ๋ฉด๋ฉ๋๋ค. ํ์ค์ C (++) ํ์ผ์ ํํ ๊ฐํ ๋ฌธ์๊ฐ ์์ด์ผํ๋ค๊ณ ๊ท์ ํ๊ณ ์์ง๋ง ๋๋ถ๋ถ์ ์ปดํ์ผ๋ฌ๋ RIOT ์์์ฒ๋ผ ์๊ฒฉํ๊ฒ ๊ตฌ์ฑํ์ง ์๋ ํ ์ ๊ฒฝ ์ฐ์ง ์์ต๋๋ค. ๋ง์ ํธ์ง์๋ ์ ์ฅํ ๋ ์๋์ผ๋ก ํํ ์ค ๋ฐ๊ฟ์ ์ถ๊ฐํฉ๋๋ค.
์ฐธ์กฐ : https://stackoverflow.com/questions/72271/no-newline-at-end-of-file-compiler-warning
@Kijewski ๊ฐ์ฌํฉ๋๋ค. ๊ทธ๊ฒ์ ๋ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค. ํ์ง๋ง ๋ด ์ฝ๋๋ฅผ ์คํ ํ ํ .. ์ด์ํ ์ผ์ด ์๊ฒผ๋ค. (์๋ ์ฒจ๋ถ ๋ ์ด๋ฏธ์ง๋ ์ฐพ์๋ณด์ธ์)
main () : RIOT์
๋๋ค! (๋ฒ์ : 2016.10-devel-449-g51a0-Harshads-MacBook-Air.local-arduino_sketch_on_arduino)
์ "arduino_sketch_on_arduino"๊ฐ ๋์ค๋์? :!
์น์ ํ๊ฒ ๋์ ์ฃผ์๊ณ ๋ฏธ๋ฆฌ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
์ฌ์ค ์ ๋ RIOT์์ ํ์ค iostream๊ณผ ์ฐ๋ ๋๋ฅผ ์ฌ์ฉํ ์ ์๋ค๋ ์ฌ์ค์กฐ์ฐจ ๋ชฐ๋์ต๋๋ค.
@josephnoir , @gebart , ์ด๊ฒ์ด ๋น์ ์๊ฒ ๋ง๋ ๊ฒ
@Kijewski : P ์์์ด .. ์ด์จ๋ .. ๋์ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
@sinkarharshad , ๋๋ ์ด๋ค ๋ฌด๋ก ํจ์ ์๋ฏธํ์ง ์์์ต๋๋ค. ๋๋ ๋ฐฐ์ฐ๊ณ ์ถ์ด์. :) ์ง๊ธ๊น์ง <thread>
๋ฐ <iostream>
๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๋๋ RIOT์ ์ต์ ๊ฐ์ ์ฌํญ์ ๋๋ฌด ๊ฐ๊น๊ฒ ๋ฐ๋ฅด์ง ์์์ต๋๋ค.
@Kijewski ์ด๋ด, ๋๋ ๊ทธ๋ ๊ฒ ๋๋ผ์ง ์์๋ค. ๋๋ ์ ๋ง๋ก ๊ณ ๋ง๊ณ ๋น์ ์ ์ค์ ๋ก ๋ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ค. ๊ทธ๋์ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค :))
๋ค์ดํฐ๋ธ ํฌํธ์์ ์๋ํฉ๋๋ค. ๋ณด๋์ ๋ํด ํฌ๋ก์ค ์ปดํ์ผ์ ์๋ํ๋ฉด ์คํจํฉ๋๋ค.
$ BOARD=stm32f4discovery make
Warning: no PORT set!
Building application "riot_and_cpp" for "stm32f4discovery" with MCU "stm32f4".
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/boards/stm32f4discovery
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/core
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/cpu/stm32f4
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/drivers
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/cpu/cortexm_common
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/drivers/periph_common
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/cpu/stm32_common
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/sys
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/cpu/stm32_common/periph
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/cpu/stm32f4/periph
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/sys/auto_init
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/sys/newlib
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/sys/tsrb
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C ~/RIOT/sys/uart_stdio
~/RIOT/examples/riot_and_cpp/main.cpp: In function 'int main()':
~/RIOT/examples/riot_and_cpp/main.cpp:16:3: error: 'thread' was not declared in this scope
thread t1((Fctor()));
^
~/RIOT/examples/riot_and_cpp/main.cpp:20:3: error: 't1' was not declared in this scope
t1.join();
^
make[1]: *** [~/RIOT/examples/riot_and_cpp/bin/stm32f4discovery/riot_and_cpp/main.o] Error 1
make: *** [all] Error 2
RIOT์์ ๋งค์ฐ ์ ์ฌํ std :: thread ์ฌ์ฉ์ ํ์ฉํ๊ธฐ ์ํด cpp11-compat ๋ชจ๋์ด ์์ต๋๋ค. RIOT์๋ C ++ ์๊ณ๊ฐ ์์ผ๋ฏ๋ก ํ์ด๋จธ๊ฐ ํ์ํ ํจ์๋ ์ฌ์ฉ์ ์ง์ ๊ตฌ์กฐ์ฒด๋ฅผ ํ์ฉํฉ๋๋ค. riot / chrono.hpp๋ฅผ ์ฐธ์กฐ
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
@Kijewski ์ด๋ด, ๋๋ ๊ทธ๋ ๊ฒ ๋๋ผ์ง ์์๋ค. ๋๋ ์ ๋ง๋ก ๊ณ ๋ง๊ณ ๋น์ ์ ์ค์ ๋ก ๋ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ค. ๊ทธ๋์ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค :))