* Note: these have to be sorted, starting with 0, ending with 0xFFFF
* and having small overlaps in order to provide a bit of hysteresis.
*/
-static ambient_zone_t ambient_zones[] = {
+static ambient_zone_t ambient_zones[N_AMBIENT_ZONES] = {
{ 0x0000 , 0x0270<<AMBIENT_VAL_SHIFT }, // dark
{ 0x0260<<AMBIENT_VAL_SHIFT, 0x02e0<<AMBIENT_VAL_SHIFT }, // evening
{ 0x02d0<<AMBIENT_VAL_SHIFT, 0x0306<<AMBIENT_VAL_SHIFT }, // dawn
{ 0x0300<<AMBIENT_VAL_SHIFT, 0xffff }, // day
};
-#define N_AMBIENT_ZONES (sizeof(ambient_zones)/sizeof(ambient_zones[0]))
void init_ambient()
{
if (ambient_max < byte_val)
ambient_max = byte_val;
+
+ // user_param ambient zone override
+ if ((byte_val = get_user_param(0)) > 0)
+ ambient_zone = byte_val - 1;
+
if (old_zone != ambient_zone) {
#if 0
log_byte(0xab);