v1.9.8-dev

This commit is contained in:
Gabriel Wang 2022-07-08 10:26:33 +01:00
parent 87dd110eaa
commit c98556b2f1
8 changed files with 19 additions and 12 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ example/example.uvguix.gabriel
example/GCC_Out
documents/.DS_Store
documents/Doxygen
*.gabriel

View File

@ -1,4 +1,4 @@
# perf_counter (v1.9.7)
# perf_counter (v1.9.8-dev)
A dedicated performance counter for Cortex-M Systick. It shares the SysTick with users' original SysTick function(s) without interfering with it. This library will bring new functionalities, such as performance counter,` delay_us` and `clock()` service defined in `time.h`.
### Features:

View File

@ -16,7 +16,7 @@
*/
#define CMSIS_device_header "ARMCM0.h"
/* GorgonMeducer.Performance Counter::Utilities:perf_counter:Core:Library:1.9.4 */
/* GorgonMeducer.Performance Counter::Utilities:perf_counter:Core:Library:1.9.6 */
#define __PERF_COUNTER__

Binary file not shown.

View File

@ -35,9 +35,9 @@ extern "C" {
*/
#define __PERF_COUNTER_VER_MAJOR__ 1
#define __PERF_COUNTER_VER_MINOR__ 9
#define __PERF_COUNTER_VER_REVISE__ 7
#define __PERF_COUNTER_VER_REVISE__ 8
#define __PERF_COUNTER_VER_STR__ "rel"
#define __PERF_COUNTER_VER_STR__ "dev"
#define __PER_COUNTER_VER__ (__PERF_COUNTER_VER_MAJOR__ * 10000ul \
+__PERF_COUNTER_VER_MINOR__ * 100ul \

Binary file not shown.

View File

@ -295,13 +295,16 @@ void __perf_counter_init(void)
void delay_us(int32_t nUs)
{
int64_t lUs = nUs * s_nUSUnit;
int64_t lUs = (int64_t)nUs * (int64_t)s_nUSUnit;
int32_t iCompensate = g_nOffset > PERF_CNT_DELAY_US_COMPENSATION
? g_nOffset
: PERF_CNT_DELAY_US_COMPENSATION;
if (lUs <= PERF_CNT_DELAY_US_COMPENSATION) {
if (lUs <= iCompensate) {
return ;
}
lUs -= PERF_CNT_DELAY_US_COMPENSATION;
lUs -= iCompensate;
lUs += get_system_ticks();
while(get_system_ticks() < lUs);
@ -310,13 +313,16 @@ void delay_us(int32_t nUs)
void delay_ms(int32_t nMs)
{
int64_t lUs = nMs * s_nMSUnit;
int64_t lUs = (int64_t)nMs * (int64_t)s_nMSUnit;
int32_t iCompensate = g_nOffset > PERF_CNT_DELAY_US_COMPENSATION
? g_nOffset
: PERF_CNT_DELAY_US_COMPENSATION;
if (lUs <= PERF_CNT_DELAY_US_COMPENSATION) {
if (lUs <= iCompensate) {
return ;
}
lUs -= PERF_CNT_DELAY_US_COMPENSATION;
lUs -= iCompensate;
lUs += get_system_ticks();
while(get_system_ticks() < lUs);

View File

@ -35,9 +35,9 @@ extern "C" {
*/
#define __PERF_COUNTER_VER_MAJOR__ 1
#define __PERF_COUNTER_VER_MINOR__ 9
#define __PERF_COUNTER_VER_REVISE__ 7
#define __PERF_COUNTER_VER_REVISE__ 8
#define __PERF_COUNTER_VER_STR__ "rel"
#define __PERF_COUNTER_VER_STR__ "dev"
#define __PER_COUNTER_VER__ (__PERF_COUNTER_VER_MAJOR__ * 10000ul \
+__PERF_COUNTER_VER_MINOR__ * 100ul \