mirror of
https://github.com/cnlohr/lolra.git
synced 2026-06-17 00:09:31 +00:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
.vscode
|
||||
build
|
||||
@@ -0,0 +1,23 @@
|
||||
# The following lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
|
||||
add_custom_target(stub_bootload
|
||||
# If the swadge is running reboot it into the bootloader.
|
||||
COMMAND make -C ../tools/reboot_into_bootloader reboot
|
||||
COMMAND sleep 0.5
|
||||
)
|
||||
#add_dependencies(flash before_flash)
|
||||
add_custom_target(stub_run
|
||||
#Sometimes the swadge needs a kick to get rebooted
|
||||
COMMAND sleep 0.5
|
||||
COMMAND esptool.py --before no_reset --after no_reset load_ram ../tools/bootload_reboot_stub/bootload_reboot_stub.bin
|
||||
)
|
||||
|
||||
|
||||
project(usb_sandbox)
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
idf_component_register(SRCS "main.c" "app.c"
|
||||
INCLUDE_DIRS "" )
|
||||
|
||||
|
||||
@@ -0,0 +1,454 @@
|
||||
/**
|
||||
|
||||
MIT-like-non-ai-license
|
||||
|
||||
Copyright (c) 2024 Charles Lohr "CNLohr"
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the two following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
In addition the following restrictions apply:
|
||||
|
||||
1. The Software and any modifications made to it may not be used for the
|
||||
purpose of training or improving machine learning algorithms, including but not
|
||||
limited to artificial intelligence, natural language processing, or data
|
||||
mining. This condition applies to any derivatives, modifications, or updates
|
||||
based on the Software code. Any usage of the Software in an AI-training dataset
|
||||
is considered a breach of this License.
|
||||
|
||||
2. The Software may not be included in any dataset used for training or
|
||||
improving machine learning algorithms, including but not limited to artificial
|
||||
intelligence, natural language processing, or data mining.
|
||||
|
||||
3. Any person or organization found to be in violation of these restrictions
|
||||
will be subject to legal action and may be held liable for any damages
|
||||
resulting from such use.
|
||||
|
||||
If any term is unenforcable, other terms remain in-force.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "esp_system.h"
|
||||
#include "hal/gpio_types.h"
|
||||
#include "esp_log.h"
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "soc/soc.h"
|
||||
#include "soc/system_reg.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "soc/gpio_sig_map.h"
|
||||
|
||||
|
||||
#include "soc/io_mux_reg.h"
|
||||
#include "soc/dedic_gpio_reg.h"
|
||||
|
||||
// Funtenna will output on GPIO1 and 14. Otherwise it will be 17 and 18
|
||||
//#define FUNTENNA
|
||||
|
||||
int global_i = 100;
|
||||
|
||||
|
||||
static inline uint32_t getCycleCount()
|
||||
{
|
||||
uint32_t ccount;
|
||||
asm volatile("rsr %0,ccount":"=a" (ccount));
|
||||
return ccount;
|
||||
}
|
||||
|
||||
|
||||
#define IO_MUX_REG(x) XIO_MUX_REG(x)
|
||||
#define XIO_MUX_REG(x) IO_MUX_GPIO##x##_REG
|
||||
|
||||
#define GPIO_NUM(x) XGPIO_NUM(x)
|
||||
#define XGPIO_NUM(x) GPIO_NUM_##x
|
||||
|
||||
|
||||
#ifdef FUNTENNA
|
||||
|
||||
#define RF1_PIN 1
|
||||
#define RF2_PIN 14
|
||||
#else
|
||||
#define RF1_PIN 17
|
||||
#define RF2_PIN 18
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include "hal/gpio_types.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "rom/gpio.h"
|
||||
#include "soc/i2s_reg.h"
|
||||
#include "soc/periph_defs.h"
|
||||
#include "rom/lldesc.h"
|
||||
#include "soc/rtc_cntl_reg.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "soc/regi2c_apll.h"
|
||||
//#include "components/hal/esp32s2/include/hal/regi2c_ctrl_ll.h
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
#include "esp_private/regi2c_ctrl.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
|
||||
#include "siggen.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#define I2C_RTC_WIFI_CLK_EN (SYSCON_WIFI_CLK_EN_REG)
|
||||
|
||||
#define I2C_RTC_CLK_GATE_EN (BIT(18))
|
||||
#define I2C_RTC_CLK_GATE_EN_M (BIT(18))
|
||||
#define I2C_RTC_CLK_GATE_EN_V 0x1
|
||||
#define I2C_RTC_CLK_GATE_EN_S 18
|
||||
|
||||
#define I2C_RTC_CONFIG0 0x6000e048
|
||||
|
||||
#define I2C_RTC_MAGIC_CTRL 0x00001FFF
|
||||
#define I2C_RTC_MAGIC_CTRL_M ((I2C_RTC_MAGIC_CTRL_V)<<(I2C_RTC_MAGIC_CTRL_S))
|
||||
#define I2C_RTC_MAGIC_CTRL_V 0x1FFF
|
||||
#define I2C_RTC_MAGIC_CTRL_S 4
|
||||
|
||||
#define I2C_RTC_CONFIG1 0x6000e044
|
||||
|
||||
#define I2C_RTC_BOD_MASK (BIT(22))
|
||||
#define I2C_RTC_BOD_MASK_M (BIT(22))
|
||||
#define I2C_RTC_BOD_MASK_V 0x1
|
||||
#define I2C_RTC_BOD_MASK_S 22
|
||||
|
||||
#define I2C_RTC_SAR_MASK (BIT(18))
|
||||
#define I2C_RTC_SAR_MASK_M (BIT(18))
|
||||
#define I2C_RTC_SAR_MASK_V 0x1
|
||||
#define I2C_RTC_SAR_MASK_S 18
|
||||
|
||||
#define I2C_RTC_BBPLL_MASK (BIT(17))
|
||||
#define I2C_RTC_BBPLL_MASK_M (BIT(17))
|
||||
#define I2C_RTC_BBPLL_MASK_V 0x1
|
||||
#define I2C_RTC_BBPLL_MASK_S 17
|
||||
|
||||
#define I2C_RTC_APLL_MASK (BIT(14))
|
||||
#define I2C_RTC_APLL_MASK_M (BIT(14))
|
||||
#define I2C_RTC_APLL_MASK_V 0x1
|
||||
#define I2C_RTC_APLL_MASK_S 14
|
||||
|
||||
#define I2C_RTC_ALL_MASK 0x00007FFF
|
||||
#define I2C_RTC_ALL_MASK_M ((I2C_RTC_ALL_MASK_V)<<(I2C_RTC_ALL_MASK_S))
|
||||
#define I2C_RTC_ALL_MASK_V 0x7FFF
|
||||
#define I2C_RTC_ALL_MASK_S 8
|
||||
|
||||
#define I2C_RTC_CONFIG2 0x6000e000
|
||||
|
||||
#define I2C_RTC_BUSY (BIT(25))
|
||||
#define I2C_RTC_BUSY_M (BIT(25))
|
||||
#define I2C_RTC_BUSY_V 0x1
|
||||
#define I2C_RTC_BUSY_S 25
|
||||
|
||||
#define I2C_RTC_WR_CNTL (BIT(24))
|
||||
#define I2C_RTC_WR_CNTL_M (BIT(24))
|
||||
#define I2C_RTC_WR_CNTL_V 0x1
|
||||
#define I2C_RTC_WR_CNTL_S 24
|
||||
|
||||
#define I2C_RTC_DATA 0x000000FF
|
||||
#define I2C_RTC_DATA_M ((I2C_RTC_DATA_V)<<(I2C_RTC_DATA_S))
|
||||
#define I2C_RTC_DATA_V 0xFF
|
||||
#define I2C_RTC_DATA_S 16
|
||||
|
||||
#define I2C_RTC_ADDR 0x000000FF
|
||||
#define I2C_RTC_ADDR_M ((I2C_RTC_ADDR_V)<<(I2C_RTC_ADDR_S))
|
||||
#define I2C_RTC_ADDR_V 0xFF
|
||||
#define I2C_RTC_ADDR_S 8
|
||||
|
||||
#define I2C_RTC_SLAVE_ID 0x000000FF
|
||||
#define I2C_RTC_SLAVE_ID_M ((I2C_RTC_SLAVE_ID_V)<<(I2C_RTC_SLAVE_ID_S))
|
||||
#define I2C_RTC_SLAVE_ID_V 0xFF
|
||||
#define I2C_RTC_SLAVE_ID_S 0
|
||||
|
||||
#define I2C_RTC_MAGIC_DEFAULT (0x1c40)
|
||||
|
||||
#define I2C_BOD 0x61
|
||||
#define I2C_BBPLL 0x66
|
||||
#define I2C_SAR_ADC 0X69
|
||||
#define I2C_APLL 0X6D
|
||||
|
||||
|
||||
int lastend = 0;
|
||||
|
||||
// Configures APLL = 480 / 4 = 120
|
||||
// 40 * (SDM2 + SDM1/(2^8) + SDM0/(2^16) + 4) / ( 2 * (ODIV+2) );
|
||||
// Datasheet recommends that numerator does not exceed 500MHz.
|
||||
void IRAM_ATTR local_rtc_clk_apll_enable(bool enable, uint32_t sdm0, uint32_t sdm1, uint32_t sdm2, uint32_t o_div)
|
||||
{
|
||||
REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PD, enable ? 0 : 1);
|
||||
REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PU, enable ? 1 : 0);
|
||||
|
||||
if (enable) {
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_DSDM2, sdm2);
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_DSDM0, sdm0);
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_DSDM1, sdm1);
|
||||
REGI2C_WRITE(I2C_APLL, I2C_APLL_SDM_STOP, CLK_LL_APLL_SDM_STOP_VAL_1);
|
||||
REGI2C_WRITE(I2C_APLL, I2C_APLL_SDM_STOP, CLK_LL_APLL_SDM_STOP_VAL_2_REV1);
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OR_OUTPUT_DIV, o_div );
|
||||
}
|
||||
|
||||
|
||||
// Settings determined experimentally.
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_TSCHGP, 0 ); // 0 or 1
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_EN_FAST_CAL, 1 ); // 0 or 1
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_DHREF_SEL, 0 ); // 0..3
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_DLREF_SEL, 0 ); // 0..3
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_SDM_DITHER, 1 ); // 0 or 1
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_DVDD, 25 ); // 0 .. 31
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IRAM_ATTR regi2c_write_reg_raw_local(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t data)
|
||||
{
|
||||
uint32_t temp = ((block & I2C_RTC_SLAVE_ID_V) << I2C_RTC_SLAVE_ID_S)
|
||||
| ((reg_add & I2C_RTC_ADDR_V) << I2C_RTC_ADDR_S)
|
||||
| ((0x1 & I2C_RTC_WR_CNTL_V) << I2C_RTC_WR_CNTL_S)
|
||||
| (((uint32_t)data & I2C_RTC_DATA_V) << I2C_RTC_DATA_S);
|
||||
while (REG_GET_BIT(I2C_RTC_CONFIG2, I2C_RTC_BUSY));
|
||||
REG_WRITE(I2C_RTC_CONFIG2, temp);
|
||||
}
|
||||
|
||||
|
||||
void apll_quick_update( uint32_t sdm )
|
||||
{
|
||||
uint8_t sdm2 = sdm>>16;
|
||||
uint8_t sdm1 = (sdm>>8)&0xff;
|
||||
uint8_t sdm0 = (sdm>>0)&0xff;
|
||||
static int last_sdm_0 = -1;
|
||||
static int last_sdm_1 = -1;
|
||||
static int last_sdm_2 = -1;
|
||||
|
||||
if( sdm2 != last_sdm_2 )
|
||||
regi2c_write_reg_raw_local(I2C_APLL, I2C_APLL_HOSTID, I2C_APLL_DSDM2, sdm2);
|
||||
if( sdm0 != last_sdm_0 )
|
||||
regi2c_write_reg_raw_local(I2C_APLL, I2C_APLL_HOSTID, I2C_APLL_DSDM0, sdm0);
|
||||
if( sdm1 != last_sdm_1 )
|
||||
regi2c_write_reg_raw_local(I2C_APLL, I2C_APLL_HOSTID, I2C_APLL_DSDM1, sdm1);
|
||||
|
||||
last_sdm_2 = sdm2;
|
||||
last_sdm_1 = sdm1;
|
||||
last_sdm_0 = sdm0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void sandbox_main()
|
||||
{
|
||||
printf( "sandbox_main()\n" );
|
||||
|
||||
|
||||
|
||||
DPORT_SET_PERI_REG_MASK( DPORT_CPU_PERI_CLK_EN_REG, DPORT_CLK_EN_DEDICATED_GPIO );
|
||||
DPORT_CLEAR_PERI_REG_MASK( DPORT_CPU_PERI_RST_EN_REG, DPORT_RST_EN_DEDICATED_GPIO);
|
||||
|
||||
// Setup GPIO39 to be the PRO ALONE output (For LEDs)
|
||||
REG_WRITE( GPIO_OUT1_W1TC_REG, 1<<(39-32) );
|
||||
REG_WRITE( GPIO_ENABLE1_W1TS_REG, 1<<(39-32) );
|
||||
REG_WRITE( IO_MUX_GPIO39_REG, 2<<FUN_DRV_S );
|
||||
REG_WRITE( GPIO_FUNC39_OUT_SEL_CFG_REG, PRO_ALONEGPIO_OUT0_IDX );
|
||||
REG_WRITE( DEDIC_GPIO_OUT_CPU_REG, 0x01 ); // Enable CPU instruction output
|
||||
|
||||
|
||||
// Output clock on P2.
|
||||
|
||||
// Maximize the drive strength.
|
||||
gpio_set_drive_capability( GPIO_NUM(RF1_PIN), GPIO_DRIVE_CAP_3 );
|
||||
gpio_set_drive_capability( GPIO_NUM(RF2_PIN), GPIO_DRIVE_CAP_3 );
|
||||
|
||||
// Use the IO matrix to create the inverse of TX on pin 17.
|
||||
gpio_matrix_out( GPIO_NUM(RF1_PIN), CLK_I2S_MUX_IDX, 1, 0 );
|
||||
gpio_matrix_out( GPIO_NUM(RF2_PIN), CLK_I2S_MUX_IDX, 0, 0 );
|
||||
|
||||
periph_module_enable(PERIPH_I2S0_MODULE);
|
||||
|
||||
int use_apll = 1;
|
||||
|
||||
// Start with a default tone.
|
||||
int sdm0 = 100;
|
||||
int sdm1 = 230;
|
||||
int sdm2 = 8;
|
||||
int odiv = 0;
|
||||
|
||||
local_rtc_clk_apll_enable( use_apll, sdm0, sdm1, sdm2, odiv );
|
||||
|
||||
if( use_apll )
|
||||
{
|
||||
WRITE_PERI_REG( I2S_CLKM_CONF_REG(0), (1<<I2S_CLK_SEL_S) | (1<<I2S_CLK_EN_S) | (0<<I2S_CLKM_DIV_A_S) | (0<<I2S_CLKM_DIV_B_S) | (1<<I2S_CLKM_DIV_NUM_S) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// fI2S = fCLK / ( N + B/A )
|
||||
// DIV_NUM = N
|
||||
// Note I2S_CLKM_DIV_NUM minimum = 2 by datasheet. Less than that and it will ignoreeee you.
|
||||
WRITE_PERI_REG( I2S_CLKM_CONF_REG(0), (2<<I2S_CLK_SEL_S) | (1<<I2S_CLK_EN_S) | (0<<I2S_CLKM_DIV_A_S) | (0<<I2S_CLKM_DIV_B_S) | (1<<I2S_CLKM_DIV_NUM_S) ); // Minimum reduction, 2:1
|
||||
}
|
||||
|
||||
SigSetupTest( );
|
||||
|
||||
lastend = getCycleCount();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define DisableISR() do { XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); portbenchmarkINTERRUPT_DISABLE(); } while (0)
|
||||
#define EnableISR() do { portbenchmarkINTERRUPT_RESTORE(0); XTOS_SET_INTLEVEL(0); } while (0)
|
||||
|
||||
|
||||
uint32_t frame = 0;
|
||||
void sandbox_tick()
|
||||
{
|
||||
//uprintf( "%08x\n", REGI2C_READ(I2C_APLL, I2C_APLL_DSDM2 ));
|
||||
// 40 * (SDM2 + SDM1/(2^8) + SDM0/(2^16) + 4) / ( 2 * (ODIV+2) );\n
|
||||
|
||||
// 13rd harmonic.
|
||||
const float fRadiator = 904.50 + 0.00; // 0.02 is specific to this device.
|
||||
const float fBandwidth = .125;
|
||||
const float fHarmonic = 13.0;
|
||||
const float fOffset = -(fBandwidth/2);
|
||||
const float fXTAL = 40;
|
||||
|
||||
const float fTarg = (fRadiator+fOffset)/fHarmonic;
|
||||
const float fAPLL = fTarg * 2;
|
||||
const uint32_t sdmBaseTarget = ( fAPLL * 4 / fXTAL - 4 ) * 65536 + 0.5; // ~649134
|
||||
|
||||
|
||||
const float fRange = (fBandwidth)/fHarmonic;
|
||||
const float fAPLLRange = fRange * 2;
|
||||
const float sdmRange = ( fAPLLRange * 4 / fXTAL ) * 65536; // ~126
|
||||
|
||||
// 491520 clocks per chip @ SF8 (2.048ms per chirp)
|
||||
const uint32_t sdmDivisor = ( CHIPSSPREAD / sdmRange ) + 0.5;
|
||||
|
||||
|
||||
#if 0
|
||||
// For DEBUGGING ONLY
|
||||
int k;
|
||||
//DisableISR();
|
||||
for( k = 0; k < 33; k++ )
|
||||
{
|
||||
int fplv = 0;
|
||||
|
||||
// Send every second
|
||||
// If you want to dialate time, do it here.
|
||||
frame = (getCycleCount()/200) % 24000000;
|
||||
fplv = SigGen( frame, codeTarg );
|
||||
uint32_t codeTargUse = codeTarg + fplv;
|
||||
uint32_t sdm = (codeTargUse * 2 / 40 - 4 * 65536); //XXX WARNING CHARLES, why does this move in pairs?
|
||||
apll_quick_update( sdm );
|
||||
if( fplv < 0 ) break;
|
||||
|
||||
if( fplv > 0 )
|
||||
uprintf( "%d %d\n", (int)sdm, (int)fplv );
|
||||
}
|
||||
//EnableISR();
|
||||
#else
|
||||
|
||||
uint32_t start = getCycleCount();
|
||||
frame = (start) % 24000000;
|
||||
int do_send = false;
|
||||
if( (uint32_t)(start - lastend) > 240000000 )
|
||||
{
|
||||
do_send = true;
|
||||
}
|
||||
|
||||
{
|
||||
int spin;
|
||||
|
||||
gpio_matrix_out( 39, PRO_ALONEGPIO_OUT0_IDX, 0, 0 );
|
||||
gpio_set_drive_capability( 39, GPIO_DRIVE_CAP_3 );
|
||||
|
||||
// Create an RGB Rainbow value
|
||||
uint32_t ws_out = 0xff00ff;//do_send? 0 : 0xff;
|
||||
|
||||
#define nop __asm__ __volatile__("nop\n")
|
||||
int i;
|
||||
// Shift out all 24 bits, note the 1 and 3 for timing is baesed off an XTAL clock.
|
||||
for( i = 0; i < 24; i++ )
|
||||
{
|
||||
__asm__ __volatile__ ("set_bit_gpio_out 0x1");
|
||||
|
||||
int high_for = ( ws_out & 0x800000 )?3:1;
|
||||
for( spin = 0; spin < high_for; spin++ ) nop;
|
||||
|
||||
__asm__ __volatile__ ("clr_bit_gpio_out 0x1");
|
||||
int low_for = ( ws_out & 0x800000 )?1:3;
|
||||
for( spin = 0; spin < low_for; spin++ ) nop;
|
||||
|
||||
ws_out<<=1;
|
||||
}
|
||||
esp_rom_delay_us( 5000 );
|
||||
|
||||
}
|
||||
|
||||
if( do_send )
|
||||
{
|
||||
SigSetupTest();
|
||||
int iterct = 0;
|
||||
int dither = 0;
|
||||
|
||||
gpio_matrix_out( GPIO_NUM(RF1_PIN), CLK_I2S_MUX_IDX, 1, 0 );
|
||||
gpio_matrix_out( GPIO_NUM(RF2_PIN), CLK_I2S_MUX_IDX, 0, 0 );
|
||||
//REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PD, 0);
|
||||
//REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PU, 1);
|
||||
|
||||
//DisableISR();
|
||||
while(1)
|
||||
{
|
||||
int fplv = 0;
|
||||
// Send every second
|
||||
// If you want to dialate time, do it here.
|
||||
frame = (getCycleCount()) - start;
|
||||
fplv = SigGen( frame, sdmBaseTarget );
|
||||
|
||||
|
||||
//XXX TODO: Experiment more with dither. It doesn't appear to have an immediate effect?
|
||||
//dither = ( dither + sdmDivisor/4) % sdmDivisor;
|
||||
uint32_t sdm = sdmBaseTarget + ( fplv + dither ) / sdmDivisor;
|
||||
|
||||
if( fplv < 0 ) break;
|
||||
apll_quick_update( sdm );
|
||||
iterct++;
|
||||
}
|
||||
//EnableISR();
|
||||
//REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PU, 0);
|
||||
//REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PD, 1);
|
||||
|
||||
gpio_matrix_out( GPIO_NUM(RF1_PIN), CLK_I2S_MUX_IDX, 1, 1 );
|
||||
gpio_matrix_out( GPIO_NUM(RF2_PIN), CLK_I2S_MUX_IDX, 0, 1 );
|
||||
|
||||
printf( "Iter: %d\n", iterct );
|
||||
lastend = getCycleCount();
|
||||
}
|
||||
#endif
|
||||
|
||||
// vTaskDelay( 1 );
|
||||
}
|
||||
|
||||
struct SandboxStruct
|
||||
{
|
||||
void (*fnIdle)();
|
||||
};
|
||||
struct SandboxStruct sandbox_mode =
|
||||
{
|
||||
.fnIdle = sandbox_tick,
|
||||
};
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Charles Lohr "CNLohr"
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "esp_system.h"
|
||||
#include "spi_flash_mmap.h"
|
||||
#include "esp_efuse.h"
|
||||
#include "esp_efuse_table.h" // or "esp_efuse_custom_table.h"
|
||||
#include "esp_task_wdt.h"
|
||||
#include "esp_log.h"
|
||||
#include "soc/dedic_gpio_reg.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "soc/soc.h"
|
||||
#include "soc/system_reg.h"
|
||||
#include "soc/usb_reg.h"
|
||||
#include "ulp_riscv.h"
|
||||
#include "driver/rtc_io.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "rom/gpio.h"
|
||||
#include "soc/rtc.h"
|
||||
|
||||
#define SOC_DPORT_USB_BASE 0x60080000
|
||||
|
||||
struct SandboxStruct
|
||||
{
|
||||
void (*fnIdle)();
|
||||
};
|
||||
|
||||
|
||||
struct SandboxStruct * g_SandboxStruct;
|
||||
|
||||
|
||||
void esp_sleep_enable_timer_wakeup();
|
||||
|
||||
volatile void * keep_symbols[] = { 0, vTaskDelay, ulp_riscv_halt,
|
||||
ulp_riscv_timer_resume, ulp_riscv_timer_stop, ulp_riscv_load_binary,
|
||||
ulp_riscv_run, ulp_riscv_config_and_run, esp_sleep_enable_timer_wakeup,
|
||||
ulp_set_wakeup_period, rtc_gpio_init, rtc_gpio_set_direction,
|
||||
rtc_gpio_set_level, gpio_config, gpio_matrix_out, gpio_matrix_in,
|
||||
rtc_clk_cpu_freq_get_config, rtc_clk_cpu_freq_set_config_fast,
|
||||
rtc_clk_apb_freq_get };
|
||||
|
||||
extern struct SandboxStruct sandbox_mode;
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
printf("Hello world! Keep table at %p\n", &keep_symbols );
|
||||
|
||||
g_SandboxStruct = &sandbox_mode;
|
||||
|
||||
// esp_efuse_set_rom_log_scheme(ESP_EFUSE_ROM_LOG_ALWAYS_OFF);
|
||||
esp_efuse_set_rom_log_scheme(ESP_EFUSE_ROM_LOG_ALWAYS_ON);
|
||||
|
||||
printf("Minimum free heap size: %d bytes\n", (int)esp_get_minimum_free_heap_size());
|
||||
|
||||
void sandbox_main();
|
||||
|
||||
sandbox_main();
|
||||
|
||||
do
|
||||
{
|
||||
if( g_SandboxStruct && g_SandboxStruct->fnIdle ) { g_SandboxStruct->fnIdle(); }
|
||||
esp_task_wdt_reset();
|
||||
taskYIELD();
|
||||
} while( 1 );
|
||||
|
||||
// printf("Restarting now.\n");
|
||||
// fflush(stdout);
|
||||
// esp_restart();
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
/**
|
||||
|
||||
MIT-like-non-ai-license
|
||||
|
||||
Copyright (c) 2024 Charles Lohr "CNLohr"
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the two following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
In addition the following restrictions apply:
|
||||
|
||||
1. The Software and any modifications made to it may not be used for the
|
||||
purpose of training or improving machine learning algorithms, including but not
|
||||
limited to artificial intelligence, natural language processing, or data
|
||||
mining. This condition applies to any derivatives, modifications, or updates
|
||||
based on the Software code. Any usage of the Software in an AI-training dataset
|
||||
is considered a breach of this License.
|
||||
|
||||
2. The Software may not be included in any dataset used for training or
|
||||
improving machine learning algorithms, including but not limited to artificial
|
||||
intelligence, natural language processing, or data mining.
|
||||
|
||||
3. Any person or organization found to be in violation of these restrictions
|
||||
will be subject to legal action and may be held liable for any damages
|
||||
resulting from such use.
|
||||
|
||||
If any term is unenforcable, other terms remain in-force.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#ifndef _SIGGEN_H
|
||||
#define _SIGGEN_H
|
||||
|
||||
#include <string.h>
|
||||
#include "../../../lib/LoRa-SDR-Code.h"
|
||||
|
||||
#define SF_NUMBER 10
|
||||
|
||||
// This is MEGA overkill. No way would we ever use them all.
|
||||
#define MAX_SYMBOLS 2070
|
||||
|
||||
// https://electronics.stackexchange.com/questions/278192/understanding-the-relationship-between-lora-chips-chirps-symbols-and-bits
|
||||
// Has some good hints
|
||||
|
||||
// At 125kHz
|
||||
// https://medium.com/@prajzler/what-is-lora-the-fundamentals-79a5bb3e6dec
|
||||
// With SF5, You get 3906 chips/second "Symbol Rate" (Included to help with math division)
|
||||
// With SF7, You get 976 chips/second / 5469 bits/sec
|
||||
|
||||
// 7 bits per symbol (I think)
|
||||
// 7 * 4/5 = 5.6 data bits per symbol.
|
||||
// https://wirelesspi.com/understanding-lora-phy-long-range-physical-layer/ says 7 for SF7
|
||||
|
||||
#define MARK_FROM_SF0 (1<<SF_NUMBER)
|
||||
|
||||
// Determined experimentally, but this is the amount you have to divide the chip by to
|
||||
// Fully use the 125000 Hz channel Bandwidth.
|
||||
//#define DESPREAD (50*MARK_FROM_SF6)
|
||||
|
||||
#define CHIPRATE 8 // chirp length for SF0, in us
|
||||
#define CHIPSSPREAD ((uint32_t)(240ULL*MARK_FROM_SF0*CHIPRATE))
|
||||
|
||||
#define PREAMBLE_CHIRPS 10
|
||||
#define CODEWORD_LENGTH 2
|
||||
int symbols_len = 1;
|
||||
uint16_t symbols[MAX_SYMBOLS];
|
||||
|
||||
uint32_t quadsetcount;
|
||||
int32_t quadsets[MAX_SYMBOLS*4+PREAMBLE_CHIRPS*4+9+CODEWORD_LENGTH*4];
|
||||
|
||||
int32_t * AddChirp( int32_t * qso, int offset, int verneer )
|
||||
{
|
||||
offset = offset * CHIPSSPREAD / (MARK_FROM_SF0);
|
||||
offset += verneer;
|
||||
*(qso++) = (CHIPSSPREAD * 0 / 4 + offset + CHIPSSPREAD ) % CHIPSSPREAD;
|
||||
*(qso++) = (CHIPSSPREAD * 1 / 4 + offset + CHIPSSPREAD ) % CHIPSSPREAD;
|
||||
*(qso++) = (CHIPSSPREAD * 2 / 4 + offset + CHIPSSPREAD ) % CHIPSSPREAD;
|
||||
*(qso++) = (CHIPSSPREAD * 3 / 4 + offset + CHIPSSPREAD ) % CHIPSSPREAD;
|
||||
return qso;
|
||||
}
|
||||
|
||||
static void SigSetupTest()
|
||||
{
|
||||
memset( symbols, 0, sizeof( symbols ) );
|
||||
|
||||
uint8_t payload_in[258] = { 0x40/*0x48*/, 0xcc/*0x45*/, 0xde, 0x55, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22};
|
||||
int payload_in_size = 6;
|
||||
static uint8_t uctr;
|
||||
payload_in[4] = uctr++;
|
||||
int _rdd = 0; // 1 = 4/5, 4 = 4/8 Coding Rate
|
||||
|
||||
int r = CreateMessageFromPayload( symbols, &symbols_len, MAX_SYMBOLS, SF_NUMBER, 4, payload_in, payload_in_size );
|
||||
|
||||
if( r < 0 )
|
||||
{
|
||||
printf( "Error generating stream: %d\n", r );
|
||||
quadsetcount = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int j;
|
||||
//for( j = 0; j < symbols_len; j++ )
|
||||
// symbols[j] = 255 - symbols[j];
|
||||
|
||||
quadsetcount = 0;
|
||||
int32_t * qso = quadsets;
|
||||
for( j = 0; j < PREAMBLE_CHIRPS; j++ )
|
||||
{
|
||||
qso = AddChirp( qso, 0, 0 );
|
||||
}
|
||||
|
||||
uint8_t syncword = 0x43;
|
||||
|
||||
#if SF_NUMBER <= 6
|
||||
#define CODEWORD_SHIFT 2 // XXX TODO: No idea what this would do here! XXX This is probably wrong.
|
||||
#elif SF_NUMBER >= 11
|
||||
#define CODEWORD_SHIFT 5 // XXX TODO: Unknown for SF11, SF12 Might be 3?
|
||||
#else
|
||||
#define CODEWORD_SHIFT 3
|
||||
#endif
|
||||
|
||||
if( CODEWORD_LENGTH > 0 )
|
||||
qso = AddChirp( qso, ( ( syncword & 0xf ) << CODEWORD_SHIFT ), 0 );
|
||||
if( CODEWORD_LENGTH > 1 )
|
||||
qso = AddChirp( qso, ( ( ( syncword & 0xf0 ) >> 4 ) << CODEWORD_SHIFT ), 0 );
|
||||
|
||||
|
||||
*(qso++) = -(CHIPSSPREAD * 0 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 1 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 2 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 3 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 0 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 1 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 2 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 3 / 4 )-1;
|
||||
*(qso++) = -(CHIPSSPREAD * 0 / 4 )-1;
|
||||
|
||||
if( SF_NUMBER <= 6 )
|
||||
{
|
||||
// Two additional upchirps with SF6 https://github.com/tapparelj/gr-lora_sdr/issues/74#issuecomment-1891569580
|
||||
for( j = 0; j < 2; j++ )
|
||||
{
|
||||
qso = AddChirp( qso, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
for( j = 0; j < symbols_len; j++ )
|
||||
{
|
||||
int ofs = symbols[j];
|
||||
//ofs = ofs ^ ((MARK_FROM_SF6<<6) -1);
|
||||
//ofs &= (MARK_FROM_SF6<<6) -1;
|
||||
qso = AddChirp( qso, ofs, 0 );
|
||||
}
|
||||
|
||||
quadsetcount = qso - quadsets;
|
||||
// printf( "--- %d %d %d\n", symbols_len, quadsetcount, CHIPSSPREAD/4 );
|
||||
}
|
||||
|
||||
static int32_t SigGen( uint32_t Frame240MHz, uint32_t codeTarg )
|
||||
{
|
||||
// TODO: Get some of these encode things going: https://github.com/myriadrf/LoRa-SDR/blob/master/LoRaCodes.hpp
|
||||
|
||||
// frame = 0...240000000
|
||||
uint32_t sectionQuarterNumber = Frame240MHz / (CHIPSSPREAD/4);
|
||||
if( sectionQuarterNumber >= quadsetcount )
|
||||
return -codeTarg;
|
||||
|
||||
int32_t quadValue = quadsets[sectionQuarterNumber];
|
||||
uint32_t placeInQuad = Frame240MHz % (CHIPSSPREAD/4);
|
||||
|
||||
if( quadValue >= 0 )
|
||||
return ( ( quadValue + placeInQuad ) % CHIPSSPREAD); // Up-Chirp
|
||||
else
|
||||
return ( ( quadValue - placeInQuad + CHIPSSPREAD ) % CHIPSSPREAD ); // Down-Chirp
|
||||
|
||||
#if 0
|
||||
// Let's say 1ms per sweep.
|
||||
int32_t sectionQuarterNumber = Frame240MHz / (CHIPSSPREAD/4);
|
||||
uint32_t placeInSweep = Frame240MHz % CHIPSSPREAD;
|
||||
// 2400 edge-to-edge =
|
||||
if( sectionQuarterNumber < 0 ) return -codeTarg;
|
||||
|
||||
sectionQuarterNumber -= PREAMBLE_CHIRPS*4;
|
||||
|
||||
// Preamble Start
|
||||
if( sectionQuarterNumber < 0 )
|
||||
{
|
||||
return ((placeInSweep /*+ 240000/2*/) % CHIPSSPREAD) / DESPREAD;
|
||||
}
|
||||
|
||||
// Last 2 codes here are for the sync word.
|
||||
|
||||
#define SYNC_WORD
|
||||
#ifdef SYNC_WORD
|
||||
// https://static1.squarespace.com/static/54cecce7e4b054df1848b5f9/t/57489e6e07eaa0105215dc6c/1464376943218/Reversing-Lora-Knight.pdf
|
||||
// Says that this does not exist. but, it does seem to exist in some of their waterfalls.
|
||||
sectionQuarterNumber -= 4*2;
|
||||
// Two symbols
|
||||
if( sectionQuarterNumber < 0 )
|
||||
{
|
||||
int32_t chirp = (8+sectionQuarterNumber)/4;
|
||||
uint32_t SYNCWORD = (((0x34)>>(4-chirp*4)) & 0xf)<<3; //0x34 for some vendors?
|
||||
int32_t offset = SYNCWORD * CHIPSSPREAD / (MARK_FROM_SF7*128);
|
||||
return (( placeInSweep + offset) % CHIPSSPREAD) / DESPREAD;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
|
||||
EXTRA NOTES: lora-grc says to look for sync word 18
|
||||
*/
|
||||
|
||||
|
||||
|
||||
sectionQuarterNumber -= 9;
|
||||
|
||||
if( sectionQuarterNumber < 0 )
|
||||
{
|
||||
// Down-Sweeps for Sync
|
||||
return ((CHIPSSPREAD-placeInSweep/*+240000/2*/) % CHIPSSPREAD) / DESPREAD;
|
||||
}
|
||||
|
||||
uint32_t chirp = (sectionQuarterNumber)/4;
|
||||
if( chirp < symbols_len )
|
||||
{
|
||||
placeInSweep += (CHIPSSPREAD*3/4);
|
||||
uint32_t offset = ( symbols[chirp] + 0 ) * CHIPSSPREAD / (MARK_FROM_SF7*128);
|
||||
fplv = ((placeInSweep + offset) % CHIPSSPREAD) / DESPREAD;
|
||||
return fplv;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -codeTarg;
|
||||
//return -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
A real semtech SX1276 will produce 16 symbols at SF8 if
|
||||
Given 2 byte payload, CRC explicit header.
|
||||
Given 3 bytes of payload, that goes up to 24 symbols.
|
||||
|
||||
[HEADER] [HEADER*0.5] [HEADER] **An extra byte** [PAYLOAD] [PAYLOAD] [PAYLOAD] [CRC] [CRC] << Does not fit.
|
||||
|
||||
Payload sizes:
|
||||
-5 would be 8 (Considering CRC would be -3 bytes)
|
||||
-4 would be 8
|
||||
-3 would be 8
|
||||
-2 would be 8
|
||||
-1 would be 16
|
||||
0 would be 16
|
||||
1 byte: 16 symbols. (Include CRC so 3 bytes)
|
||||
2 byte: 16 symbols. (Include CRC so 4 bytes)
|
||||
// theoreteically, 2 bytes + 2 crc should fit nicely into 16 symbols (or 8 bytes) BUT 3+2 (5) does not.
|
||||
|
||||
3 byte: 24 symbols. (Include CRC so 5 bytes)
|
||||
4 byte: 24 symbols
|
||||
5 byte: 24 symbols.
|
||||
6 byte: 24 symbols.
|
||||
7 byte: 32 symbols.
|
||||
8 byte: 32 symbols.
|
||||
9 byte: 32 symbols.
|
||||
10 byte: 32 symbols.
|
||||
11 byte: 40 symbols.
|
||||
|
||||
That means there's
|
||||
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
|
||||
# Note: if you change the size of the nvs partition, make sure to update NVS_PARTITION_SIZE in `components/hdw-nvs/nvs_manager.h`
|
||||
nvs, data, nvs, 0x9000, 0x6000,
|
||||
phy_init, data, phy, 0xf000, 0x1000,
|
||||
factory, app, factory, 0x10000, 1M,
|
||||
storage, data, spiffs, , 0xF0000,
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
.vscode
|
||||
build
|
||||
@@ -0,0 +1,23 @@
|
||||
# The following lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
|
||||
add_custom_target(stub_bootload
|
||||
# If the swadge is running reboot it into the bootloader.
|
||||
COMMAND make -C ../tools/reboot_into_bootloader reboot
|
||||
COMMAND sleep 0.5
|
||||
)
|
||||
#add_dependencies(flash before_flash)
|
||||
add_custom_target(stub_run
|
||||
#Sometimes the swadge needs a kick to get rebooted
|
||||
COMMAND sleep 0.5
|
||||
COMMAND esptool.py --before no_reset --after no_reset load_ram ../tools/bootload_reboot_stub/bootload_reboot_stub.bin
|
||||
)
|
||||
|
||||
|
||||
project(usb_sandbox)
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
idf_component_register(SRCS "main.c" "app.c"
|
||||
INCLUDE_DIRS "" )
|
||||
|
||||
|
||||
@@ -0,0 +1,357 @@
|
||||
/**
|
||||
|
||||
MIT-like-non-ai-license
|
||||
|
||||
Copyright (c) 2024 Charles Lohr "CNLohr"
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the two following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
In addition the following restrictions apply:
|
||||
|
||||
1. The Software and any modifications made to it may not be used for the
|
||||
purpose of training or improving machine learning algorithms, including but not
|
||||
limited to artificial intelligence, natural language processing, or data
|
||||
mining. This condition applies to any derivatives, modifications, or updates
|
||||
based on the Software code. Any usage of the Software in an AI-training dataset
|
||||
is considered a breach of this License.
|
||||
|
||||
2. The Software may not be included in any dataset used for training or
|
||||
improving machine learning algorithms, including but not limited to artificial
|
||||
intelligence, natural language processing, or data mining.
|
||||
|
||||
3. Any person or organization found to be in violation of these restrictions
|
||||
will be subject to legal action and may be held liable for any damages
|
||||
resulting from such use.
|
||||
|
||||
If any term is unenforcable, other terms remain in-force.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
**/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "esp_system.h"
|
||||
#include "hal/gpio_types.h"
|
||||
#include "esp_log.h"
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "soc/soc.h"
|
||||
#include "soc/system_reg.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "soc/gpio_sig_map.h"
|
||||
|
||||
|
||||
#include "soc/io_mux_reg.h"
|
||||
#include "soc/dedic_gpio_reg.h"
|
||||
|
||||
#include "image.h"
|
||||
|
||||
|
||||
// Funtenna will output on GPIO1 and 14. Otherwise it will be 17 and 18
|
||||
//#define FUNTENNA
|
||||
|
||||
int global_i = 100;
|
||||
|
||||
|
||||
static inline uint32_t getCycleCount()
|
||||
{
|
||||
uint32_t ccount;
|
||||
asm volatile("rsr %0,ccount":"=a" (ccount));
|
||||
return ccount;
|
||||
}
|
||||
|
||||
|
||||
#define IO_MUX_REG(x) XIO_MUX_REG(x)
|
||||
#define XIO_MUX_REG(x) IO_MUX_GPIO##x##_REG
|
||||
|
||||
#define GPIO_NUM(x) XGPIO_NUM(x)
|
||||
#define XGPIO_NUM(x) GPIO_NUM_##x
|
||||
|
||||
|
||||
#ifdef FUNTENNA
|
||||
|
||||
#define RF1_PIN 1
|
||||
#define RF2_PIN 14
|
||||
#else
|
||||
#define RF1_PIN 17
|
||||
#define RF2_PIN 18
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include "hal/gpio_types.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "rom/gpio.h"
|
||||
#include "soc/i2s_reg.h"
|
||||
#include "soc/periph_defs.h"
|
||||
#include "rom/lldesc.h"
|
||||
#include "soc/rtc_cntl_reg.h"
|
||||
#include "soc/rtc.h"
|
||||
#include "soc/regi2c_apll.h"
|
||||
//#include "components/hal/esp32s2/include/hal/regi2c_ctrl_ll.h
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
#include "esp_private/regi2c_ctrl.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
|
||||
#include "siggen.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#define I2C_RTC_WIFI_CLK_EN (SYSCON_WIFI_CLK_EN_REG)
|
||||
|
||||
#define I2C_RTC_CLK_GATE_EN (BIT(18))
|
||||
#define I2C_RTC_CLK_GATE_EN_M (BIT(18))
|
||||
#define I2C_RTC_CLK_GATE_EN_V 0x1
|
||||
#define I2C_RTC_CLK_GATE_EN_S 18
|
||||
|
||||
#define I2C_RTC_CONFIG0 0x6000e048
|
||||
|
||||
#define I2C_RTC_MAGIC_CTRL 0x00001FFF
|
||||
#define I2C_RTC_MAGIC_CTRL_M ((I2C_RTC_MAGIC_CTRL_V)<<(I2C_RTC_MAGIC_CTRL_S))
|
||||
#define I2C_RTC_MAGIC_CTRL_V 0x1FFF
|
||||
#define I2C_RTC_MAGIC_CTRL_S 4
|
||||
|
||||
#define I2C_RTC_CONFIG1 0x6000e044
|
||||
|
||||
#define I2C_RTC_BOD_MASK (BIT(22))
|
||||
#define I2C_RTC_BOD_MASK_M (BIT(22))
|
||||
#define I2C_RTC_BOD_MASK_V 0x1
|
||||
#define I2C_RTC_BOD_MASK_S 22
|
||||
|
||||
#define I2C_RTC_SAR_MASK (BIT(18))
|
||||
#define I2C_RTC_SAR_MASK_M (BIT(18))
|
||||
#define I2C_RTC_SAR_MASK_V 0x1
|
||||
#define I2C_RTC_SAR_MASK_S 18
|
||||
|
||||
#define I2C_RTC_BBPLL_MASK (BIT(17))
|
||||
#define I2C_RTC_BBPLL_MASK_M (BIT(17))
|
||||
#define I2C_RTC_BBPLL_MASK_V 0x1
|
||||
#define I2C_RTC_BBPLL_MASK_S 17
|
||||
|
||||
#define I2C_RTC_APLL_MASK (BIT(14))
|
||||
#define I2C_RTC_APLL_MASK_M (BIT(14))
|
||||
#define I2C_RTC_APLL_MASK_V 0x1
|
||||
#define I2C_RTC_APLL_MASK_S 14
|
||||
|
||||
#define I2C_RTC_ALL_MASK 0x00007FFF
|
||||
#define I2C_RTC_ALL_MASK_M ((I2C_RTC_ALL_MASK_V)<<(I2C_RTC_ALL_MASK_S))
|
||||
#define I2C_RTC_ALL_MASK_V 0x7FFF
|
||||
#define I2C_RTC_ALL_MASK_S 8
|
||||
|
||||
#define I2C_RTC_CONFIG2 0x6000e000
|
||||
|
||||
#define I2C_RTC_BUSY (BIT(25))
|
||||
#define I2C_RTC_BUSY_M (BIT(25))
|
||||
#define I2C_RTC_BUSY_V 0x1
|
||||
#define I2C_RTC_BUSY_S 25
|
||||
|
||||
#define I2C_RTC_WR_CNTL (BIT(24))
|
||||
#define I2C_RTC_WR_CNTL_M (BIT(24))
|
||||
#define I2C_RTC_WR_CNTL_V 0x1
|
||||
#define I2C_RTC_WR_CNTL_S 24
|
||||
|
||||
#define I2C_RTC_DATA 0x000000FF
|
||||
#define I2C_RTC_DATA_M ((I2C_RTC_DATA_V)<<(I2C_RTC_DATA_S))
|
||||
#define I2C_RTC_DATA_V 0xFF
|
||||
#define I2C_RTC_DATA_S 16
|
||||
|
||||
#define I2C_RTC_ADDR 0x000000FF
|
||||
#define I2C_RTC_ADDR_M ((I2C_RTC_ADDR_V)<<(I2C_RTC_ADDR_S))
|
||||
#define I2C_RTC_ADDR_V 0xFF
|
||||
#define I2C_RTC_ADDR_S 8
|
||||
|
||||
#define I2C_RTC_SLAVE_ID 0x000000FF
|
||||
#define I2C_RTC_SLAVE_ID_M ((I2C_RTC_SLAVE_ID_V)<<(I2C_RTC_SLAVE_ID_S))
|
||||
#define I2C_RTC_SLAVE_ID_V 0xFF
|
||||
#define I2C_RTC_SLAVE_ID_S 0
|
||||
|
||||
#define I2C_RTC_MAGIC_DEFAULT (0x1c40)
|
||||
|
||||
#define I2C_BOD 0x61
|
||||
#define I2C_BBPLL 0x66
|
||||
#define I2C_SAR_ADC 0X69
|
||||
#define I2C_APLL 0X6D
|
||||
|
||||
|
||||
int lastend = 0;
|
||||
|
||||
// Configures APLL = 480 / 4 = 120
|
||||
// 40 * (SDM2 + SDM1/(2^8) + SDM0/(2^16) + 4) / ( 2 * (ODIV+2) );
|
||||
// Datasheet recommends that numerator does not exceed 500MHz.
|
||||
void IRAM_ATTR local_rtc_clk_apll_enable(bool enable, uint32_t sdm0, uint32_t sdm1, uint32_t sdm2, uint32_t o_div)
|
||||
{
|
||||
REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PD, enable ? 0 : 1);
|
||||
REG_SET_FIELD(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PU, enable ? 1 : 0);
|
||||
|
||||
if (enable) {
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_DSDM2, sdm2);
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_DSDM0, sdm0);
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_DSDM1, sdm1);
|
||||
REGI2C_WRITE(I2C_APLL, I2C_APLL_SDM_STOP, CLK_LL_APLL_SDM_STOP_VAL_1);
|
||||
REGI2C_WRITE(I2C_APLL, I2C_APLL_SDM_STOP, CLK_LL_APLL_SDM_STOP_VAL_2_REV1);
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OR_OUTPUT_DIV, o_div );
|
||||
}
|
||||
|
||||
|
||||
// Settings determined experimentally.
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_TSCHGP, 0 ); // 0 or 1
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_EN_FAST_CAL, 1 ); // 0 or 1
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_DHREF_SEL, 0 ); // 0..3
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_DLREF_SEL, 0 ); // 0..3
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_SDM_DITHER, 1 ); // 0 or 1
|
||||
REGI2C_WRITE_MASK(I2C_APLL, I2C_APLL_OC_DVDD, 25 ); // 0 .. 31
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IRAM_ATTR regi2c_write_reg_raw_local(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t data)
|
||||
{
|
||||
uint32_t temp = ((block & I2C_RTC_SLAVE_ID_V) << I2C_RTC_SLAVE_ID_S)
|
||||
| ((reg_add & I2C_RTC_ADDR_V) << I2C_RTC_ADDR_S)
|
||||
| ((0x1 & I2C_RTC_WR_CNTL_V) << I2C_RTC_WR_CNTL_S)
|
||||
| (((uint32_t)data & I2C_RTC_DATA_V) << I2C_RTC_DATA_S);
|
||||
while (REG_GET_BIT(I2C_RTC_CONFIG2, I2C_RTC_BUSY));
|
||||
REG_WRITE(I2C_RTC_CONFIG2, temp);
|
||||
}
|
||||
|
||||
|
||||
void apll_quick_update( uint32_t sdm )
|
||||
{
|
||||
uint8_t sdm2 = sdm>>16;
|
||||
uint8_t sdm1 = (sdm>>8)&0xff;
|
||||
uint8_t sdm0 = (sdm>>0)&0xff;
|
||||
static int last_sdm_0 = -1;
|
||||
static int last_sdm_1 = -1;
|
||||
static int last_sdm_2 = -1;
|
||||
|
||||
if( sdm2 != last_sdm_2 )
|
||||
regi2c_write_reg_raw_local(I2C_APLL, I2C_APLL_HOSTID, I2C_APLL_DSDM2, sdm2);
|
||||
if( sdm0 != last_sdm_0 )
|
||||
regi2c_write_reg_raw_local(I2C_APLL, I2C_APLL_HOSTID, I2C_APLL_DSDM0, sdm0);
|
||||
if( sdm1 != last_sdm_1 )
|
||||
regi2c_write_reg_raw_local(I2C_APLL, I2C_APLL_HOSTID, I2C_APLL_DSDM1, sdm1);
|
||||
|
||||
last_sdm_2 = sdm2;
|
||||
last_sdm_1 = sdm1;
|
||||
last_sdm_0 = sdm0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void sandbox_main()
|
||||
{
|
||||
printf( "sandbox_main()\n" );
|
||||
|
||||
|
||||
|
||||
DPORT_SET_PERI_REG_MASK( DPORT_CPU_PERI_CLK_EN_REG, DPORT_CLK_EN_DEDICATED_GPIO );
|
||||
DPORT_CLEAR_PERI_REG_MASK( DPORT_CPU_PERI_RST_EN_REG, DPORT_RST_EN_DEDICATED_GPIO);
|
||||
|
||||
// Setup GPIO39 to be the PRO ALONE output (For LEDs)
|
||||
REG_WRITE( GPIO_OUT1_W1TC_REG, 1<<(39-32) );
|
||||
REG_WRITE( GPIO_ENABLE1_W1TS_REG, 1<<(39-32) );
|
||||
REG_WRITE( IO_MUX_GPIO39_REG, 2<<FUN_DRV_S );
|
||||
REG_WRITE( GPIO_FUNC39_OUT_SEL_CFG_REG, PRO_ALONEGPIO_OUT0_IDX );
|
||||
REG_WRITE( DEDIC_GPIO_OUT_CPU_REG, 0x01 ); // Enable CPU instruction output
|
||||
|
||||
|
||||
// Output clock on P2.
|
||||
|
||||
// Maximize the drive strength.
|
||||
gpio_set_drive_capability( GPIO_NUM(RF1_PIN), GPIO_DRIVE_CAP_3 );
|
||||
gpio_set_drive_capability( GPIO_NUM(RF2_PIN), GPIO_DRIVE_CAP_3 );
|
||||
|
||||
// Use the IO matrix to create the inverse of TX on pin 17.
|
||||
gpio_matrix_out( GPIO_NUM(RF1_PIN), CLK_I2S_MUX_IDX, 1, 0 );
|
||||
gpio_matrix_out( GPIO_NUM(RF2_PIN), CLK_I2S_MUX_IDX, 0, 0 );
|
||||
|
||||
periph_module_enable(PERIPH_I2S0_MODULE);
|
||||
|
||||
int use_apll = 1;
|
||||
int sdm0 = 100;
|
||||
int sdm1 = 230;
|
||||
int sdm2 = 8;
|
||||
int odiv = 0;
|
||||
|
||||
local_rtc_clk_apll_enable( use_apll, sdm0, sdm1, sdm2, odiv );
|
||||
|
||||
if( use_apll )
|
||||
{
|
||||
WRITE_PERI_REG( I2S_CLKM_CONF_REG(0), (1<<I2S_CLK_SEL_S) | (1<<I2S_CLK_EN_S) | (0<<I2S_CLKM_DIV_A_S) | (0<<I2S_CLKM_DIV_B_S) | (1<<I2S_CLKM_DIV_NUM_S) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// fI2S = fCLK / ( N + B/A )
|
||||
// DIV_NUM = N
|
||||
// Note I2S_CLKM_DIV_NUM minimum = 2 by datasheet. Less than that and it will ignoreeee you.
|
||||
WRITE_PERI_REG( I2S_CLKM_CONF_REG(0), (2<<I2S_CLK_SEL_S) | (1<<I2S_CLK_EN_S) | (0<<I2S_CLKM_DIV_A_S) | (0<<I2S_CLKM_DIV_B_S) | (1<<I2S_CLKM_DIV_NUM_S) ); // Minimum reduction, 2:1
|
||||
}
|
||||
|
||||
|
||||
gpio_matrix_out( GPIO_NUM(RF1_PIN), CLK_I2S_MUX_IDX, 1, 0 );
|
||||
gpio_matrix_out( GPIO_NUM(RF2_PIN), CLK_I2S_MUX_IDX, 0, 0 );
|
||||
|
||||
|
||||
// SigSetupTest( );
|
||||
|
||||
lastend = getCycleCount();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define DisableISR() do { XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); portbenchmarkINTERRUPT_DISABLE(); } while (0)
|
||||
#define EnableISR() do { portbenchmarkINTERRUPT_RESTORE(0); XTOS_SET_INTLEVEL(0); } while (0)
|
||||
|
||||
|
||||
uint32_t frame = 0;
|
||||
void sandbox_tick()
|
||||
{
|
||||
int iterations = 0;
|
||||
for( iterations = 0; iterations < 10000; iterations++ )
|
||||
{
|
||||
uint32_t start = getCycleCount() & 0x7fffffff;
|
||||
int cell = start / (uint32_t)(( 0x7fffffff / (IMAGEOH*IMAGEOPL) ));
|
||||
|
||||
// Determine what value we should actually be outputting to the APLL.
|
||||
// By blasting through our image table.
|
||||
int value = imageout[IMAGEOH*IMAGEOPL - 1 - cell];
|
||||
uint32_t base = 648985;
|
||||
if( value == 0 )
|
||||
{
|
||||
gpio_matrix_out( GPIO_NUM(RF1_PIN), CLK_I2S_MUX_IDX, 1, 1 );
|
||||
gpio_matrix_out( GPIO_NUM(RF2_PIN), CLK_I2S_MUX_IDX, 0, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
apll_quick_update( base + value*6 /* Controls width */ ); // (cell % 4000) );
|
||||
gpio_matrix_out( GPIO_NUM(RF1_PIN), CLK_I2S_MUX_IDX, 1, 0 );
|
||||
gpio_matrix_out( GPIO_NUM(RF2_PIN), CLK_I2S_MUX_IDX, 0, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SandboxStruct
|
||||
{
|
||||
void (*fnIdle)();
|
||||
};
|
||||
struct SandboxStruct sandbox_mode =
|
||||
{
|
||||
.fnIdle = sandbox_tick,
|
||||
};
|
||||
@@ -0,0 +1,421 @@
|
||||
// This is a rendition of an image Leonardo Dicaprio in the movie The Great Gadsby.
|
||||
// It is a derivative work, and copyright is to the respective owner.
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define IMAGEOH 412
|
||||
#define IMAGEOPL 32
|
||||
uint16_t imageout[IMAGEOH*IMAGEOPL] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
235, 236, 237, 238, 256, 257, 258, 259, 260, 261, 273, 274, 275, 276, 277, 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
232, 233, 234, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 278, 279, 280, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
230, 231, 232, 282, 283, 284, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
228, 229, 285, 286, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
226, 227, 228, 287, 288, 289, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
222, 223, 224, 225, 226, 289, 290, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
220, 221, 222, 291, 292, 293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
218, 219, 294, 295, 296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
216, 217, 296, 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
213, 214, 215, 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
211, 212, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 299, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
209, 210, 228, 229, 230, 231, 246, 247, 248, 249, 301, 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
207, 208, 223, 224, 225, 226, 227, 250, 251, 252, 253, 254, 302, 303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
204, 205, 206, 207, 220, 221, 222, 223, 254, 255, 256, 304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
202, 203, 204, 217, 218, 219, 256, 257, 258, 259, 294, 295, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
201, 202, 213, 214, 215, 216, 259, 260, 261, 295, 296, 297, 306, 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
199, 200, 210, 211, 212, 213, 261, 262, 297, 307, 308, 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
198, 199, 208, 209, 210, 262, 263, 264, 265, 297, 298, 309, 310, 311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
197, 198, 266, 267, 268, 298, 311, 312, 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
196, 197, 269, 270, 271, 298, 313, 314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
196, 271, 272, 273, 299, 314, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
195, 196, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 274, 275, 299, 316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
195, 231, 232, 233, 234, 235, 246, 247, 248, 275, 276, 277, 278, 299, 300, 317, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
194, 229, 230, 231, 249, 250, 251, 278, 279, 280, 281, 300, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
194, 226, 227, 228, 229, 251, 252, 253, 281, 282, 283, 300, 318, 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
193, 224, 225, 226, 253, 254, 255, 284, 301, 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
192, 193, 221, 222, 223, 255, 256, 257, 258, 285, 286, 301, 302, 320, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
192, 218, 219, 220, 258, 259, 287, 288, 302, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
191, 192, 213, 214, 215, 216, 217, 259, 260, 261, 262, 288, 289, 302, 321, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
189, 190, 210, 211, 212, 213, 262, 263, 290, 291, 302, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
188, 189, 207, 208, 209, 264, 292, 293, 302, 303, 322, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
187, 188, 204, 205, 206, 265, 294, 295, 303, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
186, 187, 203, 204, 266, 296, 303, 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
185, 186, 200, 201, 202, 267, 304, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
183, 184, 199, 267, 304, 324, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
182, 183, 196, 197, 198, 268, 304, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
180, 181, 182, 193, 194, 195, 269, 304, 305, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
180, 270, 305, 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
179, 271, 305, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
178, 179, 227, 228, 229, 230, 272, 305, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
178, 222, 223, 224, 225, 226, 230, 231, 232, 233, 272, 273, 305, 306, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
178, 218, 219, 220, 221, 234, 235, 236, 273, 274, 306, 327, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
177, 178, 215, 216, 217, 218, 236, 237, 238, 239, 274, 275, 306, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
177, 213, 214, 215, 240, 241, 275, 306, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
177, 209, 210, 211, 212, 213, 241, 242, 243, 276, 307, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
176, 177, 207, 208, 209, 243, 244, 276, 277, 307, 329, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
176, 205, 206, 207, 245, 246, 277, 307, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
176, 203, 204, 247, 277, 278, 307, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
176, 202, 203, 248, 249, 278, 307, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
175, 176, 200, 201, 249, 250, 278, 279, 308, 331, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
175, 199, 200, 215, 216, 217, 218, 219, 220, 221, 222, 223, 250, 251, 279, 280, 308, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
175, 195, 196, 197, 198, 199, 212, 213, 214, 215, 224, 225, 226, 252, 253, 280, 308, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 175, 193, 194, 195, 211, 212, 226, 227, 228, 229, 254, 280, 281, 309, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 191, 192, 193, 209, 210, 229, 230, 231, 254, 255, 281, 309, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 188, 189, 190, 207, 208, 209, 231, 232, 233, 256, 282, 309, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 181, 182, 185, 186, 187, 205, 206, 207, 233, 234, 256, 257, 282, 309, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 182, 183, 184, 204, 205, 235, 257, 258, 283, 309, 335, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 203, 204, 235, 236, 258, 259, 284, 336, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 202, 203, 236, 259, 284, 285, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 201, 236, 259, 285, 286, 311, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 199, 200, 237, 260, 286, 309, 310, 311, 312, 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 199, 237, 260, 286, 287, 308, 309, 312, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 174, 197, 198, 238, 261, 287, 307, 308, 312, 338, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 197, 238, 262, 306, 312, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 196, 238, 262, 306, 312, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 195, 239, 262, 263, 306, 312, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 194, 195, 239, 263, 305, 306, 312, 313, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 193, 194, 240, 303, 304, 305, 313, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 191, 192, 193, 299, 300, 301, 302, 303, 313, 314, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 189, 190, 191, 296, 297, 298, 314, 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 180, 181, 182, 183, 184, 185, 186, 187, 188, 219, 220, 221, 222, 223, 295, 296, 315, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 218, 219, 224, 225, 294, 295, 316, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 217, 225, 292, 293, 317, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 216, 226, 291, 292, 317, 318, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 214, 215, 226, 289, 290, 318, 319, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 213, 214, 226, 288, 289, 319, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 212, 213, 226, 227, 285, 286, 287, 288, 319, 320, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 212, 227, 228, 284, 285, 320, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 211, 228, 229, 230, 281, 282, 283, 320, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 210, 230, 231, 232, 280, 281, 320, 321, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 210, 232, 233, 234, 278, 279, 321, 341, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 209, 235, 236, 277, 278, 321, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 208, 209, 236, 237, 238, 275, 276, 321, 322, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 207, 238, 239, 240, 241, 244, 245, 246, 247, 248, 249, 250, 251, 275, 322, 323, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 207, 241, 242, 243, 251, 252, 273, 274, 323, 343, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 206, 207, 252, 253, 273, 324, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 205, 253, 254, 272, 273, 325, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 205, 254, 255, 272, 326, 327, 342, 343, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 204, 255, 271, 327, 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 204, 255, 271, 294, 295, 296, 297, 328, 341, 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 203, 255, 256, 257, 270, 289, 290, 291, 292, 293, 294, 329, 341, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 203, 257, 269, 287, 288, 329, 340, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 202, 257, 258, 267, 268, 286, 287, 330, 340, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 201, 202, 259, 260, 266, 267, 284, 285, 330, 340, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 201, 260, 261, 262, 263, 264, 265, 266, 282, 283, 302, 303, 304, 305, 330, 340, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 200, 281, 299, 300, 301, 302, 331, 340, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 200, 279, 280, 295, 296, 297, 298, 331, 340, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 199, 200, 277, 278, 279, 292, 293, 294, 331, 340, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 199, 276, 277, 291, 331, 340, 341, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 172, 199, 274, 275, 331, 341, 343, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 273, 274, 331, 340, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 272, 331, 340, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 270, 271, 331, 340, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 238, 239, 240, 241, 242, 255, 256, 257, 258, 259, 260, 261, 267, 268, 269, 270, 331, 332, 339, 340, 343, 344, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 237, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 261, 262, 263, 264, 265, 266, 267, 295, 296, 297, 298, 332, 339, 343, 0,
|
||||
172, 199, 290, 291, 292, 293, 294, 295, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 285, 286, 287, 288, 289, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 282, 283, 284, 285, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 199, 200, 279, 280, 281, 282, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 200, 276, 277, 278, 279, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 200, 274, 275, 276, 297, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 200, 271, 272, 273, 274, 295, 296, 297, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 200, 241, 242, 243, 244, 254, 255, 256, 257, 258, 259, 260, 261, 262, 270, 271, 294, 295, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
200, 235, 236, 238, 239, 240, 245, 246, 247, 252, 253, 263, 264, 265, 266, 267, 268, 269, 270, 292, 293, 332, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 173, 174, 200, 201, 236, 237, 248, 249, 250, 251, 267, 268, 289, 290, 291, 332, 338, 339, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 175, 201, 285, 286, 287, 288, 289, 332, 338, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 172, 176, 201, 280, 281, 282, 283, 284, 285, 298, 299, 332, 333, 338, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 176, 177, 201, 277, 278, 279, 296, 297, 333, 337, 338, 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 177, 201, 275, 276, 295, 333, 337, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 178, 201, 259, 260, 261, 262, 274, 275, 293, 294, 333, 334, 337, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 178, 201, 263, 264, 272, 273, 291, 292, 334, 335, 336, 337, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 179, 201, 264, 265, 266, 267, 268, 269, 270, 271, 272, 290, 291, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 179, 180, 201, 289, 290, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 180, 181, 201, 242, 243, 244, 245, 246, 288, 289, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 181, 201, 241, 242, 246, 247, 248, 249, 250, 287, 288, 309, 310, 311, 312, 313, 314, 315, 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 181, 201, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 286, 304, 305, 306, 307, 308, 309, 316, 317, 318, 342, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
171, 172, 181, 182, 201, 284, 285, 300, 301, 302, 303, 304, 318, 319, 320, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 182, 201, 283, 284, 298, 299, 300, 320, 321, 322, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 182, 183, 201, 295, 296, 297, 322, 323, 324, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
172, 173, 183, 200, 201, 293, 294, 295, 316, 317, 318, 319, 320, 321, 324, 325, 341, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 183, 200, 292, 293, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 321, 322, 323, 324, 325, 341, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 184, 200, 291, 300, 301, 302, 303, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 184, 185, 199, 200, 290, 291, 297, 298, 299, 300, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 185, 199, 289, 290, 295, 296, 297, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 185, 198, 199, 289, 294, 295, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 185, 198, 288, 292, 293, 294, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
174, 175, 185, 186, 197, 198, 238, 239, 240, 241, 242, 243, 244, 245, 286, 287, 291, 292, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
175, 186, 187, 197, 232, 233, 234, 235, 236, 237, 238, 245, 246, 247, 248, 285, 290, 291, 340, 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
175, 187, 188, 197, 226, 227, 228, 229, 230, 231, 232, 249, 250, 284, 288, 289, 290, 305, 306, 307, 308, 309, 310, 311, 340, 0, 0, 0, 0, 0, 0, 0,
|
||||
176, 177, 188, 189, 197, 220, 221, 222, 223, 224, 225, 237, 238, 239, 240, 241, 242, 251, 252, 284, 285, 286, 287, 288, 303, 304, 312, 313, 339, 340, 0, 0,
|
||||
177, 189, 190, 197, 217, 218, 219, 232, 233, 234, 235, 236, 243, 244, 245, 253, 254, 300, 301, 302, 303, 313, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
177, 178, 190, 191, 196, 217, 229, 230, 231, 246, 247, 248, 255, 256, 257, 258, 297, 298, 299, 300, 302, 313, 314, 339, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
178, 192, 196, 216, 225, 226, 227, 228, 229, 248, 249, 250, 251, 252, 253, 259, 260, 297, 300, 301, 302, 303, 314, 339, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
179, 192, 196, 216, 222, 223, 224, 225, 253, 254, 255, 256, 259, 260, 295, 296, 299, 300, 303, 304, 314, 338, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
179, 180, 193, 195, 215, 216, 220, 221, 222, 256, 257, 258, 259, 295, 297, 298, 304, 314, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
180, 193, 194, 195, 215, 216, 218, 219, 294, 297, 298, 303, 304, 311, 312, 313, 314, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
180, 194, 216, 217, 218, 293, 298, 299, 300, 301, 303, 309, 310, 311, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
181, 292, 301, 302, 303, 306, 307, 308, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
181, 292, 304, 305, 306, 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
181, 182, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 292, 293, 302, 303, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
182, 235, 236, 239, 240, 241, 242, 243, 244, 247, 248, 249, 250, 293, 294, 295, 296, 297, 298, 299, 300, 301, 336, 337, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
182, 183, 234, 238, 239, 244, 245, 250, 251, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
183, 233, 237, 238, 245, 251, 252, 282, 283, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
184, 232, 233, 237, 244, 245, 253, 282, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
184, 230, 231, 232, 237, 244, 253, 254, 282, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
184, 185, 228, 229, 230, 237, 238, 239, 240, 241, 242, 243, 254, 281, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
185, 226, 227, 228, 254, 281, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
185, 227, 228, 229, 230, 253, 254, 281, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
185, 231, 232, 252, 253, 281, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
186, 231, 232, 233, 234, 235, 236, 237, 238, 239, 246, 247, 248, 249, 250, 251, 252, 281, 336, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
186, 240, 241, 242, 243, 244, 245, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
186, 187, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
187, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
187, 281, 336, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
187, 281, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
187, 188, 281, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
188, 281, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
189, 281, 336, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
189, 190, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
190, 191, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 105, 106, 107, 108, 109, 110, 111, 112, 191, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
102, 103, 104, 112, 113, 192, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 102, 113, 114, 192, 193, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 101, 114, 115, 193, 194, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 115, 116, 173, 174, 175, 176, 177, 194, 195, 196, 197, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 116, 117, 166, 167, 168, 169, 170, 171, 172, 177, 178, 179, 180, 197, 198, 199, 281, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 100, 117, 118, 161, 162, 163, 164, 165, 166, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 199, 200, 281, 296, 297, 337, 0, 0, 0, 0, 0,
|
||||
99, 118, 119, 159, 160, 161, 191, 192, 193, 194, 195, 200, 281, 298, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 99, 119, 120, 156, 157, 158, 196, 197, 200, 202, 203, 204, 205, 206, 207, 281, 299, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 120, 121, 153, 154, 155, 156, 198, 199, 200, 201, 208, 209, 210, 211, 281, 282, 300, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 121, 122, 150, 151, 152, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 282, 301, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 99, 122, 123, 147, 148, 149, 150, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 260, 282, 301, 302, 337, 0, 0,
|
||||
99, 123, 145, 146, 238, 239, 240, 241, 258, 259, 282, 302, 303, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 124, 142, 143, 144, 242, 243, 257, 258, 282, 283, 298, 303, 304, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 124, 125, 138, 139, 140, 141, 243, 244, 256, 283, 297, 298, 304, 305, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 125, 136, 137, 138, 245, 255, 283, 296, 297, 305, 306, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 125, 126, 132, 133, 134, 135, 246, 254, 255, 283, 296, 306, 307, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 126, 127, 128, 129, 130, 131, 132, 247, 254, 257, 284, 296, 307, 308, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 126, 247, 248, 253, 257, 284, 295, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 126, 248, 253, 258, 284, 294, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 101, 126, 127, 248, 252, 259, 284, 293, 313, 319, 320, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 127, 248, 251, 260, 284, 285, 292, 313, 314, 321, 322, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 126, 127, 128, 248, 251, 261, 285, 291, 314, 315, 323, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 102, 124, 125, 128, 249, 250, 261, 262, 290, 315, 316, 323, 324, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
102, 123, 129, 249, 250, 262, 263, 289, 315, 316, 324, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
102, 122, 129, 130, 249, 263, 264, 288, 314, 315, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
102, 121, 249, 265, 266, 287, 310, 311, 312, 313, 314, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
103, 120, 121, 249, 250, 266, 267, 285, 286, 307, 308, 309, 310, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
103, 120, 250, 268, 269, 284, 285, 306, 307, 322, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
103, 104, 119, 250, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 282, 283, 284, 305, 306, 321, 322, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 119, 250, 278, 279, 280, 281, 282, 304, 321, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 119, 250, 302, 303, 320, 321, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 118, 250, 300, 301, 320, 331, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 106, 118, 250, 298, 299, 300, 319, 330, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 118, 249, 250, 296, 297, 298, 319, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 249, 295, 296, 318, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 249, 293, 294, 295, 318, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 249, 291, 292, 293, 317, 327, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 249, 289, 290, 291, 317, 326, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 248, 249, 285, 286, 287, 288, 289, 316, 317, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 248, 249, 250, 251, 258, 259, 278, 279, 280, 281, 282, 283, 284, 285, 316, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 248, 251, 252, 253, 254, 255, 256, 257, 258, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 316, 324,
|
||||
106, 117, 248, 316, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
106, 117, 247, 248, 322, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 118, 247, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 118, 247, 321, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 118, 246, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 118, 246, 320, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 118, 119, 245, 320, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 119, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 244, 245, 319, 320, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 119, 139, 140, 141, 142, 143, 155, 156, 244, 319, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 119, 120, 135, 136, 137, 138, 157, 244, 318, 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 157, 158, 243, 318, 321, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 158, 159, 243, 317, 318, 321, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 159, 243, 317, 321, 325, 326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 160, 161, 243, 316, 317, 321, 326, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 161, 242, 316, 321, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 162, 242, 315, 321, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
103, 104, 162, 163, 242, 315, 321, 327, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
103, 163, 241, 314, 321, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
102, 103, 163, 164, 241, 313, 314, 321, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 164, 240, 313, 321, 329, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 164, 240, 313, 321, 330, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 164, 239, 240, 312, 313, 321, 331, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 99, 163, 164, 239, 312, 321, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 163, 239, 240, 241, 311, 312, 321, 332, 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 162, 163, 239, 240, 241, 242, 311, 321, 333, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 161, 162, 238, 239, 242, 243, 244, 310, 321, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 159, 160, 161, 237, 238, 244, 245, 309, 321, 334, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 155, 156, 157, 158, 237, 245, 246, 308, 309, 321, 335, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
95, 96, 147, 148, 149, 150, 151, 152, 153, 154, 155, 236, 246, 307, 308, 321, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
95, 140, 141, 142, 143, 144, 145, 146, 235, 236, 246, 247, 306, 307, 321, 336, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
95, 138, 139, 140, 183, 184, 185, 186, 187, 188, 234, 235, 237, 238, 247, 248, 306, 321, 337, 338, 339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
94, 138, 174, 175, 176, 177, 178, 179, 180, 181, 182, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 234, 236, 239, 240, 248, 305, 321, 339, 0, 0, 0,
|
||||
94, 137, 138, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 198, 199, 233, 234, 236, 241, 242, 248, 249, 304, 305, 320, 321, 339, 340, 0, 0, 0,
|
||||
94, 137, 155, 156, 157, 158, 159, 160, 161, 162, 163, 199, 200, 232, 237, 243, 244, 249, 250, 303, 304, 310, 311, 312, 313, 314, 315, 317, 318, 320, 340, 341,
|
||||
94, 137, 138, 139, 151, 152, 153, 154, 155, 200, 201, 230, 231, 237, 244, 245, 246, 250, 251, 303, 305, 306, 307, 308, 309, 316, 317, 318, 319, 320, 342, 343,
|
||||
94, 137, 138, 139, 146, 147, 148, 149, 150, 151, 201, 202, 229, 238, 246, 247, 248, 252, 253, 302, 304, 305, 320, 321, 322, 323, 343, 344, 0, 0, 0, 0,
|
||||
94, 95, 136, 140, 141, 142, 143, 144, 145, 146, 202, 203, 228, 229, 239, 248, 249, 250, 251, 252, 254, 255, 256, 300, 301, 320, 323, 324, 345, 346, 347, 0,
|
||||
89, 90, 91, 92, 93, 95, 135, 203, 204, 208, 226, 227, 239, 240, 252, 253, 254, 255, 256, 257, 299, 300, 324, 325, 347, 348, 0, 0, 0, 0, 0, 0,
|
||||
83, 84, 85, 86, 87, 88, 95, 134, 204, 205, 207, 208, 212, 213, 214, 215, 216, 217, 226, 241, 251, 252, 257, 258, 298, 325, 349, 0, 0, 0, 0, 0,
|
||||
81, 82, 95, 96, 133, 134, 205, 206, 207, 208, 209, 210, 211, 217, 218, 219, 225, 241, 242, 251, 258, 259, 260, 297, 298, 325, 349, 350, 351, 0, 0, 0,
|
||||
77, 78, 79, 80, 81, 96, 131, 132, 133, 207, 208, 219, 224, 242, 243, 251, 260, 261, 262, 296, 297, 325, 351, 352, 353, 0, 0, 0, 0, 0, 0, 0,
|
||||
77, 96, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 207, 219, 220, 223, 224, 243, 244, 251, 262, 263, 264, 265, 294, 295, 296, 326, 353, 354, 355,
|
||||
75, 76, 77, 97, 207, 220, 221, 222, 244, 251, 265, 266, 267, 268, 269, 270, 271, 293, 294, 326, 355, 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
70, 71, 72, 73, 74, 75, 97, 98, 207, 221, 222, 244, 245, 250, 272, 273, 274, 291, 292, 293, 326, 356, 357, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
68, 69, 70, 98, 207, 221, 222, 223, 245, 246, 250, 274, 275, 276, 277, 288, 289, 290, 291, 326, 357, 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
66, 67, 98, 207, 221, 246, 250, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 326, 327, 358, 359, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
64, 65, 98, 206, 221, 247, 250, 283, 287, 327, 359, 360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
62, 63, 98, 205, 206, 221, 247, 250, 284, 288, 327, 360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
61, 62, 98, 204, 205, 220, 221, 248, 249, 250, 284, 288, 327, 361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
61, 98, 202, 203, 204, 220, 249, 284, 288, 327, 361, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
59, 60, 98, 200, 201, 202, 220, 249, 284, 288, 327, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
59, 98, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 219, 249, 250, 284, 288, 327, 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
58, 98, 186, 187, 188, 192, 219, 249, 250, 284, 288, 327, 363, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
57, 58, 98, 183, 184, 185, 186, 191, 192, 218, 249, 250, 284, 288, 327, 364, 365, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
57, 98, 180, 181, 182, 183, 191, 218, 249, 250, 284, 288, 326, 365, 366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
56, 57, 98, 176, 177, 178, 179, 180, 191, 217, 218, 249, 285, 288, 289, 326, 367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
56, 98, 99, 173, 174, 175, 191, 216, 217, 250, 285, 289, 326, 368, 369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
55, 56, 98, 170, 171, 172, 173, 178, 179, 191, 215, 216, 250, 285, 289, 326, 370, 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
55, 97, 98, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 179, 191, 212, 213, 214, 215, 250, 286, 289, 326, 371, 372, 373, 0, 0, 0, 0,
|
||||
54, 55, 96, 98, 156, 157, 158, 159, 179, 191, 210, 211, 212, 250, 286, 289, 326, 374, 375, 376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
54, 96, 98, 131, 132, 133, 150, 151, 152, 153, 154, 155, 179, 191, 192, 208, 209, 210, 250, 286, 289, 326, 377, 378, 379, 380, 0, 0, 0, 0, 0, 0,
|
||||
54, 95, 96, 98, 133, 134, 135, 136, 137, 138, 139, 140, 141, 147, 148, 149, 150, 179, 192, 207, 208, 250, 286, 289, 326, 380, 381, 382, 383, 0, 0, 0,
|
||||
54, 95, 98, 142, 143, 144, 145, 146, 179, 192, 205, 206, 250, 251, 286, 287, 289, 325, 383, 384, 385, 386, 387, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
53, 94, 95, 98, 179, 192, 204, 205, 251, 287, 289, 325, 387, 388, 389, 390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
53, 93, 94, 97, 179, 192, 202, 203, 251, 287, 289, 325, 390, 391, 392, 393, 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
53, 92, 93, 97, 178, 193, 200, 201, 251, 287, 288, 325, 394, 395, 396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
53, 92, 97, 178, 193, 199, 200, 251, 286, 287, 288, 324, 397, 398, 399, 400, 401, 402, 403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
53, 91, 92, 97, 178, 194, 197, 198, 251, 284, 285, 286, 288, 289, 298, 299, 300, 301, 324, 403, 404, 405, 406, 407, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 53, 91, 97, 178, 194, 197, 252, 283, 284, 289, 290, 296, 297, 298, 301, 302, 324, 407, 408, 409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 91, 96, 97, 178, 195, 196, 197, 252, 282, 283, 290, 291, 292, 293, 294, 295, 296, 303, 304, 323, 324, 410, 411, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 91, 96, 178, 195, 252, 253, 281, 282, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 323, 412, 413, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 90, 91, 95, 96, 178, 195, 253, 281, 315, 316, 317, 321, 322, 323, 413, 414, 415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 90, 95, 178, 195, 254, 255, 280, 317, 318, 320, 415, 416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 90, 95, 179, 195, 255, 256, 279, 280, 318, 319, 320, 416, 417, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 89, 90, 95, 179, 195, 256, 257, 277, 278, 279, 319, 320, 418, 419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 89, 95, 155, 156, 157, 158, 159, 160, 161, 162, 163, 179, 195, 258, 274, 275, 276, 320, 419, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
51, 52, 88, 94, 152, 153, 154, 163, 164, 165, 166, 167, 178, 179, 195, 259, 272, 273, 274, 320, 421, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
51, 88, 94, 167, 168, 169, 170, 171, 177, 179, 195, 260, 270, 271, 272, 320, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
50, 51, 88, 94, 95, 171, 172, 176, 177, 179, 195, 260, 261, 264, 265, 269, 270, 320, 423, 424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
50, 88, 95, 172, 173, 175, 179, 195, 261, 262, 263, 264, 265, 266, 268, 269, 320, 425, 426, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
50, 88, 95, 173, 174, 175, 179, 195, 262, 263, 266, 267, 320, 427, 428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
49, 50, 87, 95, 96, 174, 179, 195, 267, 320, 429, 430, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
49, 87, 96, 170, 171, 172, 173, 179, 195, 267, 320, 431, 432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
49, 87, 97, 168, 169, 170, 179, 195, 268, 320, 432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
49, 87, 97, 168, 179, 195, 268, 319, 320, 433, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 49, 87, 98, 168, 179, 195, 269, 319, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 87, 98, 168, 180, 194, 269, 270, 319, 435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 87, 98, 99, 167, 168, 180, 194, 270, 319, 436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 87, 99, 167, 180, 194, 270, 319, 436, 437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 87, 99, 167, 180, 194, 270, 319, 437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 87, 99, 167, 180, 194, 270, 319, 438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 99, 167, 180, 194, 271, 319, 439, 440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 99, 167, 180, 194, 272, 319, 440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 99, 167, 180, 194, 272, 273, 318, 319, 440, 441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 99, 100, 166, 167, 180, 194, 195, 273, 318, 441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 100, 165, 166, 180, 195, 274, 275, 318, 441, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 100, 165, 180, 195, 275, 276, 317, 318, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 100, 164, 180, 195, 276, 277, 317, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 88, 100, 101, 163, 180, 195, 278, 317, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
47, 48, 88, 101, 162, 180, 195, 279, 317, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
47, 88, 101, 160, 161, 162, 180, 195, 279, 316, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
47, 88, 101, 160, 180, 194, 195, 280, 316, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
47, 89, 101, 102, 158, 159, 160, 180, 195, 280, 281, 316, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
46, 47, 89, 102, 155, 156, 157, 158, 180, 195, 281, 316, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
46, 89, 102, 153, 154, 155, 157, 180, 195, 282, 316, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
46, 89, 102, 103, 150, 151, 152, 153, 156, 180, 195, 283, 316, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 46, 89, 103, 148, 149, 150, 156, 180, 195, 283, 284, 316, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 89, 103, 147, 156, 180, 194, 195, 284, 285, 316, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 89, 103, 146, 155, 180, 194, 285, 286, 316, 442, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 89, 90, 103, 145, 155, 180, 194, 286, 315, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 90, 104, 144, 145, 154, 155, 180, 194, 286, 315, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 90, 104, 144, 154, 180, 194, 286, 287, 315, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 90, 104, 105, 143, 153, 154, 180, 194, 287, 315, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 90, 91, 105, 143, 153, 180, 194, 287, 314, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 91, 105, 142, 152, 180, 194, 288, 314, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 92, 105, 142, 151, 152, 181, 194, 288, 314, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 92, 106, 141, 142, 151, 181, 194, 288, 289, 314, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 92, 106, 107, 141, 150, 181, 194, 289, 314, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
43, 92, 93, 107, 141, 149, 150, 181, 194, 290, 314, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
43, 93, 107, 140, 141, 148, 181, 194, 290, 314, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
43, 93, 107, 139, 140, 148, 181, 194, 290, 314, 443, 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
43, 93, 107, 108, 139, 146, 147, 148, 181, 194, 291, 314, 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
43, 94, 108, 109, 138, 139, 145, 146, 181, 194, 291, 314, 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
42, 43, 94, 109, 110, 137, 138, 144, 181, 194, 291, 292, 314, 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
42, 94, 95, 110, 111, 112, 136, 143, 180, 181, 194, 292, 314, 444, 445, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
41, 95, 112, 113, 135, 142, 143, 180, 194, 292, 313, 314, 445, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 41, 95, 96, 114, 115, 134, 135, 141, 142, 180, 194, 292, 293, 313, 445, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 96, 116, 133, 140, 180, 194, 195, 293, 313, 446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 96, 97, 116, 117, 131, 132, 133, 140, 179, 180, 195, 293, 294, 313, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
39, 40, 97, 117, 131, 139, 140, 179, 195, 294, 312, 313, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
38, 39, 97, 98, 118, 129, 130, 138, 139, 179, 195, 196, 294, 295, 312, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
38, 98, 99, 118, 129, 138, 179, 196, 295, 296, 312, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
37, 99, 118, 128, 137, 138, 179, 196, 296, 312, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
36, 37, 99, 118, 127, 137, 179, 196, 297, 311, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
35, 99, 100, 118, 126, 136, 137, 178, 196, 297, 311, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
34, 35, 100, 118, 126, 136, 178, 197, 298, 311, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
33, 34, 100, 118, 125, 136, 178, 197, 298, 299, 311, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
33, 100, 101, 118, 124, 125, 135, 177, 178, 197, 299, 310, 311, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
32, 33, 101, 118, 124, 134, 135, 173, 174, 175, 176, 177, 198, 199, 200, 299, 300, 310, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
32, 101, 119, 123, 134, 168, 169, 170, 171, 172, 173, 200, 201, 202, 203, 300, 310, 447, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
31, 32, 102, 119, 123, 133, 163, 164, 165, 166, 167, 204, 205, 206, 207, 208, 300, 301, 310, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
31, 102, 119, 120, 121, 122, 123, 133, 162, 163, 208, 209, 210, 211, 212, 213, 214, 301, 310, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
31, 102, 120, 121, 132, 133, 160, 161, 162, 214, 215, 216, 217, 301, 310, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
30, 31, 80, 102, 132, 157, 158, 159, 217, 218, 219, 301, 309, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
30, 80, 81, 102, 103, 131, 155, 156, 157, 220, 221, 301, 302, 309, 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
30, 80, 81, 82, 103, 104, 130, 131, 152, 153, 154, 155, 221, 222, 223, 302, 309, 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
30, 81, 82, 83, 104, 105, 106, 130, 149, 150, 151, 223, 302, 309, 310, 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 81, 82, 83, 84, 85, 86, 106, 107, 108, 129, 130, 147, 148, 149, 223, 302, 303, 309, 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 82, 86, 108, 109, 110, 111, 112, 128, 129, 147, 223, 303, 309, 449, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 82, 83, 86, 112, 113, 114, 115, 126, 127, 128, 147, 222, 223, 303, 304, 309, 310, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 83, 84, 85, 86, 115, 116, 117, 125, 126, 147, 222, 304, 310, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 117, 118, 119, 123, 124, 125, 147, 148, 149, 150, 222, 304, 310, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
28, 29, 119, 120, 121, 122, 150, 151, 152, 221, 305, 310, 415, 416, 417, 418, 419, 420, 421, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
28, 152, 153, 154, 155, 221, 305, 306, 310, 415, 421, 422, 423, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
28, 76, 77, 78, 156, 157, 158, 220, 221, 306, 310, 415, 423, 424, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
28, 76, 78, 79, 158, 159, 216, 217, 218, 219, 220, 306, 310, 415, 424, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
28, 75, 76, 80, 159, 160, 161, 208, 209, 210, 211, 212, 213, 214, 215, 307, 309, 415, 416, 424, 425, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
28, 75, 81, 161, 162, 163, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 307, 309, 416, 425, 450, 0, 0, 0, 0, 0, 0,
|
||||
27, 28, 75, 82, 163, 164, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 308, 309, 416, 426, 450, 0,
|
||||
26, 27, 75, 81, 82, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 308, 309, 416, 427, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
26, 75, 76, 77, 79, 80, 81, 309, 416, 427, 428, 429, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 26, 77, 78, 79, 416, 429, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
24, 25, 416, 429, 430, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
24, 65, 66, 67, 68, 69, 70, 416, 430, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
23, 63, 64, 65, 70, 415, 416, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
22, 23, 62, 63, 70, 415, 431, 432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
22, 62, 70, 414, 415, 431, 432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
22, 62, 63, 64, 65, 66, 67, 68, 69, 70, 413, 414, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 412, 413, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 412, 430, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
20, 21, 411, 412, 429, 430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
20, 411, 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
20, 410, 427, 428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
20, 68, 69, 409, 426, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
19, 20, 67, 68, 69, 70, 409, 424, 425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
19, 66, 67, 70, 71, 72, 409, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
19, 66, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
19, 65, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
19, 64, 65, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
18, 64, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
18, 63, 69, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
17, 18, 63, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
17, 62, 67, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 17, 62, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 62, 63, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Charles Lohr "CNLohr"
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "esp_system.h"
|
||||
#include "spi_flash_mmap.h"
|
||||
#include "esp_efuse.h"
|
||||
#include "esp_efuse_table.h" // or "esp_efuse_custom_table.h"
|
||||
#include "esp_task_wdt.h"
|
||||
#include "esp_log.h"
|
||||
#include "soc/dedic_gpio_reg.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "soc/soc.h"
|
||||
#include "soc/system_reg.h"
|
||||
#include "soc/usb_reg.h"
|
||||
#include "ulp_riscv.h"
|
||||
#include "driver/rtc_io.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "rom/gpio.h"
|
||||
#include "soc/rtc.h"
|
||||
|
||||
#define SOC_DPORT_USB_BASE 0x60080000
|
||||
|
||||
struct SandboxStruct
|
||||
{
|
||||
void (*fnIdle)();
|
||||
};
|
||||
|
||||
|
||||
struct SandboxStruct * g_SandboxStruct;
|
||||
|
||||
|
||||
void esp_sleep_enable_timer_wakeup();
|
||||
|
||||
volatile void * keep_symbols[] = { 0, vTaskDelay, ulp_riscv_halt,
|
||||
ulp_riscv_timer_resume, ulp_riscv_timer_stop, ulp_riscv_load_binary,
|
||||
ulp_riscv_run, ulp_riscv_config_and_run, esp_sleep_enable_timer_wakeup,
|
||||
ulp_set_wakeup_period, rtc_gpio_init, rtc_gpio_set_direction,
|
||||
rtc_gpio_set_level, gpio_config, gpio_matrix_out, gpio_matrix_in,
|
||||
rtc_clk_cpu_freq_get_config, rtc_clk_cpu_freq_set_config_fast,
|
||||
rtc_clk_apb_freq_get };
|
||||
|
||||
extern struct SandboxStruct sandbox_mode;
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
printf("Hello world! Keep table at %p\n", &keep_symbols );
|
||||
|
||||
g_SandboxStruct = &sandbox_mode;
|
||||
|
||||
// esp_efuse_set_rom_log_scheme(ESP_EFUSE_ROM_LOG_ALWAYS_OFF);
|
||||
esp_efuse_set_rom_log_scheme(ESP_EFUSE_ROM_LOG_ALWAYS_ON);
|
||||
|
||||
printf("Minimum free heap size: %d bytes\n", (int)esp_get_minimum_free_heap_size());
|
||||
|
||||
void sandbox_main();
|
||||
|
||||
sandbox_main();
|
||||
|
||||
do
|
||||
{
|
||||
if( g_SandboxStruct && g_SandboxStruct->fnIdle ) { g_SandboxStruct->fnIdle(); }
|
||||
esp_task_wdt_reset();
|
||||
taskYIELD();
|
||||
} while( 1 );
|
||||
|
||||
// printf("Restarting now.\n");
|
||||
// fflush(stdout);
|
||||
// esp_restart();
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
// This file is unused in the video ending test
|
||||
@@ -0,0 +1,12 @@
|
||||
IMAGEOUT:=../main/image.h
|
||||
|
||||
all : $(IMAGEOUT)
|
||||
|
||||
$(IMAGEOUT) : image.png imagegen
|
||||
./imagegen $< > $@
|
||||
|
||||
imagegen : imagegen.c
|
||||
gcc -o $@ $^ -Os -lm
|
||||
|
||||
clean :
|
||||
rm -rf *.o imagegen $(IMAGEOUT)
|
||||
@@ -0,0 +1,4 @@
|
||||
Place a:
|
||||
* Black and white (solid lines only, black background white lines, 1px wide, no grey) "image.png" file in this folder.
|
||||
* I recently tested with a 461x412 pixel file so around there should be fine.
|
||||
* Say `make` and it should produce `../main/image.h` from your image.
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Charles Lohr "CNLohr"
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
|
||||
#define IMAGEOPL 32
|
||||
|
||||
int main( int argc, char ** argv )
|
||||
{
|
||||
if( argc != 2 )
|
||||
{
|
||||
fprintf( stderr, "Error: Need input image file\n" );
|
||||
return -9;
|
||||
}
|
||||
|
||||
int w, h, n;
|
||||
unsigned char *data = stbi_load( argv[1], &w, &h, &n, 1 );
|
||||
if( !data )
|
||||
{
|
||||
fprintf( stderr, "Error: Failed to load image \"%s\"\n", argv[1] );
|
||||
}
|
||||
int i;
|
||||
printf( "#include <stdint.h>\n" );
|
||||
printf( "\n" );
|
||||
printf( "#define IMAGEOH %d\n", h );
|
||||
printf( "#define IMAGEOPL %d\n", IMAGEOPL );
|
||||
printf( "uint16_t imageout[IMAGEOH*IMAGEOPL] = {\n" );
|
||||
int x, y;
|
||||
int o;
|
||||
for( y = 0; y < h; y++ )
|
||||
{
|
||||
o = 0;
|
||||
for( x = 0; x < w; x++ )
|
||||
{
|
||||
uint8_t c = data[(x+y*w)];
|
||||
if( c > 128 )
|
||||
{
|
||||
if( o < IMAGEOPL )
|
||||
{
|
||||
printf( "%d, ", x ); o++;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( stderr, "Warning: overload on line %d\n", y );
|
||||
}
|
||||
}
|
||||
}
|
||||
for( ; o < IMAGEOPL; o++ )
|
||||
{
|
||||
printf( "0, " );
|
||||
}
|
||||
printf( "\n" );
|
||||
}
|
||||
printf( "};\n" );
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
|
||||
# Note: if you change the size of the nvs partition, make sure to update NVS_PARTITION_SIZE in `components/hdw-nvs/nvs_manager.h`
|
||||
nvs, data, nvs, 0x9000, 0x6000,
|
||||
phy_init, data, phy, 0xf000, 0x1000,
|
||||
factory, app, factory, 0x10000, 1M,
|
||||
storage, data, spiffs, , 0xF0000,
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user