当前位置: 首页 > article >正文

Android SPRD 工模测试修改

  • 设备有两颗led灯,工模测试需全亮
vendor/sprd/proprietories-source/factorytest/testitem/led.cpp

@@ -13,6 +13,10 @@ typedef enum{
 #define LED_BLUE                       "/sys/class/leds/blue/brightness"
 #define LED_RED                               "/sys/class/leds/red/brightness"
 #define LED_GREEN                      "/sys/class/leds/green/brightness"
+//mh@start
+#define AW_LED_BLUE                    "/sys/class/leds/aw_blue/brightness"
+#define AW_LED_RED                            "/sys/class/leds/aw_red/brightness"
+#define AW_LED_GREEN                   "/sys/class/leds/aw_green/brightness"

	...
	
+static void *aw_led_thread(void *)
+{
+       int pos = 3;
+       int loop = led_blue;
+       char *ledn = AW_LED_BLUE;
+       char *title;
+       UI_COLOR color = CL_BLUE;
+       usleep(500*1000);
+
+       while(1 == thread_run) {
+               switch(led_color(loop++%color_num)){
+                       case led_blue:
+                               ledn = AW_LED_BLUE;
+                               color = CL_BLUE;
+                               title = TEXT_LED_BLUE;
+                               LOGD("get led name: %s! loop = %d!", ledn, loop);
+                               break;
+                       case led_red:
+                               ledn = AW_LED_RED;
+                               color = CL_RED;
+                               title = TEXT_LED_RED;
+                               LOGD("get led name: %s! loop = %d!", ledn, loop);
+                               break;
+                       case led_green:
+                               ledn = AW_LED_GREEN;
+                               color = CL_GREEN;
+                               title = TEXT_LED_GREEN;
+                               LOGD("get led name: %s! loop = %d!", ledn, loop);
+                               break;
+               }
+               LedSetValue(ledn, 200);
+               ui_set_color(color);
+               ui_show_text(6, pos, title);
+               gr_flip();
+               usleep(500*1000);
+               LedSetValue(ledn, 0);
+               ui_clear_rows(6, 2);
+               gr_flip();
+       }
+
+       return NULL;
+}
 int test_led_start(void)
 {
        int ret;
@@ -95,6 +142,7 @@ int test_led_start(void)
        LOGD("mmitest start");
        thread_run=1;
        pthread_create(&thead, NULL, led_thread, NULL);
+    pthread_create(&thead, NULL, aw_led_thread, NULL);
        usleep(10*1000);
        ret = ui_handle_button(TEXT_PASS,NULL,TEXT_FAIL);
        thread_run=0;
  • 添加按键
device/sprd/sharkle/sl8541e_1h10_go/rootdir/prodnv/PCBA.conf

@@ -82,6 +82,9 @@ sensor        Temperature     Temperature
 key    Power   116
 key    VolumeDown      114
 key    VolumeUp        115
-key    Menu    580
-key    Home    172
-key    Back    158
+#mh@start
+#key   Menu    580
+#key   Home    172
+#key   Back    158
+key    PlayPause       164
+key    F1      59
vendor/sprd/proprietories-source/factorytest/factorytest.h

@@ -262,7 +262,9 @@ enum key_type
        KEY_TYPE_HOME,
        KEY_TYPE_MENU,
        KEY_TYPE_BACK,
-       KEY_TYPE_NUM
+       KEY_TYPE_NUM,
+    KEY_TYPE_PLAYPAUSE,
+    KEY_TYPE_F1
vendor/sprd/proprietories-source/factorytest/parse_conf.cpp

@@ -128,6 +128,9 @@ int get_key_Num(char* s)
    if(!strcmp(s,"Menu")) return KEY_TYPE_MENU;
    if(!strcmp(s,"Home")) return KEY_TYPE_HOME;
    if(!strcmp(s,"Back")) return KEY_TYPE_BACK;
+   //mh@start
+   if(!strcmp(s,"PlayPause")) return KEY_TYPE_PLAYPAUSE;
+   if(!strcmp(s,"F1")) return KEY_TYPE_F1;
 
    return -1;
 }
 @@ -174,6 +177,13 @@ int parse_key_entries(char *buf)
                        case KEY_TYPE_BACK:
                                strncpy(key_info[key_cnt].key_shown,TEXT_KEY_BACK,strlen(TEXT_KEY_BACK));
                                break;
+            //mh@20241214
+            case KEY_TYPE_PLAYPAUSE:
+                strncpy(key_info[key_cnt].key_shown,TEXT_KEY_PLAYPAUSE,strlen(TEXT_KEY_PLAYPAUSE));
+                               break;
+            case KEY_TYPE_F1:
+                strncpy(key_info[key_cnt].key_shown,TEXT_KEY_F1,strlen(TEXT_KEY_F1));
+                               break;
                        default:
                                LOGD("invalid key");
vendor/sprd/proprietories-source/factorytest/res/string_cn.h
@@ -122,6 +122,8 @@
 #define TEXT_KEY_BACK                                  "返回键"
 #define TEXT_KEY_HOMEPAGE                              "主页键"
 #define TEXT_KEY_CAMERA                                        "相机键"
+#define TEXT_KEY_PLAYPAUSE              "播放暂停键"
+#define TEXT_KEY_F1                     "F1键"
 

vendor/sprd/proprietories-source/factorytest/res/string_en.h

@@ -123,6 +123,8 @@
 #define TEXT_KEY_BACK                                  "Back Key"
 #define TEXT_KEY_HOMEPAGE                              "Homepage Key"
 #define TEXT_KEY_CAMERA                                        "Camera Key"
+#define TEXT_KEY_PLAYPAUSE              "PlayPause Key"
+#define TEXT_KEY_F1                     "F1 Key"
  • 去掉任意测试项
    support 改为0
device/sprd/sharkle/project/rootdir/prodnv/PCBA.conf

#id   support   case
0	1	LCD
1	1	TP
2	1	MULTITOUCH
3	1	KEY
4	1	VIBRATOR
5	1	BACKLIGHT
6	0	FCAMERA
7	1	BCAMERA
8	1	FLASH
...

http://www.kler.cn/a/467836.html

相关文章:

  • 前端小案例——520表白信封
  • unity学习11:地图相关的一些基础
  • SRS 服务器入门:实时流媒体传输的理想选择
  • Gitea代码仓服务搭建
  • 从0到机器视觉工程师(二):封装调用静态库和动态库
  • uniapp中判断设备类型
  • boot-126网易邮件发送
  • CSS系列(47)-- Animation Timeline详解
  • 车载软件架构 ---互联网人才怎么转变成汽车软件专家?
  • 【网络协议】开放式最短路径优先协议OSPF详解(三)
  • OSError: [WinError 126] 找不到指定的模块 backend_with_compiler.dll
  • 文件I/O - 文件读写操作
  • 计算机网络 —— 网络编程实操(1)(UDP)
  • C#利用Attribute实现面向切面编程(AOP)
  • LangChain4j 框架探索
  • 前端-计算机网络篇
  • 【Unity功能集】TextureShop纹理工坊(八)修剪工具
  • 基于Spring Boot的前后端分离的外卖点餐系统
  • 前端异常处理合集
  • python pandas 对mysql 一些常见操作
  • Vulnhub靶场(Earth)
  • 【机器学习篇】解密算法魔方之魅之机器学习的多维应用盛宴
  • C 实现植物大战僵尸(四)
  • 太速科技-633-4通道2Gsps 14bit AD采集PCie卡
  • Azkaban其二,具体使用以及告警设置
  • win10 npm login 登陆失败