assert is a debug-only check that breaks you into the debugger at the point where the statement was false.
On an embedded system I guess you'd need to implement your own form of assert, that perhaps just logs the error. What you've written could be fine for you.

