Commit 921d4905 authored by Adrien Oliva's avatar Adrien Oliva

Fix cppcheck issues

parent 7bf79ce2
Pipeline #122 passed with stages
in 1 minute and 13 seconds
......@@ -32,4 +32,4 @@ fi
-DHAVE_SOCAT=1 \
"${OUTPUT_FLAGS[@]}" \
"$@" \
src/
src/ examples/
......@@ -28,3 +28,18 @@ void setup() {
void loop() {
my_button.loop();
}
#ifndef ARDUINO
int main(int argc, char *argv)
{
(void) argc;
(void) argv;
setup();
for (;;)
loop();
return 0;
}
#endif
......@@ -16,19 +16,19 @@ button_t::~button_t()
}
void button_t::on_single_click(button_callback_t callback, void *arg)
void button_t::on_single_click(const button_callback_t &callback, void *arg)
{
m_single_click_callback = callback;
m_single_arg = arg;
}
void button_t::on_double_click(button_callback_t callback, void *arg)
void button_t::on_double_click(const button_callback_t &callback, void *arg)
{
m_double_click_callback = callback;
m_double_arg = arg;
}
void button_t::on_long_click(button_callback_t callback, void *arg)
void button_t::on_long_click(const button_callback_t &callback, void *arg)
{
m_long_click_callback = callback;
m_long_arg = arg;
......
......@@ -42,9 +42,9 @@ class button_t {
explicit button_t(const uint8_t pin);
~button_t();
void on_single_click(button_callback_t callback, void *arg);
void on_double_click(button_callback_t callback, void *arg);
void on_long_click(button_callback_t callback, void *arg);
void on_single_click(const button_callback_t &callback, void *arg);
void on_double_click(const button_callback_t &callback, void *arg);
void on_long_click(const button_callback_t &callback, void *arg);
void loop();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment