* and having small overlaps in order to provide a bit of hysteresis.
*/
static ambient_zone_t ambient_zones[N_AMBIENT_ZONES] = {
+#ifdef PAVLINA
+ { 0x0000, 0x0290 }, // dark
+ { 0x0278, 0x02f8 }, // evening
+ { 0x02d8, 0x0310 }, // dawn
+ { 0x0308, 0xffff }, // day
+#else
{ 0x0000, 0x0250 }, // dark
{ 0x0240, 0x02e0 }, // evening
{ 0x02c0, 0x0300 }, // dawn
{ 0x02f8, 0xffff }, // day
+#endif
};
#define SHADOW_DROP_LIMIT 0x20 // in ADC units (0..0x3ff)
void ambient_log_min_max()
{
if (ambient_log_offset >= AMBIENT_LOG_SIZE - 1)
- return;
+ ambient_log_offset = 0; // start over
ambient_max -= ambient_min;
// ambient_max >>= 2;
slow_10bit = ambient_slow >> AMBIENT_SLOW_SHIFT;
if (new_zone > 1 && (
- new_zone == ambient_zone-1 || new_zone == ambient_zone+1)) {
+ new_zone == ambient_zone-1 || new_zone > ambient_zone)) {
// but change to the neighbouring zone is governed by _slow,
// except to the darkest zone, where we want fast reaction.
new_zone = val_to_zone(slow_10bit);