+init 删冗余 发送信息开关等(未成功)

This commit is contained in:
2024-07-30 23:52:48 +08:00
parent 09c32b541a
commit a0ae37543c
5 changed files with 79 additions and 402 deletions

View File

@@ -23,7 +23,7 @@ void app_lcd_string(void){
/* show some string on lcd */
lcd_show_string(10, 69, 16, "Hello, RT-Thread!");
lcd_show_string(10, 69 + 16, 24, "RT-Thread");
lcd_show_string(10, 69 + 16 + 24, 32, "RT-Thread");
lcd_show_string(10, 69 + 16 + 24, 32, "123");
/* draw a line on lcd */
lcd_draw_line(0, 69 + 16 + 24 + 32, 240, 69 + 16 + 24 + 32);

58
applications/init.c Normal file
View File

@@ -0,0 +1,58 @@
#include <rtthread.h>
#include <rthw.h>
#include <wlan_mgnt.h>
#include <wlan_cfg.h>
#include <wlan_prot.h>
static int board_init(void)
{
return 0;
}
INIT_BOARD_EXPORT(board_init);
static int prev_init(void)
{
return 0;
}
INIT_PREV_EXPORT(prev_init);
static int device_init(void)
{
return 0;
}
INIT_DEVICE_EXPORT(device_init);
static int component_init(void)
{
return 0;
}
INIT_COMPONENT_EXPORT(component_init);
static int env_init(void)
{
return 0;
}
INIT_ENV_EXPORT(env_init);
static int app_init(void)
{
return 0;
}
INIT_APP_EXPORT(app_init);
// extern int wifi_join(int argc, char *argv[]);
int main_init(void)
{
// rt_thread_mdelay(18000);
// char *argv[] = {"wifi", "join", "Dong", "abcd07691234"};
// wifi_join(4, argv);
// char *ssid = "Dong";
// char *key = "abcd07691234";
// rt_wlan_connect(ssid, key);
return 0;
}

4
applications/init.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef __INIT_H__
#define __INIT_H__
int main_init(void);
#endif // !__INIT_H__

View File

@@ -50,7 +50,8 @@
// return 0;
// }
#include <rtthread.h>
#include<board.h>
#include <board.h>
#include "init.h"
#include <drv_gpio.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
@@ -61,6 +62,7 @@
int main(void)
{
main_init();
rt_pin_mode(GPIO_LED_B, PIN_MODE_OUTPUT);
while(1)
{