diff --git a/emb/pastilda/app/app.cpp b/emb/pastilda/app/app.cpp index 8ea95f3..38786ce 100644 --- a/emb/pastilda/app/app.cpp +++ b/emb/pastilda/app/app.cpp @@ -21,6 +21,7 @@ #include "app.h" #include "stdio.h" +#include "wrapset.h" using namespace Application; App *app_pointer; @@ -50,7 +51,7 @@ void App::redirect(uint8_t *data, uint8_t len) void App::control_interception() { - memset(app_pointer->key, 0, 8); + ZeroIt(app_pointer->key); app_pointer->key[2] = KEY_W; app_pointer->key[3] = KEY_O; app_pointer->key[4] = KEY_N; diff --git a/emb/pastilda/app/wrapset.h b/emb/pastilda/app/wrapset.h new file mode 100644 index 0000000..94fa537 --- /dev/null +++ b/emb/pastilda/app/wrapset.h @@ -0,0 +1,7 @@ +#ifndef __WRAPSET__ +#define __WRAPSET__ +template void ZeroIt(T& value) +{ + memset(&value,0,sizeof(value)); +} +#endif \ No newline at end of file