a fork of priustroller

Dependencies:   mbed

Fork of priustroller_current by N K

Revision:
31:86b87913d8e1
Parent:
30:2b6d426f3bfc
Child:
32:4e1a223fad52
--- a/main.cpp	Sun Mar 15 01:45:22 2015 +0000
+++ b/main.cpp	Sun Mar 15 02:21:32 2015 +0000
@@ -6,30 +6,14 @@
 #include "meta.h"
 #include "sensors.h"
 #include "callbacks.h"
+#include "isr.h"
 
 volatile unsigned short global_ib, global_ic;
 uint32_t channel_ib, channel_ic;
 
-extern "C" void TIM2_Derpy_Handler()
-{
-    TIM2->SR &= ~1;
-    ADC1->SQR1 &= ~ADC_SQR1_L;
-    ADC1->SQR3 = 0;
-    ADC1->SQR3 |= channel_ib;
-    ADC1->CR2 |= ADC_CR2_SWSTART;
-    while ((ADC1->SR & 2) == 0){}
-    global_ib = ADC1->DR;
-    
-    ADC1->SQR3 = 0;
-    ADC1->SQR3 |= channel_ic;
-    ADC1->CR2 |= ADC_CR2_SWSTART;
-    while ((ADC1->SR & 2) == 0){}
-    global_ic = ADC1->DR;
-} 
-
 int main() { 
     NVIC_EnableIRQ(TIM2_IRQn);
-    NVIC_SetVector(TIM2_IRQn, (uint32_t)TIM2_Derpy_Handler);
+    NVIC_SetVector(TIM2_IRQn, (uint32_t)TIM2_IRQn_Handler);
         
     Context *context = new Context();
     context->ConfigureOutputs(D6, D13, D3, D8);