summaryrefslogtreecommitdiff
path: root/common/rawaccel-validate.hpp
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-04-13 23:59:21 -0400
committera1xd <[email protected]>2021-04-13 23:59:21 -0400
commita6926be0e911b7b7637861866f41c3bca31a87a3 (patch)
treea8d7cd5afb4c093e6f97e8d772b139dd5d749988 /common/rawaccel-validate.hpp
parentadditional fixes (diff)
downloadrawaccel-a6926be0e911b7b7637861866f41c3bca31a87a3.tar.xz
rawaccel-a6926be0e911b7b7637861866f41c3bca31a87a3.zip
move arbitrary input into settings
separate arbitrary mode from spaced modes, arbitrary now deserializes from default settings file
Diffstat (limited to 'common/rawaccel-validate.hpp')
-rw-r--r--common/rawaccel-validate.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/common/rawaccel-validate.hpp b/common/rawaccel-validate.hpp
index ef6f667..2f54b5f 100644
--- a/common/rawaccel-validate.hpp
+++ b/common/rawaccel-validate.hpp
@@ -29,13 +29,13 @@ namespace rawaccel {
auto check_accel = [&error](const accel_args& args) {
static_assert(SPACED_LUT_CAPACITY == 1025, "update error msg");
- const auto& lut_args = args.lut_args;
+ const auto& lut_args = args.spaced_args;
if (lut_args.partitions <= 0) {
error("lut partitions"" must be positive");
}
- if (lut_args.mode == table_mode::linear) {
+ if (lut_args.mode == spaced_lut_mode::linear) {
if (lut_args.start <= 0) {
error("start"" must be positive");
}
@@ -49,7 +49,7 @@ namespace rawaccel {
error("num must be between 2 and 1025");
}
}
- else if (lut_args.mode == table_mode::binlog) {
+ else if (lut_args.mode == spaced_lut_mode::binlog) {
int istart = static_cast<int>(lut_args.start);
int istop = static_cast<int>(lut_args.stop);
@@ -73,6 +73,11 @@ namespace rawaccel {
}
}
+ if (args.mode == accel_mode::arb_lookup) {
+ if (args.arb_args.length < 2) {
+ error("lookup mode requires at least 2 points");
+ }
+ }
if (args.offset < 0) {
error("offset can not be negative");