[Snek] [keith-packard/snek] bf2ba4: Support ENQ/ACK for console I/O

Keith Packard noreply at github.com
Mon Aug 9 12:43:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/keith-packard/snek
  Commit: bf2ba447e7d9440424b482f3450d5edcc4446ee4
      https://github.com/keith-packard/snek/commit/bf2ba447e7d9440424b482f3450d5edcc4446ee4
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M chips/atmega/snek-atmega-eeprom.c
    M chips/avr/snek-avr-eeprom.c
    M chips/qemu/snek-qemu.h
    M chips/samd21/ao-stdio.c
    M chips/samd21/snek-eeprom.c
    M ports/esp32/main/snek-esp32.h
    M snek-io.c
    M snek-io.h
    M snekde/snekde.py

  Log Message:
  -----------
  Support ENQ/ACK for console I/O

To synchronize between a host and snek device connected via a serial
port, some mechanism for flow control is necessary as XON/XOFF isn't
always available.

Have the host send ENQ (ascii 0x05), and then make Snek respond with
ACK (ascii 0x06). Waiting for the ACK will allow the host to avoid
overrunning the Snek input buffer.

This replaces the more fragile and less general mechanism where the
host "knew" Snek would send CR once per 16 characters during EEPROM
writing. Environments which don't require flow control, such as a
direct USB connected Snek device, needn't ever send ENQ or wait for
ACK.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 6278ad12ec1c85599180f2720cbc9f0ccbd0fdbb
      https://github.com/keith-packard/snek/commit/6278ad12ec1c85599180f2720cbc9f0ccbd0fdbb
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M chips/atmega/snek-328p.builtin
    M chips/atmega/snek-atmega-eeprom.c
    M chips/avr/snek-avr-eeprom.c
    M chips/avr/snek-avr.defs
    M ports/duemilanove/Makefile
    M ports/grove/Makefile
    M ports/grove/snek-grove.builtin
    M ports/mega/Makefile
    M ports/mega/snek-mega.builtin
    M ports/nano-every/Makefile
    M ports/nano-every/snek-nano-every.builtin
    M ports/narrow-1284/Makefile
    M ports/narrow-1284/snek-narrow-1284.builtin

  Log Message:
  -----------
  atmel: Let build environment set memory sizes

Instead of defining these ourselves, let the build environment set the
memory sizes and addresses.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: dd271fd9bc72d76838b8150e686d3e40ed9e1d6b
      https://github.com/keith-packard/snek/commit/dd271fd9bc72d76838b8150e686d3e40ed9e1d6b
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M chips/atmega/snek-atmega.defs
    M chips/avr/snek-avr.defs
    M chips/samd21/snek-samd21.defs
    M ports/esp32/main/Makefile

  Log Message:
  -----------
  Add SNEK_EXT_INC dependency to ports using snek-io

This makes sure these ports are rebuilt when snek-io.h is modified.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 3bfc5c3f905e54b6cc5331bdf694e5acf9de16f4
      https://github.com/keith-packard/snek/commit/3bfc5c3f905e54b6cc5331bdf694e5acf9de16f4
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M hosts/windows/snek-windows.h

  Log Message:
  -----------
  host/windows: Windows doesn't have strfromf

Use sprintf instead

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 90a47bc7b87560292c35ed8916c69623c55ea6a3
      https://github.com/keith-packard/snek/commit/90a47bc7b87560292c35ed8916c69623c55ea6a3
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M ports/duemilanove/Makefile
    M ports/duemilanove/snek-duemilanove-install.in
    M ports/uno/.gitignore
    M ports/uno/Makefile

  Log Message:
  -----------
  uno: Create snek-uno-install.in for linux installer

The linux installer script needs to modify the firmware installer
scripts, so make sure there's a suitable uno installer template.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 32a81c9aa7b658d89164eff7d07a2dd3b13484c2
      https://github.com/keith-packard/snek/commit/32a81c9aa7b658d89164eff7d07a2dd3b13484c2
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M ports/narrow-1284/snek-narrow-1284.c

  Log Message:
  -----------
  ports/narrow-1284: Atmega code switched to timer 2 for clock

