pijuice-base (1.8) unstable; urgency=low

  * General
    - Supports both Raspberry Pi OS 32-bit and 64-bit.

  * Firmware V1.6_2021_09_10
    - Introduced logging, up to 32, 31 bytes long messages, are saved into circular
      buffer. New I2C command 0xF6 implemented to read log messages from host.
      For specific message types are defined:
        LOG_5VREG_ON - logs 5V regulator power on process, it shows battery voltage
                and 5V signals that could be evaluated for conditions like overloading
                at turn on.
        LOG_5VREG_OFF - logs if there was unexpected or forced power off of the 5V
                regulator.
        WAKEUP_EVT - Logs system status after some of the triggers (RTC Alarm or
                wakeup on charge or Io wakeup).
        ALARM_EVT - Log status after RTC alarm peripheral interrupt.
    - Load current sense update for hardware version 2.3.0. New GPIO 5V current
      measurement using NCS213 current sense amp.
    - Power good signal for 5V regulator used to disable 5V regulator if regulator is
      in fault state. Hardware version 2.3.0.
    - Introduced option to enable/disable log. Disabled  by default.
    - Fixed instant watchdog wakeup trigger after restore.
    - Fixed missing wakeup restore enable on power on when power source is present
      and no battery, issue #760.

  * pijuice_log.py
    - Added script to enable and read the log introduced in the V1.6 firmware

  * pijuiceboot
    - Support loading firmwares larger than 80k. Needed for loading V1.6.

 -- Ton van Overbeek <tvoverbeek@gmail.com>  Sun, 30 Jan 2022 20:35:00 +0100

pijuice-base (1.7) unstable; urgency=low

  * Firmware V1.5_2020_02_06
    - Wake-up on charge restore. Update that makes it possible to save wake-up on 
      charge configuration to the mcu flash, and restore it after power reset. Also 
      if restore is enabled, wake-up on charge will be automatically activated when 
      charging stops after power source is removed. This improves wake-up reliability 
      if the system fails to properly configure wake-up when it halts.
    - Watchdog restore. Introduced possibility to save watchdog configuration to 
      the mcu flash. If restore is enabled, the watchdog configuration will be restored 
      after power reset and the watchdog will be automatically activated after wake-up 
      trigger (wake-up on charge, rtc wake-up or io wake-up). So if wake-up process 
      fails, no response from host (for example boot process stuck), the watchdog will 
      trigger reset. This feature should be used together with software polling over 
      i2c or system task enabled. Software or system task should deactivate watchdog 
      on system halt.
    - Extended maximum possible value range for battery capacity configuration to 
      [0-4194175mAh].
    - Added new profile for PiJuice 2500mAh battery.
    - Introduced experimental FreeRTOS as part of migration process to RTOS or other 
      mcu. It is not enabled by default in this release,but can be configured by 
      setting project wide macro: RTOS_FREERTOS.
    - Fixed issue with wrongly marking GPIO input power as BAD when the power supply
      voltage is close to the threshold. DPM voltage is changed from 4.76V to 4.68V.
    - 5V Regulator turn-on overload fault issue patch. DCDC 5V regulator goes to 
      fault state when turning on with high load current and large capacitance at GPIO 
      rail. Turn-on procedure updated with 3 retries in short intervals ~1ms.
    - Fixed I2C stuck in case of transfer error, when tx buffer is left empty and
      indefinitely fires interrupts until watchdog reset.
    - Button event automatic removal update. Event is cleared on next button action 
      and timeout of 30 seconds. This solves problems of unresponsive Button presses 
      after it fails to clear event by I2C command.
    - Battery temperature measurement updated for NTC resistance other than 10K. Now
      temperature measured by fuel gauge is recalculated based on NTC resistance value
      from battery profile that can be customized.
    - Fixed RTC Alarm problem, when it misses to trigger wake-up in mcu run mode.  
      Patched by polling Alarm flag instead of waiting for interrupt.
    
  * pijuice.py
    - Updated interface functions: SetWakeUpOnCharge and GetWakeUpOnCharge to support 
      wake-up restore configuration introduced in firmware V1.5.
    - Updated interface functions: SetWakeUpOnCharge and GetWakeUpOnCharge to support 
      watchdog restore configuration introduced in firmware V1.5.
    - Updated interface functions: SetCustomBatteryProfile and GetBatteryProfile to 
      support extended maximum possible value range for battery capacity introduced in 
      firmware V1.5.
    - Updated batteryProfiles list with new PJLIPO_2500.
    - Fixed Bad signed conversion in function GetBatteryTemperature.

  * pijuice_sys.py
    - Fixed undesired behavior of system task failing to halt the system if input power 
      is lost during system boot. noPowCnt initialized to 0 instead of 100 so 
      _EvalPowerInputs function triggers function execution if there is "no power input"
      at startup.
    - Fixed undesired behavior of system task triggering low charge or low battery 
      events when battery is missing or is bad immediately after startup. These false 
      triggers were noticeable when "no battery turn on" config is enabled and system 
      halt on "low battery voltage" or "low charge" events are configured, so it halts
      immediately after startup. _EvalBatVoltage, _EvalCharge and _EvalPowerInputs are
      updated to detect this case and avoid undesired triggers.
    - Introduced two additional system events: "sys_start" triggers at system task 
      startup and "sys_stop" triggers at system task stop. These events can be used
      to run custom user scripts like automated PiJuice board configuration.
    - Update to restore PiJuice I2C Address from configuration file.
      You can now change the PiJuice I2C address from the cli/gui and the
      system continues immediately with the new address.
    - Fixed double watchdog activation at startup.
    - Reload rtc kernel module when the first os probe of the rtc fails.
      This can happen when the RPi is off and the Pijuice mcu in low power mode.
      When applying power to the Pi the PiJuice can be too late to wake-up to
      respond to the first os probe.

  * pijuice_cli.py
    - Update for wake-up on charge restore configuration.
    - Update for watchdog restore configuration.
    - Added "sys_start" and "sys_stop" events to SystemEventsTab.
    - Update to restore PiJuice I2C Address from configuration file.

 -- Milan Neskovic <milan@pi-supply.com>  Mon, 22 Feb 2021 00:00:00 +0000

