day1加sconscript

This commit is contained in:
james 2024-07-23 18:05:33 +08:00
parent ea7b3847f4
commit bbbdb6f3bf
2 changed files with 42 additions and 33 deletions

View File

@ -2,8 +2,17 @@ from building import *
import os import os
cwd = GetCurrentDir() cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd] CPPPATH = [cwd]
src = ['hello.c']
group = DefineGroup('Hello_Test', src, depend = [''],CPPPATH = CPPPATH) 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') Return('group')

View File

@ -9,42 +9,42 @@
* 2023-12-03 Meco Man support nano version * 2023-12-03 Meco Man support nano version
*/ */
#include <board.h> // #include <board.h>
#include <rtthread.h>
#include <drv_gpio.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
#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 <rtthread.h> // #include <rtthread.h>
// #include "hello.h" // #include <drv_gpio.h>
// #ifndef RT_USING_NANO
// #include <rtdevice.h>
// #endif /* RT_USING_NANO */
// #define GPIO_LED_B GET_PIN(F, 11)
// #define GPIO_LED_R GET_PIN(F, 12)
// int main(void) // int main(void)
// { // {
// rt_pin_mode(GPIO_LED_R, PIN_MODE_OUTPUT);
// while (1) // 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); // rt_thread_mdelay(500);
// } // }
// return 0;
// } // }
#include <rtthread.h>
#include "hello.h"
int main(void)
{
while(1)
{
Print_Hello_World();
rt_thread_mdelay(500);
}
return 0;
}
/* /*
* /线 * /线
* *