Test Elapsed time based on CTimer module

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Test Elapsed time based on CTimer module

Test Elapsed time based on CTimer module

Test Elapsed time based on CTimer module

 

Sometimes, It is required to test the time which an api function takes when the function is executed, for example, some users want to test the flash erasing time and flash programming time. User can use GPIO to set/clear and use scope to test the GPIO timing to measure the time an api function takes, the method is very simple and straightforward but inaccurate.

The document describes to configure CTimer as a 32bits  free-running counter, user can read the counter value before and after an api function and compute the counter value difference to get the time the api function takes.

The CTimer of LPC54xxx family counts the APB bus clock, the APB bus clock Is driven by 12 MHz FRO, user can use the following code to measure the elapsed time.

For example, we test the elaped time of  delayTimer(10000); function, we get the variable tPoint1, tPoint2. The actual time is (tPoint2- tPoint1)*(1/12000000).

In the example, the tPoint2=110127, the tPoint1=53, the elapsed time is (110127-53)*(1/12000000)=9.172us.

pastedImage_3.png

//the souce code focuses on LPC54xxx family

uint32_t tPoint1,tPoint2,tPoint3,tDiff;

void test(void)

{

    tPoint1=CTIMER_GetTimerCountValue(CTIMER2);

    //simulate elapsed time

    delayTimer(10000);

    tPoint2=CTIMER_GetTimerCountValue(CTIMER2);

    tDiff=tPoint2-tPoint1;

 

    //simulate elapsed time

    delayTimer(20000);

    tPoint3=CTIMER_GetTimerCountValue(CTIMER2);

    tDiff=tPoint3-tPoint2;

     PRINTF("Time instand:tPoint1=%d, tPoint2=%d, tPoint3=%d \r\n",tPoint1,tPoint2,tPoint3);

}

Snippet of simple source code based on MCUXpresso tools and LPC54618 board developed by XiangJun Rong

#include "fsl_ctimer.h"

void test(void);

void CTimerInit(void);

void delayTimer(uint32_t elapsedTimer);

uint32_t tPoint1,tPoint2,tPoint3,tDiff;

void CTimerInit(void)

{

    ctimer_config_t config;

    ctimer_match_config_t matchConfig;

    /*CTimer use APB bus clock as Timer tick, set the APB bus clock as 12MHz internal FRO */

     CLOCK_AttachClk(kFRO12M_to_ASYNC_APB);

    CTIMER_GetDefaultConfig(&config);

 

    CTIMER_Init(CTIMER2, &config);

 

    matchConfig.enableCounterReset = true;

    matchConfig.enableCounterStop = false;

    matchConfig.matchValue = 0xFFFFFFFF;

    matchConfig.outControl = kCTIMER_Output_NoAction;

    matchConfig.outPinInitState = true;

    matchConfig.enableInterrupt = false;

    CTIMER_SetupMatch(CTIMER2, kCTIMER_Match_3, &matchConfig);

    CTIMER_StartTimer(CTIMER2);

}

 

void test(void)

{

    tPoint1=CTIMER_GetTimerCountValue(CTIMER2);

    //simulate elapsed time

    delayTimer(10000);

    tPoint2=CTIMER_GetTimerCountValue(CTIMER2);

    tDiff=tPoint2-tPoint1;

 

    //simulate elapsed time

    delayTimer(20000);

    tPoint3=CTIMER_GetTimerCountValue(CTIMER2);

    tDiff=tPoint3-tPoint2;

     PRINTF("Time instand:tPoint1=%d, tPoint2=%d, tPoint3=%d \r\n",tPoint1,tPoint2,tPoint3);

}

 

void delayTimer(uint32_t elapsedTimer)

{

    uint32_t i;

    for(i=0; i<elapsedTimer; i++)

    {

        __asm("nop");

    }

}

 

int main(void)

{

   …………………………………………………………………………………………………..

    PRINTF("Elapse time test start: \r\n");

    CTimerInit();

    test();

    for(;;) {}

…………………………………………

}

 

