[Snek] [keith-packard/snek] 020a92: chips/atmega: Add tonefor builtin to 328p io driver

Keith Packard noreply at github.com
Sun Feb 13 16:31:03 PST 2022


  Branch: refs/heads/lilypad
  Home:   https://github.com/keith-packard/snek
  Commit: 020a92f0e24ffccc0e32be5b058bef9ff755f0da
      https://github.com/keith-packard/snek/commit/020a92f0e24ffccc0e32be5b058bef9ff755f0da
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M chips/atmega/snek-328p.c
    M ports/grove/snek-grove.builtin

  Log Message:
  -----------
  chips/atmega: Add tonefor builtin to 328p io driver

This adds a function for this chip that is part of the usual tone
support.

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


  Commit: 456f9a826c6a022868a077bb26ef041a0c56b4ac
      https://github.com/keith-packard/snek/commit/456f9a826c6a022868a077bb26ef041a0c56b4ac
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M chips/atmega/snek-328p.c
    M ports/grove/snek-grove.builtin

  Log Message:
  -----------
  chips/atmega: Use BUILTIN defines to select tone code

Instead of requiring a separate SNEK_TONE define, use the existing
SNEK_BUILTIN_tone and SNEK_BUILTIN_tonefor defines to select whether
the tone code is included in the 328p io driver.

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


  Commit: 3ff659bb1b35705a09e49bd8be102fbb06ab80e8
      https://github.com/keith-packard/snek/commit/3ff659bb1b35705a09e49bd8be102fbb06ab80e8
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M chips/atmega/snek-atmega-serial.c

  Log Message:
  -----------
  chips/atmega: Echo '^T' in serial ISR

This lets the host perform automatic baud rate detection even if
snek is not reading input.

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


  Commit: 0c484e8df485e6a734ad032fb1933788cc1fa61a
      https://github.com/keith-packard/snek/commit/0c484e8df485e6a734ad032fb1933788cc1fa61a
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M chips/atmega/snek-328p.c

  Log Message:
  -----------
  chips/atmega: Fix digital reads from "analog" pins

When a pull-up value is applied to an analog pin, snek is supposed to
go into digital mode, however, the function responsible for returning
the correct pin register wasn't set to return PINC for the analog pins.

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


  Commit: 86f04d1715161de416aab75528d39bddfd88f21d
      https://github.com/keith-packard/snek/commit/86f04d1715161de416aab75528d39bddfd88f21d
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M chips/qemu/snek-qemu.c

  Log Message:
  -----------
  chips/qemu: Use semihost_elapsed for time values

QEMU returns processor time for sys_semihost_clock, so switch to
sys_semihost_elapsed(), which provides wall time instead.

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


  Commit: d4027700e34c80c3c699b9293fbee198cbeb2e19
      https://github.com/keith-packard/snek/commit/d4027700e34c80c3c699b9293fbee198cbeb2e19
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

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

  Log Message:
  -----------
  chips/samd21: Scan for ^C even if input is full

This lets the user interrupt the device even if some data
has been sent.

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


  Commit: cab6e8bec7fd24e2f3f893de2e5297bd1d727b83
      https://github.com/keith-packard/snek/commit/cab6e8bec7fd24e2f3f893de2e5297bd1d727b83
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M snekde/snekde.py

  Log Message:
  -----------
  snekde: Support 57600 and 115200 baud

8MHz atmega devices cannot use 115200 baud because the clock
resolution isn't fine enough to get a close match in bit rate. So,
those devices will run at 57600 baud instead.

Support this by using the new ^T handling in the 328p chip code to
auto-detect the device baud rate when initially opening the device and
also adding a baud rate selection key (F8) which switches between
115200 and 57600 baud.

Display this in the status bar along with the device name.

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


  Commit: b5fdd23cfa4972354c99161b4fbc033a9a7ced40
      https://github.com/keith-packard/snek/commit/b5fdd23cfa4972354c99161b4fbc033a9a7ced40
  Author: Keith Packard <keithp at keithp.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M ports/duemilanove/Makefile
    M ports/duemilanove/snek-duemilanove-install.in
    A ports/lilypad/Makefile
    M ports/uno/Makefile
    M snek-install.defs

  Log Message:
  -----------
  Add port to standard LilyPad

This is an ATMega 328P running at 8MHz because of the 3.3V power
supply.  This port includes the basic I/O code along with the 'tone'
builtins to support the LilyPad beeper when connected to pin 5. This
required leaving out dictionary and slice support to save flash.

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


Compare: https://github.com/keith-packard/snek/compare/d00ce45412c7...b5fdd23cfa49


More information about the Snek mailing list