msp430: generate port_init and some bug fixes