1、根据自己板子设定按键数量,目前默认最大支持9个按键,设置办法如下,不同按键数量类似。只需要留意HAVE_x_BUTTON定义的名字差别,具体看代码就一目了然了。
earbud\src\earbud_buttons.h
#ifndef EARBUD_BUTTONS_H
#define EARBUD_BUTTONS_H
#if defined(HAVE_1_BUTTON)
#include "1_button.h"
#elif defined(HAVE_2_BUTTONS)
#include "2_button.h"
#elif defined(HAVE_3_BUTTONS)
#include "3_buttons.h"
#elif defined(HAVE_4_BUTTONS)
#include "4_buttons.h"
#elif defined(HAVE_5_BUTTONS)
#include "5_buttons.h"
#elif defined(HAVE_6_BUTTONS)
#include "6_buttons.h"
#elif defined(HAVE_7_BUTTONS)
#include "7_buttons.h"
#elif defined(HAVE_9_BUTTONS)
#include "9_buttons.h"
#else
#error "No button support. Unexpected"
#endif
#endif /* EARBUD_BUTTONS_H */
2、按键对应的xml文件位置。