aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-07-10 08:57:18 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-07-10 08:57:18 +0200
commit16367c2a9da68c6c813537ea905a227864aec30f (patch)
treec7b8a184bf9cbba7ff0646eb8780f7a6768d4e81
parentccecb8267756fbb63b1729193a0f87079f2d7896 (diff)
downloadglutte-o-matic-16367c2a9da68c6c813537ea905a227864aec30f.tar.gz
glutte-o-matic-16367c2a9da68c6c813537ea905a227864aec30f.tar.bz2
glutte-o-matic-16367c2a9da68c6c813537ea905a227864aec30f.zip
Invert REPLIE signal in software
-rw-r--r--doc/pio.txt8
-rw-r--r--src/common/includes/GPIO/pio.h5
-rw-r--r--src/glutt-o-logique/pio.c8
-rw-r--r--src/simulator/src/GPIO/pio.c4
-rw-r--r--src/simulator/src/Gui/gui.c10
5 files changed, 15 insertions, 20 deletions
diff --git a/doc/pio.txt b/doc/pio.txt
index f536171..ed1f2f8 100644
--- a/doc/pio.txt
+++ b/doc/pio.txt
@@ -12,15 +12,15 @@ Connexions Relais
- in U PC8
- out QRP PC9
- in D PC11
-- in REPLIE_n PC13
+- in REPLIE PC13
- in FAX_n PC14
- out GPS EPPS PC15
- i/o Dallas 1-wire PA1
-TODO Analog signals
--------------------
-- in f_0 deviation
+Analog signals
+--------------
+- in f_0 deviation unused
- in Vcc 12V PA5 (ADC12 IN5)
- in SWR forward PA6 (ADC12 IN6)
- in SWR reflected PA7 (ADC12 IN7)
diff --git a/src/common/includes/GPIO/pio.h b/src/common/includes/GPIO/pio.h
index 6f047f9..a9a506d 100644
--- a/src/common/includes/GPIO/pio.h
+++ b/src/common/includes/GPIO/pio.h
@@ -29,16 +29,11 @@
#include <stdint.h>
#include "Core/fsm.h"
-/* Analog inputs */
-// TODO: SWR forward power
-// TODO: SWR reflected power
-
void pio_init(void);
void pio_set_tx(int on);
void pio_set_mod_off(int mod_off);
void pio_set_qrp(int on);
-
void pio_set_gps_epps(int on);
void pio_set_fsm_signals(struct fsm_input_signals_t* sig);
diff --git a/src/glutt-o-logique/pio.c b/src/glutt-o-logique/pio.c
index 003b50b..7220b80 100644
--- a/src/glutt-o-logique/pio.c
+++ b/src/glutt-o-logique/pio.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2015 Matthias P. Braendli
+ * Copyright (c) 2016 Matthias P. Braendli
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,7 +36,7 @@
#define GPIO_PIN_U GPIO_Pin_8
#define GPIO_PIN_QRP_out GPIO_Pin_9
#define GPIO_PIN_D GPIO_Pin_11
-#define GPIO_PIN_REPLIE_n GPIO_Pin_13
+#define GPIO_PIN_REPLIE GPIO_Pin_13
#define GPIO_PIN_FAX GPIO_Pin_14
#define GPIO_PIN_GPS_EPPS GPIO_Pin_15
@@ -57,7 +57,7 @@
GPIO_PIN_SQ_n | \
GPIO_PIN_U | \
GPIO_PIN_D | \
- GPIO_PIN_REPLIE_n | \
+ GPIO_PIN_REPLIE | \
GPIO_PIN_FAX | \
0 )
@@ -146,7 +146,7 @@ void read_fsm_input_task(void __attribute__ ((unused))*pvParameters)
GPIO_ReadInputDataBit(GPIOC, GPIO_PIN_D) ? 1 : 0;
pio_signals.wind_generator_ok =
- GPIO_ReadInputDataBit(GPIOC, GPIO_PIN_REPLIE_n) ? 1 : 0;
+ GPIO_ReadInputDataBit(GPIOC, GPIO_PIN_REPLIE) ? 0 : 1;
pio_signals.sstv_mode =
GPIO_ReadInputDataBit(GPIOC, GPIO_PIN_FAX) ? 1 : 0;
diff --git a/src/simulator/src/GPIO/pio.c b/src/simulator/src/GPIO/pio.c
index 4aa013b..a8622c2 100644
--- a/src/simulator/src/GPIO/pio.c
+++ b/src/simulator/src/GPIO/pio.c
@@ -35,7 +35,7 @@ extern int gui_in_1750_n;
extern int gui_in_sq_n;
extern int gui_in_u;
extern int gui_in_d;
-extern int gui_in_replie_n;
+extern int gui_in_replie;
extern int gui_in_fax_n;
extern char led_gps;
@@ -65,7 +65,7 @@ void pio_set_fsm_signals(struct fsm_input_signals_t* sig) {
sig->sq = gui_in_sq_n ? 0 : 1;
sig->discrim_u = gui_in_u ? 1 : 0;
sig->discrim_d = gui_in_d ? 1 : 0;
- sig->wind_generator_ok = gui_in_replie_n ? 1 : 0;
+ sig->wind_generator_ok = gui_in_replie ? 0 : 1;
sig->sstv_mode = gui_in_fax_n ? 0 : 1;
}
diff --git a/src/simulator/src/Gui/gui.c b/src/simulator/src/Gui/gui.c
index 457248f..2e5c3f0 100644
--- a/src/simulator/src/Gui/gui.c
+++ b/src/simulator/src/Gui/gui.c
@@ -152,8 +152,8 @@ int gui_in_1750_n = 1;
int gui_in_sq_n = 1;
int gui_in_u = 0;
int gui_in_d = 0;
-int gui_in_replie_n = 1;
-static const char *replie_status[] = {"RepliƩ", "In vent"};
+int gui_in_replie = 0;
+static const char *replie_status[] = {"In vent", "RepliƩ"};
int gui_in_fax_n = 1;
int in_button = 0;
@@ -830,15 +830,15 @@ void main_gui() {
gui_in_fax_n = in_fax_n;
}
- if (gui_in_replie_n) {
+ if (gui_in_replie) {
c = color_on;
} else {
c = color_off;
}
nk_layout_row_dynamic(ctx, 18, 2);
- nk_label_colored(ctx, "REPLIE_n", NK_TEXT_LEFT, c);
- gui_in_replie_n = nk_combo(ctx, replie_status, LEN(replie_status), gui_in_replie_n, 30);
+ nk_label_colored(ctx, "REPLIE", NK_TEXT_LEFT, c);
+ gui_in_replie = nk_combo(ctx, replie_status, LEN(replie_status), gui_in_replie, 30);
nk_label_colored(ctx, "Voltage", NK_TEXT_LEFT, c);
nk_property_float(ctx, "V", 0.0f, &gui_measured_voltage, 24.0f, 0.5f, 0.5f);