很简单,代码如下:
void beep(uint64_t times)
{
io_out8(0x43, 182&0xff);
io_out8(0x42, 2280&0xff);
io_out8(0x42, (2280>>8)&0xff);
uint32_t x = io_in8(0x61)&0xff;
x |= 3;
io_out8(0x61, x&0xff);
times *= 10000;
for(uint64_t i=0;i<times;++i)
pause();
x = io_in8(0x61);
x &= 0xfc;
io_out8(0x61, x&0xff);
}
转载请注明来源:https://longjin666.cn/?p=1537
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有