summaryrefslogtreecommitdiff
path: root/globals.c
diff options
context:
space:
mode:
Diffstat (limited to 'globals.c')
-rw-r--r--globals.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/globals.c b/globals.c
index 5948a79..d62b818 100644
--- a/globals.c
+++ b/globals.c
@@ -26,6 +26,9 @@ GlobalStruct globals = {
};
+PwlStruct pwl_struct[pwl_max_types][max_channels];
+
+
long sec_timer (void)
{
return (long)time(NULL);
@@ -43,3 +46,18 @@ unsigned long long ms_timer (void)
return millisecondsSinceEpoch;
}
+
+const char* param_name[] = { "AMPL", "OS", "PW", "DELAY", "PERIOD", "BURST", "RISE", "SLEW", "DISTORT" };
+
+void debug_new_parameter (int channel, int parameter, float requested)
+{
+ g_print_debug("chan %d, %s, requested %e, adjusted %e, polarity %d, range %d, word %d, aux %d, atten %d\n",
+ channel, param_name[parameter], requested,
+ pwl_struct[parameter][channel].actual_value,
+ pwl_struct[parameter][channel].actual_pol,
+ pwl_struct[parameter][channel].range,
+ pwl_struct[parameter][channel].word_out,
+ pwl_struct[parameter][channel].word_out_aux,
+ pwl_struct[parameter][channel].atten_range);
+}
+