feat: split VFD backends by hardware
This commit is contained in:
22
lib/led/detect.js
Normal file
22
lib/led/detect.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
function readDeviceModel() {
|
||||
try {
|
||||
return fs.readFileSync('/proc/device-tree/model', 'utf8')
|
||||
.replace(/\0/g, '')
|
||||
.trim();
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function isRK3566() {
|
||||
return /RK3566/i.test(readDeviceModel());
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
readDeviceModel,
|
||||
isRK3566,
|
||||
};
|
||||
Reference in New Issue
Block a user