pijuice-base (1.6) unstable; urgency=low

  * Firmware V1.4_2020_01_17
    - Reworked I2C code, so using i2c-bcm2708 is not neeed any more for Pi 4.
    - Fixed fluctuating temperature readings.
    - Changed order of battery profiles. PjZero 1000mAh is now profile 0
      (= default on PiJuice-Zero)
    - Delayed power off will be cancelled if RPi 5V power is restored before
      the timer runs out (Issue #356).
    - Fixed missing clearing wake-up flags for the GPIO3 wakeup case.

  * pijuice.py
    - Battery profiles order changed in 1.4 firmware.
    - Also accept True or False as first argument of pj.config.SetChargingConfig.
    - Work-around for some 'DATA_CORRUPTION' cases when retrieving data from
      the PiJuice.

  * pijuice_cli.py
    - Support changed battery profiles order in the 1.4 firmware.
    - Wakeup-on-charge allow lower bound of 0 instead of 1.
    - Show firmware path on the firmware tab (as in the gui).
    - Check for valid 7-bit I2C addresses.
    - Bug fixes.

 -- Ton van Overbeek <tvoverbeek@gmail.com>  Tue, 11 Feb 2020 21:35:00 +0100

pijuice-base (1.5) unstable; urgency=low

  * Support for new features in firmware 1.3
    - Alternative method for measuring the charge of the battery by the MCU directly
      in case the fuel gauge IC is not available or is faulty.
    - Extended battery profile with parameters for the alternative method
    - Added option to force use of the alternative method.
    - More predefined battery profiles: BP6X_1400, BP7X_1820, SNN5843_2300,
      PJLIPO_12000, PJLIPO_5000, PJBP7X_1600, PJSNN5843_1300, PJZERO_1200,
      PJZERO_1000, PJLIPO_600, PJLIPO_500.
    - Use IO2 digital input as source for wakeup enabling peripheral attached to
      the P3 header to wake-up Raspberry Pi.
    - Added alternative wakeup via RPi GPIO3 (used as I2C SCL after boot) if run pin
      is not connected (no pogo pin) and PiJuice powered via RPi.

  * pijuice.py
    - Added support for commands for the firmware 1.3 features 

  * pijuice_cli.py
    - Works with both 1.2 qnd 1.3 firmware. 1.3 firmware features only shown when
      1.3 firmware is present.
    - Better feedback during firmware update.

 -- Ton van Overbeek <tvoverbeek@gmail.com>  Wed, 12 Jun 2019 16:30:00 +0200

pijuice-base (1.4) unstable; urgency=low

  * General
    - Install only for python3.
    - Added non priviliged user pijuice
    - The pijuice service (pijuice_sys.py), pijuice_gui and pijuice_cli now
      execute with effective user pijuice.
    - User scripts canot be executed as root.

  * pijuice.py
    - Setting PWM parameters for IO1 and IO2 now works.

  * pijuice_sys.py
    - User scrips have to be executable and the script owner must belong to
      the pijuice group. Scripts owned by root will not be executed.
    - Button configuration changes in the gui/cli are now also changed in the service.
    - Changes in settings for system task (min_charge, min_bat_voltage) and
      system events (low_charge, low_battery_voltage, no_power) are changed in
      the service when the service is running. 
    - Added support for 'Software Halt Power Off' feature.
    - Watchdog changes in the GUI/CLI now change immediately in PiJuice.

  * pijuice_cli.py
    - Added 'System Task', 'System Events' and 'User Script' tabs.
      Now pijuice_cli matches pijuice_gui.
    - Execute with effective user pijuice (non privileged) using the pijuice_cli command.
    - 'Status' tab updates every second (as in the gui).
    - I2C addresses can be changed.
    - 'Wakeup Alarm' tab: The UTC time now updates every second.

 -- Ton van Overbeek <tvoverbeek@gmail.com>  Mon, 26 Nov 2018 16:05:00 +0200

pijuice-base (1.3.3) unstable; urgency=low

  updated firmware version

 -- Ilya Starodubcev <ilyastrodubtsev@gmail.com>  Thu, 17 May 2018 18:22:51 +0600

pijuice-base (1.3.2-1) unstable; urgency=low

  * src/pijuice_cli.py:
    - Fix displaying USB power input

 -- Denis Khrutsky <denis.xpy@gmail.com>  Mon, 19 Mar 2018 18:21:33 +0600

pijuice-base (1.3.1-1) unstable; urgency=low

  * src/pijuice_cli.py:
    - Fix displaying USB power input
  
  * src/pijuice_sys.py:
    - Python version independent file handling

 -- Denis Khrutsky <denis.xpy@gmail.com>  Mon, 5 Mar 2018 16:38:23 +0600

pijuice-base (1.3-1) unstable; urgency=low

  * Python 3 support
  * Console interface application for HAT configuration

 -- Denis Khrutsky <denis.xpy@gmail.com>  Fri, 2 Mar 2018 17:36:11 +0600

pijuice-base (1.2.1-1) unstable; urgency=low

  * Fixed permissions setting for configuration file

 -- Denis Khrutsky <denis.xpy@gmail.com>  Fri, 23 Feb 2018 17:10:00 +0600

pijuice-base (1.2-1) unstable; urgency=low

  * Bump version

 -- Denis Khrutsky <denis.xpy@gmail.com>  Fri, 4 Feb 2018 18:12:32 +0600

pijuice-base (1.1-1) unstable; urgency=low

  * pijuice.py:
    - Function for getting versions (OS, Firmware, Software)

  * src/pijuice_sys.py:
    - Refactored GetFirmvareVersion to GetFirmwareVersion #34

  * data/firmware/PiJuice-V1.1_2018_01_15.elf.binary:
    - Wakeup on charge updated to be activated only if power source is present.
    - Further this enables wakeup after plugged if this parameter is set to 0.
    - Button wakeup functions power off and power off can now be assigned to arbitrary button events. Removed constrain to be assigned only to long_press2 for power off, and single_press for power on.
    - Added reset function that can be assigned to some of buttons and button events.
    - Added no battery turn on configuration.
    - Now it can be set whether or not user wants to turn on 5V rail as soon as power input is connected and there is no battery.
    - Added configuration for 2 IO ports. They can be set to analog input, digital input, digital output and pwm output.

 -- Milan Neskovic <milan@pi-supply.com>  Mon, 15 Jan 2018 00:00:00 +0000
