嵌入式爱好者

OK3588-安卓系统添加pwm的可执行权限

2023-9-28 15:39| 发布者: whl| 查看: 163| 评论: 0

类目: 知识库  >  RK3588系列产品     文档编号: 1154

安卓系统,/sys/class/pwm/目录下的节点需要使用root用户进行读写。写应用程序时没有可读写权限。可以使用如下方法修改其初始状态的可执行权限。
以pwm0和pwm2为例,在device/rockchip/common/rootdir/init.rk30board.rc文件中添加如下指令:
write /sys/class/pwm/pwmchip0/export 0
chown system system  /sys/class/pwm/pwmchip0/pwm0/enable
chown system system  /sys/class/pwm/pwmchip0/pwm0/polarity
chown system system  /sys/class/pwm/pwmchip0/pwm0/period
chown system system  /sys/class/pwm/pwmchip0/pwm0/duty_cycle
chmod 0666 /sys/class/pwm/pwmchip0/pwm0/enable
chmod 0666 /sys/class/pwm/pwmchip0/pwm0/polarity
chmod 0666 /sys/class/pwm/pwmchip0/pwm0/period
chmod 0666 /sys/class/pwm/pwmchip0/pwm0/duty_cycle

write /sys/class/pwm/pwmchip2/export 0
chown system system  /sys/class/pwm/pwmchip2/pwm0/enable
chown system system  /sys/class/pwm/pwmchip2/pwm0/polarity
chown system system  /sys/class/pwm/pwmchip2/pwm0/period
chown system system  /sys/class/pwm/pwmchip2/pwm0/duty_cycle

chmod 0666 /sys/class/pwm/pwmchip2/pwm0/enable
chmod 0666 /sys/class/pwm/pwmchip2/pwm0/polarity
chmod 0666 /sys/class/pwm/pwmchip2/pwm0/period
chmod 0666 /sys/class/pwm/pwmchip2/pwm0/duty_cycle

已解决

未解决

只是看看

最新评论

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-11-22 11:24

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部