Преглед изворни кода

[bug] fix memset parameter sequence error. | 修复memset参数顺序错误.

liu2guang пре 8 година
родитељ
комит
905a9e0589
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      multi_button.c

+ 1 - 1
multi_button.c

@@ -31,7 +31,7 @@ static struct button* head_handle = NULL;
   */
   */
 void button_init(struct button* handle, uint8_t(*pin_level)(void), uint8_t active_level)
 void button_init(struct button* handle, uint8_t(*pin_level)(void), uint8_t active_level)
 {
 {
-    memset(handle, sizeof(struct button), 0);
+    memset(handle, 0, sizeof(struct button));
     handle->event = (uint8_t)NONE_PRESS;
     handle->event = (uint8_t)NONE_PRESS;
     handle->hal_button_Level = pin_level;
     handle->hal_button_Level = pin_level;
     handle->button_level = handle->hal_button_Level();
     handle->button_level = handle->hal_button_Level();