Skip to content

Instantly share code, notes, and snippets.

@LuckyResistor
Created August 31, 2018 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LuckyResistor/57af62aeeee54990b0c0be2ee3dde660 to your computer and use it in GitHub Desktop.
Save LuckyResistor/57af62aeeee54990b0c0be2ee3dde660 to your computer and use it in GitHub Desktop.
Compressed Example for a Simple Wrapper
// LevelMeter.h:
#pragma once
#include <cstdint>
namespace lr {
namespace LevelMeter {
uint8_t getValue();
}
}
// LevelMeter.cpp
#include "LevelMeter.h" // first!
#include "haxor_lvl_mtrV9.h" // bad code... :-P
namespace lr {
namespace LevelMeter {
uint8_t getValue()
{
struct LVL_METER_VALUE value;
auto result = haxor_level_mrt_get_value(&value, nullptr, nullptr, nullptr, 1, 8, 9, nullptr);
if (result != 1) {
return 0;
} else {
return value.z.value.w;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment