Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue #109 clear interrupt, Issue #110 remove floar operation

  • Loading branch information...
commit 42c17ed64df1e72e308424c0939c023ca6a3cf5d 1 parent e1de2e5
@ricklon ricklon authored
View
4 .gitignore
@@ -1 +1,3 @@
-.DS_Store
+.DS_Store
+.svn
+
View
12 hardware/pic32/cores/pic32/WInterrupts.c
@@ -29,6 +29,8 @@
//************************************************************************
//* Oct 15, 2010 <MLS> Started on WInterrupts.c for Pic32
//* Aug 8, 2011 <GeneApperson> completely rewritten (issue #75)
+//* Aug 30, 2011 <GeneApperson> clear interrupt flag after return from
+//* user interrupt function (issue #109)
//************************************************************************
#include <plib.h>
@@ -160,11 +162,11 @@ void detachInterrupt(uint8_t interruptNum)
void __ISR(_EXTERNAL_0_VECTOR, ipl4) ExtInt0Handler(void)
{
- IFS0bits.INT0IF = 0;
if (intFunc[0] != 0)
{
(*intFunc[0])();
}
+ IFS0bits.INT0IF = 0;
}
//************************************************************************
@@ -172,11 +174,11 @@ void __ISR(_EXTERNAL_0_VECTOR, ipl4) ExtInt0Handler(void)
void __ISR(_EXTERNAL_1_VECTOR, ipl4) ExtInt1Handler(void)
{
- IFS0bits.INT1IF = 0;
if (intFunc[1] != 0)
{
(*intFunc[1])();
}
+ IFS0bits.INT1IF = 0;
}
//************************************************************************
@@ -184,11 +186,11 @@ void __ISR(_EXTERNAL_1_VECTOR, ipl4) ExtInt1Handler(void)
void __ISR(_EXTERNAL_2_VECTOR, ipl4) ExtInt2Handler(void)
{
- IFS0bits.INT2IF = 0;
if (intFunc[2] != 0)
{
(*intFunc[2])();
}
+ IFS0bits.INT2IF = 0;
}
//************************************************************************
@@ -196,11 +198,11 @@ void __ISR(_EXTERNAL_2_VECTOR, ipl4) ExtInt2Handler(void)
void __ISR(_EXTERNAL_3_VECTOR, ipl4) ExtInt3Handler(void)
{
- IFS0bits.INT3IF = 0;
if (intFunc[3] != 0)
{
(*intFunc[3])();
}
+ IFS0bits.INT3IF = 0;
}
//************************************************************************
@@ -208,11 +210,11 @@ void __ISR(_EXTERNAL_3_VECTOR, ipl4) ExtInt3Handler(void)
void __ISR(_EXTERNAL_4_VECTOR, ipl4) ExtInt4Handler(void)
{
- IFS0bits.INT4IF = 0;
if (intFunc[4] != 0)
{
(*intFunc[4])();
}
+ IFS0bits.INT4IF = 0;
}
//************************************************************************
View
4 hardware/pic32/libraries/Servo/Servo.cpp
@@ -48,8 +48,8 @@ extern "C"{
#include "int.h"
}
-#define usToTicks(_us) (1.25* _us) // converts microseconds to tick
-#define ticksToUs(_ticks) ( (unsigned)_ticks/1.25) // converts from ticks back to microseconds
+#define usToTicks(_us) (((_us)*5)/4) // converts microseconds to tick
+#define ticksToUs(_ticks) ((((unsigned)(_ticks))*4)/5) // converts from ticks back to microseconds
#define TRIM_DURATION 2 // compensation ticks to trim adjust for digitalWrite delays // 12 August 200
Please sign in to comment.
Something went wrong with that request. Please try again.