今天应该写个咆哮体

感冒好点了,得瑟了。

尼玛早上加代码,

改了没多少,就尼玛kernel panic了,有木有

尼玛跟函数地址跟了一早上,有木有

尼玛最终也没看出来。。。

尼玛还是把代码回过去再重新改才发现

尼玛就是因为少判断了一种情况就kernel panic了有木有

尼玛泪牛满面啊

尼玛昨天把我的一行写寄存器的代码去掉后。。。

尼玛不能开机的问题就没有了,有木有

尼玛就一行啊。。。。。有木有

尼玛项目经理还说我太疯狂了,

尼玛有木有啊。。。。

 

乱写了一个,不符合咆哮体吧可能,没有掌握写作方法。就假装是个咆哮体吧,哈哈。

今天写的东西不多其实,晚上回来发了个patch,估计应该不能被用。只要大家能给我评论一下为啥不能被用就很不错了呢,就怕没人鸟。。。。哈哈。

嗯 ,就这样吧,把昨天的代码贴一下,开源啊。

   1:  #ifndef CONFIG_TOUCHSCREEN_SX8651_WITH_KEYPAD
   2:  static void touch_key_set_capacity(struct input_dev *input) {};
   3:  static void touch_key_up(struct input_dev *input) {};
   4:  static void touch_key_event(struct input_dev *input, u16 x, u16 y) {};
   5:  #else
   6:  static int touch_key_pos[] = {700, 1650, 2550, 3500};
   7:  static int touch_key_map[] = {KEY_MENU, KEY_HOME, KEY_BACK, KEY_SEARCH};
   8:  /* you can modify this value to change the touch_key's sensitivity */
   9:  static int touch_key_sensitivity = 50;
  10:   
  11:  static void touch_key_set_capacity(struct input_dev *input)
  12:  {
  13:      int i;
  14:      for (i = 0; i < ARRAY_SIZE(touch_key_map); i++) {
  15:          input_set_capability(input, EV_KEY, touch_key_map[i]);
  16:      }
  17:  }
  18:   
  19:  /* you must have an input_sync() followed this func . */
  20:  static void touch_key_up(struct input_dev *input)
  21:  {
  22:      int i;
  23:      for (i = 0; i < ARRAY_SIZE(touch_key_map); i++) {
  24:          input_report_key(input, touch_key_map[i], 0);
  25:      }
  26:  }
  27:   
  28:  static void touch_key_event(struct input_dev *input, u16 x, u16 y)
  29:  {
  30:      int i;
  31:      if (y > Y_MAX) {
  32:          for (i = 0; i < ARRAY_SIZE(touch_key_pos); i++) {
  33:              if ((x > (touch_key_pos[i] - touch_key_sensitivity)) &&
  34:                  (x < (touch_key_pos[i] + touch_key_sensitivity))) {
  35:                  input_report_key(input, touch_key_map[i], 1);
  36:                  input_sync(input);
  37:              }
  38:          }
  39:      }
  40:  }
  41:  #endif
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章