Merge branch 'main' into lcd
This commit is contained in:
58
applications/init.c
Normal file
58
applications/init.c
Normal 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
4
applications/init.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef __INIT_H__
|
||||
#define __INIT_H__
|
||||
int main_init(void);
|
||||
#endif // !__INIT_H__
|
@@ -50,17 +50,27 @@
|
||||
// return 0;
|
||||
// }
|
||||
#include <rtthread.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <board.h>
|
||||
#include "init.h"
|
||||
#include <drv_gpio.h>
|
||||
#define DBG_TAG "main"
|
||||
#define DBG_LVL DBG_LOG
|
||||
#include <rtdbg.h>
|
||||
#ifndef RT_USING_NANO
|
||||
#include <rtdevice.h>
|
||||
#endif // !RT_USING_NANO
|
||||
|
||||
static int onboard_sdcard_mount();
|
||||
#define GPIO_LED_B GET_PIN(F,11)
|
||||
#define GPIO_LED_R GET_PIN(F,12)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
onboard_sdcard_mount();
|
||||
main_init();
|
||||
// rt_pin_mode(GPIO_LED_B, PIN_MODE_OUTPUT);
|
||||
// while(1)
|
||||
// {
|
||||
// rt_pin_write(GPIO_LED_B, PIN_HIGH);
|
||||
// rt_thread_mdelay(500);
|
||||
// rt_pin_write(GPIO_LED_B, PIN_LOW);
|
||||
// rt_thread_mdelay(500);
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -78,10 +88,10 @@ static int onboard_sdcard_mount(void)
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
// #define WIFI_CS GET_PIN(F, 10)
|
||||
// void WIFI_CS_PULL_DOWM(void)
|
||||
// {
|
||||
// rt_pin_mode(WIFI_CS, PIN_MODE_OUTPUT);
|
||||
// rt_pin_write(WIFI_CS, PIN_LOW);
|
||||
// }
|
||||
// INIT_BOARD_EXPORT(WIFI_CS_PULL_DOWM);
|
||||
#define WIFI_CS GET_PIN(F, 10)
|
||||
void WIFI_CS_PULL_DOWM(void)
|
||||
{
|
||||
rt_pin_mode(WIFI_CS, PIN_MODE_OUTPUT);
|
||||
rt_pin_write(WIFI_CS, PIN_LOW);
|
||||
}
|
||||
INIT_BOARD_EXPORT(WIFI_CS_PULL_DOWM);
|
||||
|
Reference in New Issue
Block a user