当前位置:网站首页>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 master-slave structure and application scenarios
- es数据导出csv文件
- sql分析(查询截取分析做sql优化)
- Is it reliable to open a new bond registration account? Is it safe?
- 22/02/15 study notes
- 你了解TCP協議嗎(二)?
- 【尚品汇】项目笔记
- 十大券商注册开户靠谱吗?安全吗?
- Soft test -- software designer -- database design of afternoon questions
- Generation and verification of JWT token
猜你喜欢

Kubernetes cluster command line tool kubectl

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

App automated testing appium tutorial 2 - ADB command

【学习笔记】最短路 +生成树

Soft exam -- software designer -- afternoon question data flow diagram DFD

Host is not allowed to connect to this MySQL server

sql主从复制搭建

B_QuRT_User_Guide(28)

sql分析(查询截取分析做sql优化)

Eslint 语法监测关闭
随机推荐
Soft exam -- software designer -- afternoon question data flow diagram DFD
cuda和cudnn和tensorrt的理解
Study notes 22/1/19 and 22/1/20
Conversion between HJ integer and IP address
B_QuRT_User_Guide(30)
asp. Net datalist when there are multiple data displays
云原生:云计算技术再次升级 开启全面云开发时代
Cloud native: cloud computing technology is upgraded again to open an era of comprehensive cloud development
图像翻译/Transformer:ITTR: Unpaired Image-to-Image Translation with Transformers用Transfor进行非配对图像对图像的转换
GPIO configuration of SOC
Estimation of SQL execution cost by MySQL query optimizer
2022第六季完美童模 佛山赛区 初赛圆满落幕
HJ delete the character with the least number of occurrences in the string
HJ character count
Software design of power control board
Ambari (VII) --- ambari integrated hue4.2 document (valid for personal test)
抗洪救灾,共克时艰,城联优品捐赠10万元爱心物资驰援英德
Is it reliable to open an account by digging money? Is it safe?
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
Airflow2.1.1 summary of the pits stepped on in actual combat!!