按照上一篇文章的接口定義連接鼠標(biāo)標(biāo)傳感器 paw3395,SDK提供的樣板程序“sel_mouse_with_dongle”能正常工作。
原樣板程序中光標(biāo)傳感器采用查詢模式工作,所以不需要連接 paw3395 的 motion 引腳。 通過(guò)USB工具程序發(fā)現(xiàn)鼠標(biāo)不管有沒有按鍵滾輪和光標(biāo)數(shù)據(jù)一直不停的發(fā)送數(shù)據(jù)可以在程序中進(jìn)行改進(jìn)具體方法如下
修改程序“…samplespriductssle_mouse_with_donglesle_low_latency_service.c”中 void sle_mouse_get_key(void) 函數(shù)
void sle_mouse_get_key(void)
{
int8_t button_mask = 0;
int16_t x = 0;
int16_t y = 0;
int8_t wheel = 0;
sle_mouse_key_set(&button_mask, &x, &y, &wheel);
if(sle_mouse_data_is_empty(button_mask, x, y, wheel))
{ //
return;
}
g_mouse_notify_data.button_mask = button_mask;
g_mouse_notify_data.x = x;
g_mouse_notify_data.y = y;
g_mouse_notify_data.wheel = wheel;
g_ssap_notify_data.handle = SLE_MOUSE_SSAP_RPT_HANDLE;
g_ssap_notify_data.type = 0;
g_ssap_notify_data.value_len = sizeof(ssap_mouse_key_t);
g_ssap_notify_data.value = (uint8_t *)(&g_mouse_notify_data);
ssaps_notify_indicate(SLE_MOUSE_DEFAULT_SERVER_ID, SLE_MOUSE_DEFAULT_CONNECT_ID, &g_ssap_notify_data);
}
添加了空數(shù)據(jù)判斷,如果為空直接 return; 。
空數(shù)據(jù)判斷程序如下
static bool sle_mouse_data_is_empty(int8_t buttons, int16_t x, int16_t y, int8_t wheel)
{
if((!buttons) && (!x) && (!y) && (!wheel))
return true;
else
return false;
}
再次燒錄測(cè)試 一切正常。
審核編輯:湯梓紅
-
華為
+關(guān)注
關(guān)注
216文章
35212瀏覽量
255920 -
程序
+關(guān)注
關(guān)注
117文章
3826瀏覽量
82996 -
開發(fā)板
+關(guān)注
關(guān)注
25文章
5682瀏覽量
104790 -
SDK
+關(guān)注
關(guān)注
3文章
1077瀏覽量
49108 -
星閃
+關(guān)注
關(guān)注
8文章
182瀏覽量
981
發(fā)布評(píng)論請(qǐng)先 登錄
如何選擇和編譯海思星閃BS25 SDK下的sle mouse工程

如何搭建星閃BS25開發(fā)環(huán)境

利用星閃BS25開發(fā)板NL001測(cè)試SDK中外設(shè)程序

利用星閃BS25開發(fā)板NL001測(cè)試官方sdk中的外設(shè)程序uart

【BearPi-Pico H3863星閃開發(fā)板體驗(yàn)連載】星閃超低功耗SLE透?jìng)鞴δ軠y(cè)試
解決BS25 1.0.T20.12版本開發(fā)工具默認(rèn)SDK無(wú)法編譯的問(wèn)題

解決星閃芯片BS25 1.0.T20.12版本開發(fā)工具默認(rèn)SDK無(wú)法編譯的問(wèn)題

評(píng)論