mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-22 00:23:43 +08:00
util.cc: reduce two read_file functions into one (#20655)
* no need to malloc one extra byte
* combine two read_file into a faster one
* cleanup #include
* use resize
* apply suggestions from review
* space
* rebase master
old-commit-hash: fe2f63849a
This commit is contained in:
@@ -40,7 +40,7 @@ void FrameBuffer::swap() {
|
||||
bool set_brightness(int brightness) {
|
||||
char bright[64];
|
||||
snprintf(bright, sizeof(bright), "%d", brightness);
|
||||
return 0 == write_file("/sys/class/leds/lcd-backlight/brightness", bright, strlen(bright));
|
||||
return 0 == util::write_file("/sys/class/leds/lcd-backlight/brightness", bright, strlen(bright));
|
||||
}
|
||||
|
||||
void FrameBuffer::set_power(int mode) {
|
||||
|
||||
Reference in New Issue
Block a user