sleep_ms() overflow bug?

changed to alternative, but slower implementation