91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 13.13MB
    文件類型: .7z
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-07-26
  • 語言: 其他
  • 標(biāo)簽: W8782??STM32F407??LOT??

資源簡介

W8782 WIFI模塊驅(qū)動代碼,STM32F407,注意!具體是否適合自己的開發(fā)板要自己移植,本人用的是老衲五木大佬的LOT-

資源截圖

代碼片段和文件信息

#define?DEBUG
#include?“debug.h“
#include?“drivers.h“
#include?“stdio.h“
#include?“api.h“
#include?“l(fā)wip/stats.h“
#include?“l(fā)wip/sockets.h“
#include?“l(fā)wip/api.h“
#include?“l(fā)wip/tcp.h“
#include?“l(fā)wip/arch/sys_arch.h“
#include?“l(fā)wip/memp.h“
#include?

#if?SYS_MONITOR?==?0
bool?monitor_enable?=?0;
#else
bool?monitor_enable?=?1;
#endif

int?dbg_level?=?1;

int?cpu_used?=?0;

void?monitor_switch()
{
monitor_enable?=?!monitor_enable;
if(monitor_enable)
p_dbg(“打開monitor“);
else
p_dbg(“關(guān)閉monitor“);
}

void?send_test_pkg(int?cmd?const?void?*data?int?size)
{
static?uint8_t?g_seq?=?0;
uint8_t?*pkg;
uint8_t?*p_data?=?(uint8_t*)data;
int?i;
uint8_t?sum?=?0;
if?((size?>?1024)?||?(size?&&?(p_data?==?0)))
{
return?;
}

pkg?=?(uint8_t*)mem_malloc2(size?+?7);
if?(pkg?==?0)
{
p_err(“send_pkg?mem_malloc?err?size:%d\n“?size?+?7);
return?;
}
pkg[0]?=?0xaa;
pkg[1]?=?(uint8_t)cmd;
pkg[2]?=?(uint8_t)((size?+?7)?%?256);
pkg[3]?=?(uint8_t)((size?+?7)?/?256);
pkg[4]?=?(uint8_t)g_seq++;
sum?^=?pkg[1];
sum?^=?pkg[2];
sum?^=?pkg[3];
sum?^=?pkg[4];
for?(i?=?0;?i? {
pkg[i?+?5]?=?p_data[i];
sum?^=?p_data[i];
}
pkg[i?+?5]?=?sum;
pkg[i?+?6]?=?0x55;

uart1_send(pkg?i?+?7);

mem_free2(pkg);
}


#pragma?section?=?“monitor_item_table“

char?*p_globle_buff?=?0;
#define?GLOBLE_TEST_BUFF_SIZE?2048

typedef?enum
{
STAT_TYPE_SYS?=?1?STAT_TYPE_TASK?STAT_TYPE_WIFI?STAT_TYPE_SOCKET?STAT_TYPE_MAX_VALUE
}?STAT_TYPE;


DECLARE_MONITOR_ITEM(“monitor?item?example“?monitor_send_cnt);

char?*err?=?“test_buff?err“;

#define?CHECK_AND_ADD_BUFF { \
tmp[127]?=?0;\
cnt?+=?strlen(tmp);\
if(cnt?>?(GLOBLE_TEST_BUFF_SIZE?-?64)){\
p_err(“%s?l:%d?len:%d?tmp_len:%d?“?err?__LINE__?cnt??strlen(tmp));\
goto?end;\
}\
strcat(p_globle_buff?tmp);\
}

#define?CHECK_AND_ADD_LINE { \
sprintf(tmp?“\r\n“); \
tmp[127]?=?0;\
cnt?+=?strlen(tmp);\
if(cnt?>?(GLOBLE_TEST_BUFF_SIZE?-?64)){\
p_err(“%s?l:%d?len:%d?tmp_len:%d?“?err?__LINE__?cnt??strlen(tmp));\
goto?end;\
}\
strcat(p_globle_buff?tmp);\
}


extern?const?uint32_t?monitor_item_table$$base;
extern?const?uint32_t?monitor_item_table$$Limit;

extern?char?STACK$$base[];
#define?STACK_SIZE?0X200

uint32_t?get_msp_size()
{
return?(uint32_t)STACK_SIZE;
}

uint32_t?get_msp_free()
{
int?i;
uint32_t?*stack_base?=?(uint32_t*)STACK$$base;
uint32_t?stack_size?=?STACK_SIZE;
stack_size?=?stack_size?/?4;
for?(i?=?0;?i? {
if?(stack_base[i])
break;
}

return?i?*4;
}


void?send_sys_stat_data()
{
char?*tmp;
int?cnt?=?0?i;
uint32_t?start?end;

tmp?=?(char*)mem_malloc2(128);
if?(!tmp)
return?;

INC_MONITOR_ITEM_VALUE(monitor_send_cnt);

send_test_pkg(STAT_TYPE_SYS?0?0);

memset(p_globle_buff?0?GLOBLE_TEST_BUFF_SIZE);
#ifdef?OS_UCOS
#ifdef?UCOS_V3
cpu_used?=?OSStatTaskCPUUsage/100;
snprintf(tmp?127?“C

評論

共有 條評論