eriksl wrote:What is it exactly what you're experiencing? There may be a very short spike/glitch when powering on, due to SDK booting code doing all kinds of weird things with the hardware. That's something I can't prevent. Does it come "on" at all, or only after the spike?
During boot it does have a very short spike/glitch where it turns high/on then low/off, but it leaves the pin in the low/off state; I've used v19 and the v20 pre-release, same result unfortunately.
case(io_pin_output_digital):
case(io_pin_lcd):
case(io_pin_timer):
{
// FIXME: add auto-on flag
io_trigger_pin_x((string_t *)0, info, pin_data, pin_config, pin,
pin_config->flags.autostart ? io_trigger_on : io_trigger_off);
break;
}
where the "FIXME" speaks for itself I'm afraid The current code does act on the "auto flag" but sends a "trigger" not an "on" event. The trigger is very useful for blinking outputs, (auto)pwm outputs etc, so simply replacing it is not the solution.
I think we can do two things here. One is that you await the fix, which may take a while, because the whole codebase is in a flux at the moment (although progress is quite good), or you use the sequencer in the meantime.
Something like this should get you going:
sea 0 0 0 1 0
fs auto-sequencer
This says: store at sequencer position "0": I/O "0" / pin "0" -> value "1" for "0" milliseconds (it won't turn off by itself, so duration can be zero).
Then: start the sequencer automatically after start.
eriksl wrote:Something like this should get you going:Code: Select allsea 0 0 0 1 0
fs auto-sequencer
This says: store at sequencer position "0": I/O "0" / pin "0" -> value "1" for "0" milliseconds (it won't turn off by itself, so duration can be zero).
Then: start the sequencer automatically after start.
Are sequencers used with the digital output mode or another mode? Using v20, I tried doutput, timer, and pwm modes and each attempt to use the sea/sequencer-set command resulted with "sequencer-set: error setting entry (set)".
im 0 0
io[0]: Internal GPIO@00
pin: 0, mode: digital output [hw: digital output] flags: [autostart], output, state: off, max value: 1, info:
sea
> usage: sequencer-set index io pin value duration_ms
sea 0 0 0 1 0
> sequencer-set: error setting entry (set)
ss
> sequencer
>
> running: no
> total flash size available: 16384
> total entries in flash available: 2048
> flash offset for ota image #0: 0x076000
> flash offset for ota image #1: 0x000000
> flash offset mapped into address space: 0x40276000
fs
> flags:
>
> no strip-telnet
> log-to-uart
> no tsl-high-sens
> no bh-high-sens
> no cpu-high-speed
> no wlan-power-save
> no uart0-tx-inv
> no uart0-rx-inv
> log-to-buffer
> auto-sequencer
> no pwm1-extend
> no tmd-high-sens
> no apds3-high-sens
> no apds6-high-sens
> no uart1-tx-inv
> no udp-term-empty
config-dump
flags=770 (770/770)
wlan.mode=0 (0/0)
wlan.client.ssid=XXXX (0/0)
wlan.client.passwd=XXXXXXXXX (0/0)
io.0.2.mode=1 (1/1)
io.0.2.llmode=1 (1/1)
io.0.2.flags=0 (0/0)
io.0.0.mode=3 (3/3)
io.0.0.llmode=3 (3/3)
io.0.0.flags=1 (1/1)
slots total: 160, config items: 10, free slots: 150