Modified comm.h to use a HAL file for port management