M3: updated code.
M3: added missing watchdog.h
M3: added some files. Maybe not needed.