Need to enable timer 2 interrupt instead of timer 0.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 034269161ff62726edfbab22387b5070414977d9
      https://github.com/keith-packard/snek/commit/034269161ff62726edfbab22387b5070414977d9
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M snek-install.defs

  Log Message:
  -----------
  Sort ev3 firmware into correct order

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 604a450f474ecb35c3be67a03fd727233aa7404f
      https://github.com/keith-packard/snek/commit/604a450f474ecb35c3be67a03fd727233aa7404f
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M ports/playground/snek-playground.builtin

  Log Message:
  -----------
  ports/playground: Provide 'SPEAKER' definition

This makes it a bit more clear which GPIO is hooked to the speaker
output.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: b0c6fb8c05453bd0c81c6063879b43a2e8d750e4
      https://github.com/keith-packard/snek/commit/b0c6fb8c05453bd0c81c6063879b43a2e8d750e4
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M chips/avr/ao-usb-avr.c

  Log Message:
  -----------
  chips/avr: Flush after newline

Also, stick code in that avoids double flushing in ao_usb_flush in
case this code gets used elsewhere.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 276f1e662ea5097f381f280971c3b2b5255ee376
      https://github.com/keith-packard/snek/commit/276f1e662ea5097f381f280971c3b2b5255ee376
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-08 (Sun, 08 Aug 2021)

  Changed paths:
    M snekde/snekde.py

  Log Message:
  -----------
  snekde: Make it work on Windows. Fix display after serial error

Windows doesn't have termios, so work around that. Don't clear the whole
screen during redisplay; that makes it blank after a device error.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 69b3f21f9ef3388835ca7a997e5ff9e678e26efe
      https://github.com/keith-packard/snek/commit/69b3f21f9ef3388835ca7a997e5ff9e678e26efe
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M chips/avr/ao-usb-avr.c
    M ports/itsybitsy3v/Makefile
    M ports/itsybitsy3v/ao-pins.h
    R ports/itsybitsy3v/snek-itsybitsy3v.builtin
    M ports/itsybitsy5v/Makefile
    M ports/itsybitsy5v/ao-pins.h

  Log Message:
  -----------
  ports/itsybitsy3v: Share itsybitsy5v build files

These two products are almost identical, the only difference for
software is clock rate with the 3v version running at 8MHz and the 5v
version running at 16MHz. Instead of duplicating build files, share
use the 5v files.

There was some code in the USB driver which had been voltage dependent
back long ago, but these devices both end up using the same code.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 36f5e5aa79a188d8b77d3ef8fdd29fbb0f195d12
      https://github.com/keith-packard/snek/commit/36f5e5aa79a188d8b77d3ef8fdd29fbb0f195d12
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M chips/atmega/snek-328p.builtin
    M chips/atmega/snek-atmega.h
    M chips/avr/snek-avr.h
    M ports/itsybitsy5v/snek-itsybitsy5v.builtin
    M ports/mega/snek-mega.builtin

  Log Message:
  -----------
  atmel: Simplify memory configuration

Make all 328p devices use a common memory setup, as well as 32u4.
Make mega use the standard memory setup.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: d17f8b0d8f64851faa4723e56602dd1ef5ab0c98
      https://github.com/keith-packard/snek/commit/d17f8b0d8f64851faa4723e56602dd1ef5ab0c98
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M snekde/snekde.py

  Log Message:
  -----------
  reformat


  Commit: d3103448f350069ac940cffe747be822979f1598
      https://github.com/keith-packard/snek/commit/d3103448f350069ac940cffe747be822979f1598
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M chips/avr/ao-snek-avr.c

  Log Message:
  -----------
  chips/avr: switch from 16-bit to 32-bit RNG

This makes the pi example work.

Signed-off-by: Keith Packard <keithp at keithp.com>


  Commit: 8b7cf1ea37f863ed91d14b4f935453dcab168e1d
      https://github.com/keith-packard/snek/commit/8b7cf1ea37f863ed91d14b4f935453dcab168e1d
  Author: Keith Packard <keithp at keithp.com>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M ports/grove/snek-grove.builtin
    M ports/nano-every/snek-nano-every.builtin
    M ports/uduino/snek-uduino.builtin

  Log Message:
  -----------
  atmel: Shrink some pools to make space for the increased stacks

Signed-off-by: Keith Packard <keithp at keithp.com>


Compare: https://github.com/keith-packard/snek/compare/54d1962bc269...8b7cf1ea37f8


More information about the Snek mailing list