Register map
WDT_WSPR accepts a two-step magic sequence to disable the watchdog. WDT_WWPS bit 4 (W_PEND_WSPR) indicates that a previous write to WDT_WSPR is still pending in the synchronizer; software must poll it to zero before issuing the next write.
watchdog_disable
PLATFORM_TARGET == 1) this function is a no-op — QEMU’s versatilepb model does not emulate WDT1, so the writes are unnecessary and omitted via a preprocessor guard.
Disable sequence
Poll WDT_WWPS until bit 4 clears
Wait for the synchronizer to absorb the first write before proceeding.
Write 0x5555 to WDT_WSPR
The second magic word completes the disable handshake and stops the watchdog.
Implementation
On QEMU (
PLATFORM_TARGET == 1), the #if guard makes watchdog_disable() an empty function. The call site in main() remains the same for both targets, so no platform-specific code is needed in user or OS startup code.