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

@ -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]
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')

View File

@ -9,42 +9,42 @@
* 2023-12-03 Meco Man support nano version
*/
#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 <board.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)
// {
// 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 <rtthread.h>
#include "hello.h"
int main(void)
{
while(1)
{
Print_Hello_World();
rt_thread_mdelay(500);
}
return 0;
}
/*
* /线
*