mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 09:07:17 -04:00
Added RFM69 helper
LGE tool: new frames Text entry string length bugfix
This commit is contained in:
parent
dd35bda197
commit
b1e72c788b
18 changed files with 417 additions and 130 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "ui_navigation.hpp"
|
||||
#include "ui_transmitter.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
#include "rfm69.hpp"
|
||||
|
||||
#include "message.hpp"
|
||||
#include "transmitter_model.hpp"
|
||||
|
@ -50,27 +51,77 @@ private:
|
|||
|
||||
tx_modes tx_mode = IDLE;
|
||||
|
||||
RFM69 rfm69 { 5, 0x2DD4, true, true };
|
||||
|
||||
uint32_t frame_size { 0 };
|
||||
uint32_t repeats { 0 };
|
||||
uint32_t channel_index { 0 };
|
||||
std::string pseudo { "ABCDEF" };
|
||||
|
||||
rf::Frequency channels[3] = { 868067000, 868183000, 868295000 };
|
||||
|
||||
void start_tx();
|
||||
void stop_tx();
|
||||
void generate_frame();
|
||||
|
||||
void generate_lge_frame(const uint8_t command, std::vector<uint8_t>& data) {
|
||||
generate_lge_frame(command, 0xFFFF, 0xFFFF, data);
|
||||
}
|
||||
void generate_lge_frame(const uint8_t command, const uint16_t address_a, const uint16_t address_b, std::vector<uint8_t>& data);
|
||||
void generate_frame_pseudo();
|
||||
void generate_frame_equipe();
|
||||
void generate_frame_broadcast_pseudo();
|
||||
void generate_frame_start();
|
||||
void generate_frame_gameover();
|
||||
|
||||
void on_tx_progress(const uint32_t progress, const bool done);
|
||||
|
||||
Labels labels {
|
||||
{ { 7 * 8, 4 * 8 }, "NO FUN ALLOWED !", Color::red() },
|
||||
{ { 11 * 8, 8 * 8 }, "Zone:", Color::light_grey() }
|
||||
{ { 7 * 8, 1 * 8 }, "NO FUN ALLOWED !", Color::red() },
|
||||
{ { 4 * 8, 4 * 8 }, "Trame:", Color::light_grey() },
|
||||
{ { 4 * 8, 6 * 8 }, "Salle:", Color::light_grey() },
|
||||
{ { 14 * 8, 6 * 8 }, "Texte:", Color::light_grey() },
|
||||
{ { 3 * 8, 8 * 8 }, "Equipe:", Color::light_grey() },
|
||||
{ { 3 * 8, 10 * 8 }, "Joueur:", Color::light_grey() }
|
||||
};
|
||||
|
||||
NumberField field_zone {
|
||||
{ 16 * 8, 8 * 8 },
|
||||
OptionsField options_trame {
|
||||
{ 10 * 8, 4 * 8 },
|
||||
16,
|
||||
{
|
||||
{ "Set pseudo", 0 },
|
||||
{ "Set equipe", 1 },
|
||||
{ "Broadcast pseudo", 2 },
|
||||
{ "Start", 3 },
|
||||
{ "Game over", 4 }
|
||||
}
|
||||
};
|
||||
|
||||
NumberField field_salle {
|
||||
{ 10 * 8, 6 * 8 },
|
||||
1,
|
||||
{ 1, 2 },
|
||||
1,
|
||||
'0'
|
||||
};
|
||||
|
||||
Button button_texte {
|
||||
{ 14 * 8, 8 * 8, 16 * 8, 3 * 8 },
|
||||
"ABCDEF"
|
||||
};
|
||||
|
||||
NumberField field_equipe {
|
||||
{ 10 * 8, 8 * 8 },
|
||||
1,
|
||||
{ 1, 6 },
|
||||
16,
|
||||
1,
|
||||
'0'
|
||||
};
|
||||
|
||||
NumberField field_joueur {
|
||||
{ 10 * 8, 10 * 8 },
|
||||
2,
|
||||
{ 1, 50 },
|
||||
1,
|
||||
'0'
|
||||
};
|
||||
|
||||
|
@ -80,13 +131,8 @@ private:
|
|||
"All channels"
|
||||
};
|
||||
|
||||
Text text_messagea {
|
||||
{ 0 * 8, 10 * 16, 30 * 8, 16 },
|
||||
""
|
||||
};
|
||||
Text text_messageb {
|
||||
{ 0 * 8, 11 * 16, 30 * 8, 16 },
|
||||
""
|
||||
Console console {
|
||||
{ 0, 18 * 8, 30 * 8, 7 * 16 }
|
||||
};
|
||||
|
||||
TransmitterView tx_view {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue