Added defines for ATmega328 chips + a cast to remove compiler warning.