From bbbdb6f3bf89f3e0d38b933123043af8e445b119 Mon Sep 17 00:00:00 2001 From: james <1943357252@qq.com> Date: Tue, 23 Jul 2024 18:05:33 +0800 Subject: [PATCH] =?UTF-8?q?day1=E5=8A=A0sconscript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Day1/SConscript | 19 +++++++++++---- applications/main.c | 56 ++++++++++++++++++++++----------------------- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/Day1/SConscript b/Day1/SConscript index 40df22c..03feb20 100644 --- a/Day1/SConscript +++ b/Day1/SConscript @@ -1,9 +1,18 @@ from building import * import os -cwd =GetCurrentDir() -CPPPATH =[cwd] -src = ['hello.c'] -group = DefineGroup('Hello_Test', src, depend = [''],CPPPATH = CPPPATH) +cwd = GetCurrentDir() +src = Glob('*.c') +CPPPATH = [cwd] -Return('group') \ No newline at end of file +if GetDepend(['PKG_USING_RTDUINO']) and not GetDepend(['RTDUINO_NO_SETUP_LOOP']): + src += ['arduino_main.cpp'] + +group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) + +list = os.listdir(cwd) +for item in list: + if os.path.isfile(os.path.join(cwd, item, 'SConscript')): + group = group + SConscript(os.path.join(item, 'SConscript')) + +Return('group') diff --git a/applications/main.c b/applications/main.c index 4704b95..9ad014b 100644 --- a/applications/main.c +++ b/applications/main.c @@ -9,42 +9,42 @@ * 2023-12-03 Meco Man support nano version */ -#include -#include -#include -#ifndef RT_USING_NANO -#include -#endif /* RT_USING_NANO */ - -#define GPIO_LED_B GET_PIN(F, 11) -#define GPIO_LED_R GET_PIN(F, 12) -int main(void) -{ - rt_pin_mode(GPIO_LED_R, PIN_MODE_OUTPUT); - - while (1) - { - rt_pin_write(GPIO_LED_R, PIN_HIGH); - rt_thread_mdelay(500); - rt_pin_write(GPIO_LED_R, PIN_LOW); - rt_thread_mdelay(500); - } -} - +// #include // #include -// #include "hello.h" +// #include +// #ifndef RT_USING_NANO +// #include +// #endif /* RT_USING_NANO */ -// int main(void) +// #define GPIO_LED_B GET_PIN(F, 11) +// #define GPIO_LED_R GET_PIN(F, 12) +// int main(void) // { -// while(1) +// rt_pin_mode(GPIO_LED_R, PIN_MODE_OUTPUT); + +// while (1) // { -// Print_Hello_World(); +// rt_pin_write(GPIO_LED_R, PIN_HIGH); +// rt_thread_mdelay(500); +// rt_pin_write(GPIO_LED_R, PIN_LOW); // rt_thread_mdelay(500); // } - -// return 0; // } +#include +#include "hello.h" + +int main(void) +{ + while(1) + { + Print_Hello_World(); + rt_thread_mdelay(500); + } + + return 0; +} + /* * 程序清单:创建、初始化/脱离线程 *