|
您好, tl-notify-ecap-test.zip 中 void ECAPIsr(void* param)程序中: value = value / 156; 其中156是怎么确定的?
8 }4 [2 Q, i& U% Q8 s9 x% A8 {* z3 x4 _# k1 g
( k8 {7 ?/ H% \# H: \( v9 V" L
void ECAPIsr(void* param)3 X$ c% ^ F' ~: A
{+ U: Q0 N Z- k3 ]7 P
unsigned int intFlag;) ~7 ^, ]+ k* ~: U* ]
int valueUpdated = 0;4 Z5 w, h. J4 l
3 e# w' x3 ?1 U5 H. Z
intFlag = ECAPIntStatus(SOC_ECAP_REGS, ECAP_CNTOVF_INT
p% E4 {* g2 u* O: k' V | ECAP_CEVT1_INT
( I8 h$ e. u) W9 o* T/ J | ECAP_CEVT2_INT
4 j4 `4 [; @9 _) E* | | ECAP_CEVT3_INT# ?! |, e" m% r- Q. H/ r
| ECAP_CEVT4_INT);
" w% c& |' r6 X/ A4 b; z9 L
+ r+ R4 X9 b2 q5 S8 W5 `) h3 M* M ECAPIntStatusClear(SOC_ECAP_REGS, intFlag);# _4 c1 K1 w" B+ y! g! u/ P* k
//IntEventClear(SYS_INT_ECAP_CHANNEL);
0 c* m c+ y5 o$ f2 o+ c5 ?9 H. E) W9 j5 W. i! y/ m; Y2 u
if(intFlag & ECAP_CEVT1_INT)* @. C! L' F) a' @% q2 `9 f! H
{2 N: R; b/ ]1 M; j: b; r
// value = ECAPTimeStampRead(SOC_ECAP_REGS, ECAP_CAPTURE_EVENT_1);
: I- W! B2 _3 G8 l% }$ W// valueUpdated = 1;4 v t! v2 S8 h7 @
}
$ I1 j8 |& p/ p if(intFlag & ECAP_CEVT2_INT)
- w/ ^9 l- i3 ^0 W( H% ]7 m {* L% `- q9 S" C: Y
value = ECAPTimeStampRead(SOC_ECAP_REGS, ECAP_CAPTURE_EVENT_2);
v! T! Y0 h- c) \ valueUpdated = 1;6 o6 v. A$ d0 S+ l4 v
}
( T" P/ i& d4 ?6 r if(intFlag & ECAP_CEVT3_INT)
! C( @* o5 e! j' E t- B {
' t3 G6 `1 O' A5 x# A// value = ECAPTimeStampRead(SOC_ECAP_REGS, ECAP_CAPTURE_EVENT_3);
. X% h; C- l! A# i9 } N// valueUpdated = 1;2 V1 V' H# e) M! ?* [9 C" I7 o
}- A7 ^: _$ H: x1 e3 \
if(intFlag & ECAP_CEVT4_INT)3 ^5 v7 N2 N8 ^1 T) L D1 _* w% e
{
8 j8 m' g0 P( N. r$ E7 j value = ECAPTimeStampRead(SOC_ECAP_REGS, ECAP_CAPTURE_EVENT_4);
" x! X; _$ z5 i. P valueUpdated = 1;( p- M+ ^3 A7 W& H" z, k" S1 Z0 u
}$ `- x3 y1 U0 T+ F
if(intFlag & ECAP_CNTOVF_INT)
% y! w. s e( g {; D4 ^+ S. o5 @1 A
ECAPCounterConfig(SOC_ECAP_REGS, 0xffffffff - 228000000);0 u6 z9 n# L0 h) Z
}, A1 W- l' y+ V
ECAPIntStatusClear(SOC_ECAP_REGS, ECAP_GLOBAL_INT);0 Q3 |/ z. ^0 b0 ]: \4 A* M7 J4 Q
$ @( l) R& Z; q if (valueUpdated)/ \# j# P# J" v6 }
value = value / 156;+ ~- Z$ U" D+ N @, l% P- O$ d
}
7 X+ x" X5 O8 \ |
|