mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-03-02 21:23:56 +08:00
* cleanup include path
* continue
* format includes
* fix testraw.cc
* remove include path from SConstruct
* regroup
* rebase master
* almost done
* apply review
* rename FileReader.xx to filereader.xx
* rename Unlogger.x->unlogger.x
* rename FrameReader.xx -> framereader.xx
* apply reviews
* ui.h
* continue
* fix framebuffer.cc build error:mv util.h up
* full path to msm_media_info
* fix qcom2 camerad
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20d
20 lines
496 B
C++
20 lines
496 B
C++
#include "selfdrive/common/watchdog.h"
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
#include "selfdrive/common/timing.h"
|
|
#include "selfdrive/common/util.h"
|
|
|
|
const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid>
|
|
|
|
bool watchdog_kick(){
|
|
std::string fn = watchdog_fn_prefix + std::to_string(getpid());
|
|
std::string cur_t = std::to_string(nanos_since_boot());
|
|
|
|
int r = util::write_file(fn.c_str(), cur_t.data(), cur_t.length(), O_WRONLY | O_CREAT);
|
|
return r == 0;
|
|
}
|