Program stack when trying to open serial port

Start by auto formatting the code, Always post all the code as a single block, I won't look at it othe wise. And most important of all scrap and rewrite the code it has delays in it. See blink wihout delay and look up finite state machines in the playground.

Mark