当前位置:网站首页>B_ QuRT_ User_ Guide(26)
B_ QuRT_ User_ Guide(26)
2022-06-28 08:08:00 【weixin_ thirty-eight million four hundred and ninety-eight thou】
B_QuRT_User_Guide(26)
16 System Clock
Thread usage QuRT System clock to create alarms and timers , Access the current system time , Or determine when the next timer event of any active timer occurs .
The system clock time indicates QuRT How long has the application system been running ( In system tick ). A system tick is defined as Hexagon The processor 19.2MHz QTIMER A cycle of a clock .
And conventional timers ( The first 15 section ) Different , System clock alerts and timers are global resources , You can notify multiple client threads of a clock event . When a client thread registers for a system clock event , It specifies a signal object and a signal mask .
The system clock alarm fails within the specified time , The system clock timer fails within the specified time . In both cases , When the event occurs , For each registered client thread , The signal specified in the registered signal mask is set in the registered signal object .
The system clock supports the following operations .
- qurt_sysclock_get_hw_ticks()
- qurt_sysclock_get_hw_ticks_32()
- qurt_sysclock_get_hw_ticks_16()
16.1 qurt_sysclock_get_hw_ticks()
16.1.1 Function document
16.1.1.1 unsigned long long qurt_sysclock_get_hw_ticks ( void )
Get hardware tick count .
Return to one 64 Current value of the bit hardware counter . When the maximum value is exceeded , The value is rounded to zero .
Be careful : This operation must be used with care , Because there is surround behavior .
Related data types
Integer - 64 Current value of the bit hardware counter .
Dependencies
None.
16.2 qurt_sysclock_get_hw_ticks_32()
16.2.1 Function document
16.2.1.1 int qurt_timer_base
obtain 32 Bit hardware tick count .
Return to one 32 Current value of the bit hardware counter . When the maximum value is exceeded , The value is rounded to zero .
Be careful : This operation is used as an inline C Functionally implemented , It should be from C/C++ Call in program . Back to 32 Is it Qtimer Counter low 32 position .
Return value
Integers - 32 Current value of the bit timer counter .
Dependencies
None.
16.3 qurt_sysclock_get_hw_ticks_16()
16.3.1 Function document
16.3.1.1 static unsigned short qurt_sysclock_get_hw_ticks_16 ( void )
obtain 16 Bit hardware tick count .
Return to one 16 Current value of the bit timer counter . When the maximum value is exceeded , The value is rounded to zero .
Be careful : This operation is used as an inline C Functionally implemented , It should be from C/C++ Call in program . Back to 16 Bit is based on Qtimer The counter is low 32 The value of a , Move right 16 position .
Return value
Integers - 16 Current value of the bit timer counter , from Qtimer Counter low 32 Bit calculated , Move right 16 position ..
Dependencies
None.
17 Interrupts
Threads use interrupts to respond to external events .
When registering an interrupt , It is enabled and associated with the specified signal object and signal mask . When an interrupt occurs , The signal specified in the signal mask is set in the signal object . In order to deal with interruptions , An interrupt service thread (IST) Usually wait on this signal .
When an interrupt occurs, it is automatically disabled . To re enable an interrupt ,IST After processing the interrupt , Before pausing yourself ( for example , By waiting for an interrupt signal ), Perform the operation of confirming the interrupt . When an interrupt is deregistered , It is disabled , No longer associated with any signal .
A signal object can be registered at most 31 Separate interrupts , This is determined by the number of independent signals that the object can store .( The signal 31 from QuRT Retain .) So a IST Can handle several different interrupts .
Be careful : A signal object can only be registered to a specific interrupt . Registering multiple semaphore objects on an interrupt raises an exception ( The first 19 section ).
As IST The thread of must not call the exit thread operation .
Interrupts do not support init and destroy operation , Because no objects were created for them ( The first 2.4 section ).
Explicitly clear a pending interrupt with the clear interrupt operation .
Be careful : This operation is used at the system level , Must be used with caution .
All interrupts are based on L2VIC Interrupt the controller . Use L2VIC The interrupt number specifies all interrupts .
L2VIC Interrupts can be dynamically configured to different types ( Edge trigger or level trigger ) Or polarity ( Active low or active high ).
Be careful :L2VIC Interrupt must be unregistered before reconfiguration . Interrupts are processor resources , It supports the following operations .
- qurt_interrupt_acknowledge() - qurt_interrupt_clear()
- qurt_interrupt_deregister()
- qurt_interrupt_disable()
- qurt_interrupt_enable()
- qurt_interrupt_get_config()
- qurt_interrupt_raise()
- qurt_interrupt_register()
- qurt_interrupt_set_config() - qurt_interrupt_status()
- qurt_interrupt_get_status().Constants
17.1 qurt_interrupt_acknowledge()
17.1.1 Function document
17.1.1.1 int qurt_interrupt_acknowledge ( int int_num )
After the interrupt is processed , Confirm the interrupt .
Re enable an interrupt , And clear its pending state . This is interrupting the service thread (IST) After handling an interrupt .
When an interrupt occurs, it is automatically disabled . To re enable an interrupt ,IST After processing the interrupt , Before pausing yourself ( For example, wait for an interrupt signal ), Perform the confirmation operation .
Be careful : To prevent subsequent interruptions from being lost or reprocessed ,IST The interrupt signal must be cleared before the interrupt is acknowledged (9.1.1.1 section ).
Parameters 
Return value
QURT_EOK - Interrupt confirmation succeeded .QURT_EDEREGISTERED - Interrupt has been unregistered .
Dependencies
None.
17.2 qurt_interrupt_clear()
17.2.1 Function document
17.2.1.1 unsigned int qurt_interrupt_clear ( int int_num )
Parameters 
Return value
QURT_EOK - success .
QURT_EINT - Invalid interrupt number .
Dependencies
None.
17.3 qurt_interrupt_deregister()
17.3.1 Function document
17.3.1.1 unsigned int qurt_interrupt_deregister ( int int_num )
Disable the specified interrupt , And compare it with any QuRT Signal object disassociates . If the specified interrupt
Never registered ( The first 17.8.1.1 section ), The unregistered operation will return the status value QURT_EINT.
Be careful : If the service thread is interrupted (IST) Cancel registration while waiting for receiving interrupt ,IST May wait indefinitely for an interrupt to occur . To avoid this problem ,QuRT The kernel is determining IST After no registration interruption , Will send a signal SIG_INT_ABORT To wake it up .
Parameters 
Return value
QURT_EOK – Success.
QURT_EINT – Invalid interrupt number (not registered).
Dependencies
None.
边栏推荐
- Redis uses sentinel master-slave switching. What should the program do?
- Kubernetes理论基础
- flex布局
- Activity隐式跳转
- Hj21 simple password
- 同花顺注册开户靠谱吗?安全吗?
- 图像翻译:UVCGAN: UNET VISION TRANSFORMER CYCLE-CONSISTENT GAN FOR UNPAIRED IMAGE-TO-IMAGE TRANSLATION
- 协程、asyncio、异步编程
- 你了解TCP协议吗(二)?
- asp. Net datalist to display product information and pictures
猜你喜欢

