wrsw_hal: imported external clock source function from the old repo and removed all compilation warnings