This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ////////////////////////////////////////////////////////////////////// | |
| #include "freertos/FreeRTOS.h" | |
| #include "freertos/queue.h" | |
| #include "esp_log.h" | |
| #include "driver/gpio.h" | |
| #include "esp_rom_gpio.h" | |
| #include "audio_mem.h" | |
| #include "encoder.h" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // double dabble: convert 32 bit unsigned integer to bcd | |
| // right justified, fills output with leading zeros | |
| // no mods or divs | |
| static void uint32_to_bcd(uint32_t input, uint8_t output[5]) | |
| { | |
| for(uint8_t i = 0; i < 5; ++i) { | |
| output[i] = 0; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | func SendEmail(server, user, password, from, subject, message, contentType string, recipients ...string) error { | |
| smtpTemplate := []string{ | |
| "From: %s", | |
| "To: %s", | |
| "Subject: %s", | |
| "MIME-Version: 1.0", | |
| "Content-Type: %s; charset=\"utf-8\"", | |
| "Content-Transfer-Encoding: quoted-printable", | |
| "Content-Disposition: inline", | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void sleep(uint32 count) | |
| { | |
| __disable_irq(); | |
| // switch off the ADC | |
| ADC1->CTLR2 = 0; | |
| // switch off all clocks except what we need | |
| RCC->AHBPCENR = RCC_AHBPeriph_SRAM; | |
| RCC->APB1PCENR = RCC_APB1Periph_PWR; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | MONITOR | |
| --- idf_monitor on /dev/ttyS26 115200 --- | |
| --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- | |
| ښj%Bets Jun 8 2016 00:22:57 | |
| rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) | |
| configsip: 0, SPIWP:0xee | |
| clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 | |
| mode:DIO, clock div:2 | |
| load:0x3fff0030,len:4 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # | |
| # Automatically generated file. DO NOT EDIT. | |
| # Espressif IoT Development Framework (ESP-IDF) Project Configuration | |
| # | |
| CONFIG_IDF_TARGET="esp32" | |
| CONFIG_IDF_TARGET_ESP32=y | |
| CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 | |
| # | |
| # SDK tool configuration | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* RMT example -- RGB LED Strip | |
| This example code is in the Public Domain (or CC0 licensed, at your option.) | |
| Unless required by applicable law or agreed to in writing, this | |
| software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | |
| CONDITIONS OF ANY KIND, either express or implied. | |
| */ | |
| #include "sdkconfig.h" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #if DEBUG | |
| if (Debugger.IsAttached) | |
| { | |
| int timeout = 3; | |
| Console.Error.Write($"Press enter or wait for {timeout} seconds..."); | |
| Task.Factory.StartNew(Console.ReadLine).Wait(TimeSpan.FromSeconds(timeout)); | |
| } | |
| #endif | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | float easeInOut2(float x) { | |
| float ox = 1.0f - x; | |
| float xp = x * x; | |
| return xp / (xp + ox * ox); | |
| } | |
| float easeOut2(float x) { | |
| return (easeInOut2(x * 0.5f + 0.5f, p) - 0.5f) * 2.0f; | |
| } |