AI首席架构师8-AICA-高翔 《深入理解和实践飞桨2.0》

Prometheus + grafana + MySQL master-slave replication + host monitoring

Image translation /transformer:ittr: unpaired image to image translation with transformers

Introduction to kubernetes (I)

Today's notes 22/1/7

MySQL implements transaction persistence using redo logs

2022巴黎时装周儿童单元6.19武汉站圆满落幕

SOC clock configuration

SQL Master slave Replication Build

How to configure DDR3 of dm8148
随机推荐
Section 8: DMA of zynq
Doris学习笔记之介绍、编译安装与部署
Ambari (VIII) --- ambari integrated impala document (valid for personal test)
HJ explicit random number
HJ字符串排序
asp. Net error "/" server error in the application. String or binary data would be truncated. The statement...
[JS] - [DFS, BFS application] - learning notes
B_QuRT_User_Guide(29)
js取整的小技巧
HJ string sort
Prometheus service discovery
Leetcode摆动序列系列
Generation and verification of JWT token
抗洪救灾,共克时艰,城联优品捐赠10万元爱心物资驰援英德
MySQL implements transaction persistence using redo logs
Activity隐式跳转
HJ delete the character with the least number of occurrences in the string
Host is not allowed to connect to this MySQL server
Soft test -- software designer -- database design of afternoon questions
At 19:00 on Tuesday evening, the 8th live broadcast of battle code Pioneer - how to participate in openharmony's open source contribution in multiple directions