From 34e1fe2d6bd6c1058756a2e6952f9882222e6975 Mon Sep 17 00:00:00 2001 From: Alexander B Date: Mon, 11 Mar 2019 14:54:49 +0100 Subject: [PATCH] Deactivated interrupts before all checks and enabled them after for any interrupt to fire --- Geigerzaehler/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Geigerzaehler/main.c b/Geigerzaehler/main.c index 9ed238a..a27ad14 100644 --- a/Geigerzaehler/main.c +++ b/Geigerzaehler/main.c @@ -61,11 +61,11 @@ int main() PORTB |= (boost_highVoltage_nextTick << PORTB5); // Onboard-Led - sei(); // Activate global interrupts (after checks) [when an interrupt was fired, it will now be executed] - // Endless loop while (1) { + cli(); // Deactivate global interrupts (before checks) + /* * HighVoltage boosting */ @@ -123,6 +123,8 @@ int main() if(signalOutput_led_nextTick == 0) signalOutput_led_nextTick++; // If its 0, it stops, we dont want that } } + + sei(); // Activate global interrupts (after checks) [when an interrupt was fired, it will now be executed] } }