1. 12 Aug, 2021 3 commits
  2. 29 Jul, 2021 4 commits
  3. 23 Jul, 2021 3 commits
  4. 22 Jul, 2021 1 commit
    • Earle F. Philhower, III's avatar
      Set available() to 0 when Wire.requestFrom fails (#259) · cb9931f3
      Earle F. Philhower, III authored
      Wire::requestFrom() returns the number of bytes read from the slave.  In
      the case of error, the slave can end up returning a very large integer
      for PICO_GENERIC_ERROR which would then be used as the # of bytes read
      causing crashes and errors.
      
      Running TalkingToMyself without connecting the I2C ports would show
      this behavior.
      
      Now, when PICO_GENERIC_ERROR is returned, set the read-back buffer len
      to 0 explicitly.
      cb9931f3
  5. 20 Jul, 2021 1 commit
  6. 19 Jul, 2021 2 commits
  7. 17 Jul, 2021 1 commit
  8. 15 Jul, 2021 1 commit
    • Earle F. Philhower, III's avatar
      Fix PWM frequency at low and high frequencies (#244) · 05356da2
      Earle F. Philhower, III authored
      The PWM HW can only divide 125MHZ sysclk by 1...256.  That's only down to
      about 500khz.  If the max count of the PWM (analogWriteScale) is too low
      then the actual PWM period will be much less than desired (and PWM frequency
      of course much higher).
      
      For example, at analogWriteFreq(100); analogWriteScale(256); the true
      PWM period would be 125M / 256 (pwmdiv) / 256 (scale) = ~2khz.
      
      Conversely, at high frequencies and large scales it is impossible to achieve
      the requested frequency and a much lower one would be generated.  For
      example: freq(60K), scale(32768). PWM period = 125M / 1 (pwmdiv) / 32768 =
      ~4kHz.
      
      Avoid this by adjusting the analogWrite scale in the core to either increase
      the PWM count for low frequencies, or decrease it for high frequencies.
      This is done behind the scenes and code is not required to be changed.
      
      The PWM frequency will still not be perfcetly exact due to the divider HW
      and clocks involved, but it will be very close across the whole range.
      
      Fixes #234
      05356da2
  9. 07 Jul, 2021 1 commit
  10. 06 Jul, 2021 1 commit
  11. 04 Jul, 2021 2 commits
  12. 30 Jun, 2021 3 commits
  13. 29 Jun, 2021 2 commits
  14. 26 Jun, 2021 3 commits
  15. 19 Jun, 2021 1 commit
    • Earle F. Philhower, III's avatar
      Fix file creation on SD and SDFS (#216) · 35c974d4
      Earle F. Philhower, III authored
      The O_CREAT/etc. flags on the Pico are a full 32-bits in size, but the
      core was generating a flag for SdFat using an 8-bit type, so all the
      O_CREAT, O_TRUNC, O_APPEND, etc. flags got cut off.
      
      Fix the flag size.
      
      Fixes #214
      35c974d4
  16. 16 Jun, 2021 2 commits
  17. 14 Jun, 2021 1 commit
  18. 13 Jun, 2021 1 commit
  19. 11 Jun, 2021 3 commits
    • Earle F. Philhower, III's avatar
      Update to PICO-SDK version 1.2.0 (#207) · 08b6748d
      Earle F. Philhower, III authored
      Minor rev to the tinyUSB version used, new ID function.
      08b6748d
    • Earle F. Philhower, III's avatar
      Clear PIO FIFOs when updating Tone and Servos (#206) · bedfbda3
      Earle F. Philhower, III authored
      The PIO programs that generate tone() and Servo() use the TX FIFO to
      receive updates to the period/duty cycle.
      
      The original code would push into the FIFO (potentially blocking the
      app if the FIFO was full) and generate at least one cycle of every
      value written into the control.  Basically, the output would
      lag the changes by 1 cycle or more (which could be 20ms+ on Servo).
      
      Fix this by clearing any old, ungrabbed values from the FIFO before
      sending a new one to the program.  Instead of a FIFO, there is
      effectively now just a control register and updates will be immediate.
      
      Update the Siren.ino example with delays because now the tone() calls
      will not block and run 10x+ faster.
      bedfbda3
    • Earle F. Philhower, III's avatar
      Clean up Arduino.h header, remove duplicates (#205) · 9fbf6ab3
      Earle F. Philhower, III authored
      Many functions are defined inside the api/Common.h, so remove them from
      the Arduino.h header to have them appear only once.
      
      Fix up the abs() macro to avoid macro problems, add round()
      9fbf6ab3
  20. 10 Jun, 2021 1 commit
  21. 08 Jun, 2021 3 commits