summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-05-29 20:48:56 +0200
committerMichael Buesch <mb@bu3sch.de>2009-05-29 20:48:56 +0200
commit76aae654108d525330438951c3bc40918ffc7efa (patch)
tree8fea06b2ff830f6ffda049648fa525c265addca3 /pressure_control/firmware
parent427335c5264794d980623f0aa308d6e0b3ff0042 (diff)
downloadcnc-76aae654108d525330438951c3bc40918ffc7efa.tar.xz
cnc-76aae654108d525330438951c3bc40918ffc7efa.zip
Remove BUG_ON pointer assertion
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control/firmware')
-rw-r--r--pressure_control/firmware/sensor.c6
-rw-r--r--pressure_control/firmware/util.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/pressure_control/firmware/sensor.c b/pressure_control/firmware/sensor.c
index bf48fb2..08eca77 100644
--- a/pressure_control/firmware/sensor.c
+++ b/pressure_control/firmware/sensor.c
@@ -36,8 +36,6 @@ ISR(ADC_vect)
const uint16_t full_scale_adc = ADC_MAX * (uint32_t)s->full_scale_mv / 5000;
uint16_t adc, mv, mbar;
- BUG_ON(!active_sensor);
-
/* Convert the ADC value to millivolts. */
adc = ADC;
if (adc > full_scale_adc)
@@ -52,8 +50,7 @@ ISR(ADC_vect)
mbar = (uint32_t)s->full_scale_mbar * (uint32_t)mv / (uint32_t)s->full_scale_mv;
- sensor_result(active_sensor, mbar);
- active_sensor = NULL;
+ sensor_result(s, mbar);
}
static inline void adc_trigger(uint8_t mux, bool with_irq)
@@ -69,7 +66,6 @@ static inline void adc_trigger(uint8_t mux, bool with_irq)
void sensor_trigger_read(struct sensor *s)
{
- BUG_ON(active_sensor);
active_sensor = s;
mb();
/* Trigger an ADC conversion with interrupt notification. */
diff --git a/pressure_control/firmware/util.c b/pressure_control/firmware/util.c
index 241fc19..0b0bbab 100644
--- a/pressure_control/firmware/util.c
+++ b/pressure_control/firmware/util.c
@@ -19,6 +19,7 @@
#include "util.h"
#include "calibration.h"
+#include "remote.h"
#include <util/crc16.h>
#include <avr/io.h>
@@ -74,7 +75,7 @@ void udelay(uint16_t usecs)
void panic(const prog_char *msg)
{
-//TODO
+ print("Panic!");
infinite_sleep();
}
bues.ch cgit interface