bsp.lst
来自「stm32+ucos-ii」· LST 代码 · 共 982 行 · 第 1/4 页
LST
982 行
469 * Argument(s) : none.
470 *
471 * Return(s) : none.
472 *
473 * Caller(s) : OSProbe_Init().
474 *
475 * Note(s) : none.
476 *********************************************************************************************************
477 */
478
479 #if ((APP_CFG_PROBE_OS_PLUGIN_EN == DEF_ENABLED) && \
480 (OS_PROBE_HOOKS_EN == 1))
481 void OSProbe_TmrInit (void)
482 {
483 }
484 #endif
485
486
487 /*
488 *********************************************************************************************************
489 * OSProbe_TmrRd()
490 *
491 * Description : Read the current counts of a free running timer.
492 *
493 * Argument(s) : none.
494 *
495 * Return(s) : The 32-bit timer counts.
496 *
497 * Caller(s) : OSProbe_TimeGetCycles().
498 *
499 * Note(s) : none.
500 *********************************************************************************************************
501 */
502
503 #if ((APP_CFG_PROBE_OS_PLUGIN_EN == DEF_ENABLED) && \
504 (OS_PROBE_HOOKS_EN == 1))
505 CPU_INT32U OSProbe_TmrRd (void)
506 {
507 return ((CPU_INT32U)DWT_CYCCNT);
508 }
509 #endif
510
511
512 /*$PAGE*/
513 /*
514 *********************************************************************************************************
515 * CPU_TS_TmrInit()
516 *
517 * Description : Initialize & start CPU timestamp timer.
518 *
519 * Argument(s) : none.
520 *
521 * Return(s) : none.
522 *
523 * Caller(s) : CPU_TS_Init().
524 *
525 * This function is an INTERNAL CPU module function & MUST be implemented by application/
526 * BSP function(s) [see Note #1] but MUST NOT be called by application function(s).
527 *
528 * Note(s) : (1) CPU_TS_TmrInit() is an application/BSP function that MUST be defined by the developer
529 * if either of the following CPU features is enabled :
530 *
531 * (a) CPU timestamps
532 * (b) CPU interrupts disabled time measurements
533 *
534 * See 'cpu_cfg.h CPU TIMESTAMP CONFIGURATION Note #1'
535 * & 'cpu_cfg.h CPU INTERRUPTS DISABLED TIME MEASUREMENT CONFIGURATION Note #1a'.
536 *
537 * (2) (a) Timer count values MUST be returned via word-size-configurable 'CPU_TS_TMR'
538 * data type.
539 *
540 * (1) If timer has more bits, truncate timer values' higher-order bits greater
541 * than the configured 'CPU_TS_TMR' timestamp timer data type word size.
542 *
543 * (2) Since the timer MUST NOT have less bits than the configured 'CPU_TS_TMR'
544 * timestamp timer data type word size; 'CPU_CFG_TS_TMR_SIZE' MUST be
545 * configured so that ALL bits in 'CPU_TS_TMR' data type are significant.
546 *
547 * In other words, if timer size is not a binary-multiple of 8-bit octets
548 * (e.g. 20-bits or even 24-bits), then the next lower, binary-multiple
549 * octet word size SHOULD be configured (e.g. to 16-bits). However, the
550 * minimum supported word size for CPU timestamp timers is 8-bits.
551 *
552 * See also 'cpu_cfg.h CPU TIMESTAMP CONFIGURATION Note #2'
553 * & 'cpu_core.h CPU TIMESTAMP DATA TYPES Note #1'.
554 *
555 * (b) Timer SHOULD be an 'up' counter whose values increase with each time count.
556 *
557 * (c) When applicable, timer period SHOULD be less than the typical measured time
558 * but MUST be less than the maximum measured time; otherwise, timer resolution
559 * inadequate to measure desired times.
560 *
561 * See also 'CPU_TS_TmrRd() Note #2'.
562 *********************************************************************************************************
563 */
564
565 #if (CPU_CFG_TS_TMR_EN == DEF_ENABLED)
566 void CPU_TS_TmrInit (void)
567 {
568 CPU_INT32U cpu_clk_freq_hz;
569
570
571 DEM_CR |= (CPU_INT32U)DEM_CR_TRCENA; /* Enable Cortex-M3's DWT CYCCNT reg. */
572 DWT_CYCCNT = (CPU_INT32U)0u;
573 DWT_CR |= (CPU_INT32U)DWT_CR_CYCCNTENA;
574
575 cpu_clk_freq_hz = BSP_CPU_ClkFreq();
576 CPU_TS_TmrFreqSet(cpu_clk_freq_hz);
577 }
578 #endif
579
580
581 /*$PAGE*/
582 /*
583 *********************************************************************************************************
584 * CPU_TS_TmrRd()
585 *
586 * Description : Get current CPU timestamp timer count value.
587 *
588 * Argument(s) : none.
589 *
590 * Return(s) : Timestamp timer count (see Notes #2a & #2b).
591 *
592 * Caller(s) : CPU_TS_Init(),
593 * CPU_TS_Get32(),
594 * CPU_TS_Get64(),
595 * CPU_IntDisMeasStart(),
596 * CPU_IntDisMeasStop().
597 *
598 * This function is an INTERNAL CPU module function & MUST be implemented by application/
599 * BSP function(s) [see Note #1] but SHOULD NOT be called by application function(s).
600 *
601 * Note(s) : (1) CPU_TS_TmrRd() is an application/BSP function that MUST be defined by the developer
602 * if either of the following CPU features is enabled :
603 *
604 * (a) CPU timestamps
605 * (b) CPU interrupts disabled time measurements
606 *
607 * See 'cpu_cfg.h CPU TIMESTAMP CONFIGURATION Note #1'
608 * & 'cpu_cfg.h CPU INTERRUPTS DISABLED TIME MEASUREMENT CONFIGURATION Note #1a'.
609 *
610 * (2) (a) Timer count values MUST be returned via word-size-configurable 'CPU_TS_TMR'
611 * data type.
612 *
613 * (1) If timer has more bits, truncate timer values' higher-order bits greater
614 * than the configured 'CPU_TS_TMR' timestamp timer data type word size.
615 *
616 * (2) Since the timer MUST NOT have less bits than the configured 'CPU_TS_TMR'
617 * timestamp timer data type word size; 'CPU_CFG_TS_TMR_SIZE' MUST be
618 * configured so that ALL bits in 'CPU_TS_TMR' data type are significant.
619 *
620 * In other words, if timer size is not a binary-multiple of 8-bit octets
621 * (e.g. 20-bits or even 24-bits), then the next lower, binary-multiple
622 * octet word size SHOULD be configured (e.g. to 16-bits). However, the
623 * minimum supported word size for CPU timestamp timers is 8-bits.
624 *
625 * See also 'cpu_cfg.h CPU TIMESTAMP CONFIGURATION Note #2'
626 * & 'cpu_core.h CPU TIMESTAMP DATA TYPES Note #1'.
627 *
628 * (b) Timer SHOULD be an 'up' counter whose values increase with each time count.
629 *
630 * (1) If timer is a 'down' counter whose values decrease with each time count,
631 * then the returned timer value MUST be ones-complemented.
632 *
633 * (c) (1) When applicable, the amount of time measured by CPU timestamps is
634 * calculated by either of the following equations :
635 *
636 * (A) Time measured = Number timer counts * Timer period
637 *
638 * where
639 *
640 * Number timer counts Number of timer counts measured
641 * Timer period Timer's period in some units of
642 * (fractional) seconds
643 * Time measured Amount of time measured, in same
644 * units of (fractional) seconds
645 * as the Timer period
646 *
647 * Number timer counts
648 * (B) Time measured = ---------------------
649 * Timer frequency
650 *
651 * where
652 *
653 * Number timer counts Number of timer counts measured
654 * Timer frequency Timer's frequency in some units
655 * of counts per second
656 * Time measured Amount of time measured, in seconds
657 *
658 * (2) Timer period SHOULD be less than the typical measured time but MUST be less
659 * than the maximum measured time; otherwise, timer resolution inadequate to
660 * measure desired times.
661 *********************************************************************************************************
662 */
663
664 #if (CPU_CFG_TS_TMR_EN == DEF_ENABLED)
665 CPU_TS_TMR CPU_TS_TmrRd (void)
666 {
667 return ((CPU_TS_TMR)DWT_CYCCNT);
668 }
669 #endif
Maximum stack usage in bytes:
Function .cstack
-------- -------
BSP_CPU_ClkFreq 24
BSP_Init 8
BSP_LED_Init 8
BSP_LED_Off 8
BSP_LED_On 8
BSP_LED_Toggle 16
BSP_StatusInit 8
BSP_StatusRd 16
Section sizes:
Function/Label Bytes
-------------- -----
BSP_CPU_ClkFreq_MHz 4
BSP_Init 42
BSP_CPU_ClkFreq 16
BSP_LED_Init 38
BSP_LED_On 64
BSP_LED_Off 64
BSP_LED_Toggle 118
BSP_StatusInit 30
BSP_StatusRd 30
??DataTable6 4
??DataTable6_1 4
??DataTable6_2 4
??DataTable6_3 4
4 bytes in section .bss
418 bytes in section .text
418 bytes of CODE memory
4 bytes of DATA memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?