Skip to content

Commit

Permalink
[server] support waveform config for 3.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
okay committed Aug 13, 2023
1 parent cc1ddd4 commit 4412f33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/shared/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ shutdown addr 0x55b494
wait addr 0x55a39c
getInstance addr 0x54eeac
notify addr 0x558464
waveformClass str EPFramebuffer::Waveform
)CONF";

Expand Down
15 changes: 14 additions & 1 deletion src/shared/swtfb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class SwtFB {
const int maxWidth = 1404;
const int maxHeight = 1872;

std::string WAVEFORM_MODE = "";

public:
SwtFB()
: config(read_config()) {}
Expand All @@ -38,6 +40,17 @@ class SwtFB {
void* address = std::get<void*>(search->second);
f_getInstance = (uint32_t * (*)(void)) address;
std::cerr << "getInstance() at address: " << address << '\n';


auto waveformMode = config.find("waveformClass");
if (waveformMode != config.end()) {
std::cerr << "Found waveform class " << std::endl;
WAVEFORM_MODE = std::get<string>(waveformMode->second);
} else {
WAVEFORM_MODE = string{"EPFramebuffer::WaveformMode"};
}
std::cerr << "Using waveform mode " << WAVEFORM_MODE << std::endl;

return true;
}

Expand All @@ -64,7 +77,7 @@ class SwtFB {

void SendUpdate(const QRect &rect, int waveform, int flags) const {
// Method idx == 1
QGenericArgument argWaveform("EPFramebuffer::WaveformMode", &waveform);
QGenericArgument argWaveform(WAVEFORM_MODE.c_str(), &waveform);
QGenericArgument argUpdateMode("EPFramebuffer::UpdateFlags", &flags);
QMetaObject::invokeMethod(instance, "sendUpdate", Qt::DirectConnection,
Q_ARG(QRect, rect), argWaveform, argUpdateMode);
Expand Down

0 comments on commit 4412f33

Please sign in to comment.