2024-07-13 02:22:47 +00:00
|
|
|
|
#include <start.h>
|
|
|
|
|
|
2024-07-15 03:33:54 +00:00
|
|
|
|
#include "inc/Android.h"
|
2024-07-13 03:43:10 +00:00
|
|
|
|
#include "inc/Flash.h"
|
|
|
|
|
#include "inc/UART.h"
|
2024-07-13 02:22:47 +00:00
|
|
|
|
|
2024-07-13 03:43:10 +00:00
|
|
|
|
#include <inc/communication_protocol.h>
|
2024-07-15 09:22:55 +00:00
|
|
|
|
#include <inc/thread.h>
|
2024-07-15 03:33:54 +00:00
|
|
|
|
#include "inc/uart_dev.h"
|
2024-07-17 01:40:41 +00:00
|
|
|
|
#include "inc/thread_communication.h"
|
|
|
|
|
|
2024-07-15 03:33:54 +00:00
|
|
|
|
|
|
|
|
|
|
2024-07-13 02:22:47 +00:00
|
|
|
|
/*
|
2024-08-19 07:01:40 +00:00
|
|
|
|
* @brief Ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param
|
|
|
|
|
* @retval
|
2024-07-13 02:22:47 +00:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void hareware_init()
|
|
|
|
|
{
|
|
|
|
|
android_PowerCtrl_Init();
|
2024-08-19 07:01:40 +00:00
|
|
|
|
android_PowerKey_Init();
|
2024-07-13 02:22:47 +00:00
|
|
|
|
|
2024-10-28 08:15:59 +00:00
|
|
|
|
android_PowerKey_Rest();
|
|
|
|
|
rt_kprintf("\nandroid_PowerKey_Rest OK\n");
|
2024-07-13 02:22:47 +00:00
|
|
|
|
|
2024-10-28 08:15:59 +00:00
|
|
|
|
|
|
|
|
|
// while (1) {
|
|
|
|
|
//
|
|
|
|
|
// };
|
2024-08-19 07:01:40 +00:00
|
|
|
|
// SPI_Flash_TEST();
|
2024-07-13 02:22:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2024-08-19 07:01:40 +00:00
|
|
|
|
* @brief <EFBFBD>̳߳<EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param
|
|
|
|
|
* @retval
|
2024-07-13 02:22:47 +00:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void software_init()
|
|
|
|
|
{
|
2024-08-07 06:53:50 +00:00
|
|
|
|
uart_all_dev_init();
|
2024-08-19 08:58:08 +00:00
|
|
|
|
Send_mq_Init();
|
2024-07-17 01:40:41 +00:00
|
|
|
|
Recv_thread_Init();
|
2024-08-19 08:58:08 +00:00
|
|
|
|
Send_thread_Init();
|
2024-08-07 06:53:50 +00:00
|
|
|
|
|
2024-10-28 08:15:59 +00:00
|
|
|
|
while (1) {
|
|
|
|
|
// uart_dev_write(g_J4RS485_UART8_handle, "hello world\n", sizeof("hello world\n"));
|
|
|
|
|
rt_thread_delay(1000);
|
|
|
|
|
}
|
2024-07-13 02:22:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2024-08-19 07:01:40 +00:00
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param
|
|
|
|
|
* @retval
|
2024-07-13 02:22:47 +00:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void app_star()
|
|
|
|
|
{
|
2024-10-28 08:15:59 +00:00
|
|
|
|
// hareware_init();
|
|
|
|
|
// software_init();
|
|
|
|
|
|
|
|
|
|
android_PowerCtrl_Init();
|
|
|
|
|
android_PowerKey_Init();
|
|
|
|
|
android_PowerKey_Rest();
|
|
|
|
|
rt_kprintf("\nandroid_PowerKey_Rest OK\n");
|
|
|
|
|
|
|
|
|
|
uart_all_dev_init();
|
|
|
|
|
Send_mq_Init();
|
|
|
|
|
Recv_thread_Init();
|
|
|
|
|
Send_thread_Init();
|
|
|
|
|
|
|
|
|
|
J1_485_Init(9600);
|
|
|
|
|
J1_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
J2_485_Init(9600);
|
|
|
|
|
J2_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
J3_485_Init(9600);
|
|
|
|
|
J3_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
J4_485_Init(9600);
|
|
|
|
|
J4_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
J5_0_485_Init(9600);
|
|
|
|
|
J5_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
J6_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
J7_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
J8_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
J9_PWR_Open();
|
|
|
|
|
rt_thread_mdelay(5000);
|
|
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
|
// uart_dev_write(g_J4RS485_UART8_handle, "hello world\n", sizeof("hello world\n"));
|
|
|
|
|
rt_thread_delay(1000);
|
|
|
|
|
}
|
2024-07-13 02:22:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|