标记 (2)
%3CLINGO-SUB%20id%3D%22lingo-sub-1117051%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9F%BA%E4%BA%8ECTimer%E6%A8%A1%E5%9D%97%E6%B5%8B%E8%AF%95%E8%BF%90%E8%A1%8C%E6%97%B6%E9%97%B4%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1117051%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3Dutf-8%22%20%2F%26gt%3B%0A%3CP%3E%3CSPAN%3E%E5%9F%BA%E4%BA%8ECTimer%E6%A8%A1%E5%9D%97%E6%B5%8B%E8%AF%95%E8%BF%90%E8%A1%8C%E6%97%B6%E9%97%B4%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E6%9C%89%E6%97%B6%EF%BC%8C%E9%9C%80%E8%A6%81%E6%B5%8B%E8%AF%95%E6%9F%90%E4%B8%AAapi%E5%87%BD%E6%95%B0%E6%89%A7%E8%A1%8C%E6%97%B6%E6%89%80%E8%8A%B1%E8%B4%B9%E7%9A%84%E6%97%B6%E9%97%B4%EF%BC%8C%E4%BE%8B%E5%A6%82%EF%BC%8C%E6%9C%89%E4%BA%9B%E7%94%A8%E6%88%B7%E6%83%B3%E6%B5%8B%E8%AF%95flash%E6%93%A6%E9%99%A4%E6%97%B6%E9%97%B4%E5%92%8Cflash%E7%BC%96%E7%A8%8B%E6%97%B6%E9%97%B4%E3%80%82%E7%94%A8%E6%88%B7%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8GPIO%E6%9D%A5%E8%AE%BE%E7%BD%AE%2F%E6%B8%85%E9%99%A4%EF%BC%8C%E5%B9%B6%E4%BD%BF%E7%94%A8%E7%A4%BA%E6%B3%A2%E5%99%A8%E6%9D%A5%E6%B5%8B%E8%AF%95GPIO%E6%97%B6%E5%BA%8F%E6%9D%A5%E6%B5%8B%E9%87%8Fapi%E5%87%BD%E6%95%B0%E6%89%80%E8%8A%B1%E8%B4%B9%E7%9A%84%E6%97%B6%E9%97%B4%EF%BC%8C%E8%AF%A5%E6%96%B9%E6%B3%95%E9%9D%9E%E5%B8%B8%E7%AE%80%E5%8D%95%E7%9B%B4%E6%8E%A5%E4%BD%86%E4%B8%8D%E5%87%86%E7%A1%AE%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E6%96%87%E6%A1%A3%E4%BB%8B%E7%BB%8D%E5%A6%82%E4%BD%95%E5%B0%86%20CTimer%20%E9%85%8D%E7%BD%AE%E4%B8%BA%E4%B8%80%E4%B8%AA%2032%20%E4%BD%8D%E8%87%AA%E7%94%B1%E8%BF%90%E8%A1%8C%E8%AE%A1%E6%95%B0%E5%99%A8%EF%BC%8C%E7%94%A8%E6%88%B7%E5%8F%AF%E4%BB%A5%E8%AF%BB%E5%8F%96%20api%20%E5%87%BD%E6%95%B0%E5%89%8D%E5%90%8E%E7%9A%84%E8%AE%A1%E6%95%B0%E5%99%A8%E5%80%BC%EF%BC%8C%E5%B9%B6%E8%AE%A1%E7%AE%97%E8%AE%A1%E6%95%B0%E5%99%A8%E5%80%BC%E5%B7%AE%E4%BB%A5%E8%8E%B7%E5%8F%96%20api%20%E5%87%BD%E6%95%B0%E6%89%80%E8%8A%B1%E8%B4%B9%E7%9A%84%E6%97%B6%E9%97%B4%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ELPC54xxx%E7%B3%BB%E5%88%97%E7%9A%84CTimer%E5%AF%B9APB%E6%80%BB%E7%BA%BF%E6%97%B6%E9%92%9F%E8%BF%9B%E8%A1%8C%E8%AE%A1%E6%95%B0%EF%BC%8CAPB%E6%80%BB%E7%BA%BF%E6%97%B6%E9%92%9F%E7%94%B112MHz%20FRO%E9%A9%B1%E5%8A%A8%EF%BC%8C%E7%94%A8%E6%88%B7%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E4%BB%A5%E4%B8%8B%E4%BB%A3%E7%A0%81%E6%9D%A5%E6%B5%8B%E9%87%8F%E7%BB%8F%E8%BF%87%E7%9A%84%E6%97%B6%E9%97%B4%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E4%BE%8B%E5%A6%82%E6%B5%8B%E8%AF%95%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EdelayTimer(10000)%3B%E5%87%BD%E6%95%B0%E7%9A%84%E8%80%97%E6%97%B6%EF%BC%8C%E5%BE%97%E5%88%B0%E5%8F%98%E9%87%8FtPoint1%EF%BC%8CtPoint2%EF%BC%8C%E5%AE%9E%E9%99%85%E8%80%97%E6%97%B6%E4%B8%BA(tPoint2-%20tPoint1)*(1%2F12000000)%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E4%BE%8B%E5%AD%90%E4%B8%AD%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtPoint2%3D110127%EF%BC%8CtPoint1%3D53%EF%BC%8C%E5%88%99%E7%BB%8F%E8%BF%87%E7%9A%84%E6%97%B6%E9%97%B4%E4%B8%BA%EF%BC%88110127-53%EF%BC%89*%EF%BC%881%2F12000000%EF%BC%89%3D9.172us%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_3.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_3.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F85534i4BBC283B866FADD1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_3.png%22%20alt%3D%22pastedImage_3.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%2F%2F%E6%BA%90%E4%BB%A3%E7%A0%81%E4%B8%BB%E8%A6%81%E5%85%B3%E6%B3%A8LPC54xxx%E7%B3%BB%E5%88%97%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%20background%3A%20blue%3B%22%3Euint32_t%20tPoint1%E3%80%81tPoint2%E3%80%81tPoint3%E3%80%81tDiff%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3Etest%3C%2FSTRONG%3E(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtPoint1%20%3D%20CTIMER_GetTimerCountValue(CTIMER2)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%E6%A8%A1%E6%8B%9F%E7%BB%8F%E8%BF%87%E7%9A%84%E6%97%B6%E9%97%B4%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%E5%BB%B6%E8%BF%9F%E8%AE%A1%E6%97%B6%E5%99%A8%EF%BC%8810000%EF%BC%89%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtPoint2%20%3D%20CTIMER_GetTimerCountValue(CTIMER2)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtDiff%3DtPoint2-tPoint1%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%E6%A8%A1%E6%8B%9F%E7%BB%8F%E8%BF%87%E7%9A%84%E6%97%B6%E9%97%B4%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%E5%BB%B6%E8%BF%9F%E8%AE%A1%E6%97%B6%E5%99%A8%EF%BC%8820000%EF%BC%89%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtPoint3%20%3D%20CTIMER_GetTimerCountValue(CTIMER2)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtDiff%3DtPoint3-tPoint2%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EPRINTF(%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22%E6%97%B6%E9%97%B4%E5%AE%9E%E4%BE%8B%3AtPoint1%3D%25d%2CtPoint2%3D%25d%2CtPoint3%3D%25d%20%5Cr%5Cn%22%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2CtPoint1%2CtPoint2%2CtPoint3)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E5%9F%BA%E4%BA%8E%20MCUXpresso%20%E5%B7%A5%E5%85%B7%E5%92%8C%20LPC54618%20%E5%BC%80%E5%8F%91%E6%9D%BF%E7%9A%84%E7%AE%80%E5%8D%95%E6%BA%90%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5%EF%BC%8C%E7%94%B1%20XiangJun%20Rong%20%E5%BC%80%E5%8F%91%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%23%E5%8C%85%E6%8B%AC%E2%80%9Cfsl_ctimer.h%E2%80%9D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3Etest%3C%2FSTRONG%3E(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3ECTimerInit%3C%2FSTRONG%3E(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3EdelayTimer%3C%2FSTRONG%3E(uint32_t%20elapsedTimer)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3Euint32_t%20tPoint1%E3%80%81tPoint2%E3%80%81tPoint3%E3%80%81tDiff%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3ECTimerInit%3C%2FSTRONG%3E(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ctimer_config_t%20config%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Ectimer_match_config_t%20%E5%8C%B9%E9%85%8D%E9%85%8D%E7%BD%AE%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*CTimer%E4%BD%BF%E7%94%A8APB%E6%80%BB%E7%BA%BF%E6%97%B6%E9%92%9F%E4%BD%9C%E4%B8%BATimer%20tick%EF%BC%8C%E8%AE%BE%E7%BD%AEAPB%E6%80%BB%E7%BA%BF%E6%97%B6%E9%92%9F%E4%B8%BA12MHz%E5%86%85%E9%83%A8FRO%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CLOCK_AttachClk(kFRO12M_to_ASYNC_APB)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CTIMER_GetDefaultConfig(%26amp%3Bconfig)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CTIMER_Init(CTIMER2%2C%20%26amp%3Bconfig)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EmatchConfig.enableCounterReset%20%3D%20true%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EmatchConfig.enableCounterStop%20%3D%20false%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EmatchConfig.matchValue%20%3D%200xFFFFFFFF%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EmatchConfig.outControl%20%3D%20kCTIMER_Output_NoAction%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EmatchConfig.outPinInitState%20%3D%20true%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EmatchConfig.enableInterrupt%20%3D%20false%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CTIMER_SetupMatch(CTIMER2%2C%20kCTIMER_Match_3%2C%20%26amp%3BmatchConfig)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3ECTIMER_StartTimer%EF%BC%88CTIMER2%EF%BC%89%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3Etest%3C%2FSTRONG%3E(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtPoint1%20%3D%20CTIMER_GetTimerCountValue(CTIMER2)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%E6%A8%A1%E6%8B%9F%E7%BB%8F%E8%BF%87%E7%9A%84%E6%97%B6%E9%97%B4%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%E5%BB%B6%E8%BF%9F%E8%AE%A1%E6%97%B6%E5%99%A8%EF%BC%8810000%EF%BC%89%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtPoint2%20%3D%20CTIMER_GetTimerCountValue(CTIMER2)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtDiff%3DtPoint2-tPoint1%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2F%E6%A8%A1%E6%8B%9F%E7%BB%8F%E8%BF%87%E7%9A%84%E6%97%B6%E9%97%B4%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%E5%BB%B6%E8%BF%9F%E8%AE%A1%E6%97%B6%E5%99%A8%EF%BC%8820000%EF%BC%89%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtPoint3%20%3D%20CTIMER_GetTimerCountValue(CTIMER2)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EtDiff%3DtPoint3-tPoint2%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EPRINTF(%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22%E6%97%B6%E9%97%B4%E5%AE%9E%E4%BE%8B%3AtPoint1%3D%25d%2CtPoint2%3D%25d%2CtPoint3%3D%25d%20%5Cr%5Cn%22%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2CtPoint1%2CtPoint2%2CtPoint3)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Evoid%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3EdelayTimer%3C%2FSTRONG%3E(uint32_t%20elapsedTimer)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20uint32_t%20i%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Efor%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(i%3D0%3B%20i%3CELAPSEDTIMER%3E%3C%2FELAPSEDTIMER%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3E__asm%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%EF%BC%88%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%E2%80%9C%20%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3Enop%3C%2FSPAN%3E%20%E2%80%9D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%EF%BC%89%EF%BC%9B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Eint%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CSTRONG%3Emain%3C%2FSTRONG%3E%20%EF%BC%88%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3E%E6%97%A0%E6%95%88%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%EF%BC%89%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%20%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6..%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3EPRINTF(%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22%E7%BB%8F%E8%BF%87%E6%97%B6%E9%97%B4%E6%B5%8B%E8%AF%95%E5%BC%80%E5%A7%8B%3A%5Cr%5Cn%22%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CTimerInit()%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20test()%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%20%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%20%22%3Efor%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(%3B%3B)%20%7B%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%E2%80%A6%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
无评分
版本历史
最后更新:
‎06-06-2019 02:30 AM
更新人: