2020-08-26 21:13:16 +02:00
|
|
|
#ifndef OBUS_MODULE_H
|
|
|
|
#define OBUS_MODULE_H
|
|
|
|
|
|
|
|
#include "Arduino.h"
|
|
|
|
#include <obus_can.h>
|
|
|
|
|
2020-08-31 12:56:03 +02:00
|
|
|
#define OBUS_PUZZLE_ID_DEVELOPMENT 255
|
|
|
|
#define OBUS_NEEDY_ID_DEVELOPMENT 255
|
|
|
|
#define OBUS_INFO_ID_DEVELOPMENT 255
|
|
|
|
|
2020-08-26 21:13:16 +02:00
|
|
|
namespace obus_module {
|
|
|
|
|
|
|
|
void setup(uint8_t type, uint8_t id);
|
|
|
|
|
2021-02-01 15:33:14 +01:00
|
|
|
void empty_callback_info(uint8_t info_id, uint8_t infomessage[7]);
|
2021-02-01 18:51:02 +01:00
|
|
|
void empty_callback_state(uint32_t time_left, uint8_t strikes, uint8_t max_strikes, uint8_t puzzle_modules_left);
|
2020-09-09 18:18:55 +02:00
|
|
|
|
2021-02-01 18:51:02 +01:00
|
|
|
bool loopPuzzle(obus_can::message* message, void (*callback_game_start)(uint8_t puzzle_modules), void (*callback_game_stop)(), void (*callback_info)(uint8_t info_id, uint8_t infomessage[7]) = empty_callback_info, void (*callback_state)(uint32_t time_left, uint8_t strikes, uint8_t max_strikes, uint8_t puzzle_modules_left) = empty_callback_state);
|
2021-02-01 15:33:14 +01:00
|
|
|
|
2021-02-01 18:51:02 +01:00
|
|
|
bool loopNeedy(obus_can::message* message, void (*callback_game_start)(uint8_t puzzle_modules), void (*callback_game_stop)(), void (*callback_info)(uint8_t info_id, uint8_t infomessage[7]) = empty_callback_info, void (*callback_state)(uint32_t time_left, uint8_t strikes, uint8_t max_strikes, uint8_t puzzle_modules_left) = empty_callback_state);
|
2020-08-27 05:30:22 +02:00
|
|
|
|
2020-09-09 23:59:25 +02:00
|
|
|
bool loopInfo(obus_can::message* message, int (*info_generator)(uint8_t*));
|
2020-08-26 21:13:16 +02:00
|
|
|
|
|
|
|
void strike();
|
|
|
|
|
|
|
|
void solve();
|
|
|
|
|
2020-08-27 05:30:22 +02:00
|
|
|
bool is_active();
|
|
|
|
|
2020-08-26 21:13:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* end of include guard: OBUS_MODULE_H */
|