Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: interrupts.cpp
- Revision:
- 83:eb3704d4943f
- Parent:
- 82:5e741c5ffd9f
--- a/interrupts.cpp Fri Mar 10 08:29:13 2017 +0000
+++ b/interrupts.cpp Sat Mar 11 08:51:04 2017 +0000
@@ -1,4 +1,5 @@
#include "globals.h"
+#include "main.h"
#include "CommandProcessor.h"
char linebuf[128];
@@ -24,4 +25,19 @@
io.pc->putc('>');
}
}
+}
+
+extern "C" void TIM1_UP_TIM10_IRQHandler(void) {
+ int start_state = io.throttle_in->state();
+ if (TIM1->SR & TIM_SR_UIF ) {
+ ADC1->CR2 |= 0x40000000;
+ volatile int delay;
+ for (delay = 0; delay < 35; delay++);
+ read.adval1 = ADC1->DR;
+ read.adval2 = ADC2->DR;
+ commutate();
+ }
+ TIM1->SR = 0x00;
+ int end_state = io.throttle_in->state();
+ if (start_state != end_state) io.throttle_in->block();
}
\ No newline at end of file