diff options
| -rwxr-xr-x | do_buildroot.sh | 2 | ||||
| -rw-r--r-- | resources/config-buildroot | 22 | ||||
| -rw-r--r-- | resources/linux.config | 791 | ||||
| -rw-r--r-- | resources/post-build.sh | 6 | ||||
| -rw-r--r-- | src/ct1986.c | 115 |
5 files changed, 127 insertions, 809 deletions
diff --git a/do_buildroot.sh b/do_buildroot.sh index f8ba69d..1e50bda 100755 --- a/do_buildroot.sh +++ b/do_buildroot.sh @@ -13,7 +13,7 @@ for dir in $dirs; do done cp resources/config-buildroot "$BR/.config" -cp resources/ct1986.sh resources/genimage-raspberrypi0.cfg resources/linux.config "$board" +cp resources/{post-build,ct1986}.sh resources/genimage-raspberrypi0.cfg resources/linux.config "$board" cp ctaklm ct1986 "$overlay/usr/bin" diff --git a/resources/config-buildroot b/resources/config-buildroot index 8753493..19c6381 100644 --- a/resources/config-buildroot +++ b/resources/config-buildroot @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Buildroot -gaccc2e7-dirty Configuration +# Buildroot -g73f6364-dirty Configuration # BR2_HAVE_DOT_CONFIG=y BR2_HOST_GCC_AT_LEAST_4_9=y @@ -471,7 +471,7 @@ BR2_ENABLE_LOCALE_WHITELIST="C en_US" BR2_ROOTFS_USERS_TABLES="" BR2_ROOTFS_OVERLAY="board/raspberrypi0/rootfs_overlay/" BR2_ROOTFS_POST_BUILD_SCRIPT="" -BR2_ROOTFS_POST_FAKEROOT_SCRIPT="" +BR2_ROOTFS_POST_FAKEROOT_SCRIPT="board/raspberrypi0/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi0/ct1986.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="" @@ -2401,35 +2401,35 @@ BR2_PACKAGE_HAPROXY_ARCH_SUPPORTS=y # # -# Please note: +# Please note: # # -# - Buildroot does *not* generate binary packages, +# - Buildroot does *not* generate binary packages, # # -# - Buildroot does *not* install any package database. +# - Buildroot does *not* install any package database. # # -# * +# * # # -# It is up to you to provide those by yourself if you +# It is up to you to provide those by yourself if you # # -# want to use any of those package managers. +# want to use any of those package managers. # # -# * +# * # # -# See the manual: +# See the manual: # # @@ -2649,7 +2649,7 @@ BR2_TARGET_ROOTFS_EXT2_4=y BR2_TARGET_ROOTFS_EXT2_GEN=4 BR2_TARGET_ROOTFS_EXT2_REV=1 BR2_TARGET_ROOTFS_EXT2_LABEL="ct1986" -BR2_TARGET_ROOTFS_EXT2_SIZE="80M" +BR2_TARGET_ROOTFS_EXT2_SIZE="20M" BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=5 BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O ^64bit" diff --git a/resources/linux.config b/resources/linux.config index fb95f67..04d34ef 100644 --- a/resources/linux.config +++ b/resources/linux.config @@ -4,7 +4,7 @@ # # -# Compiler: arm-buildroot-linux-musleabihf-gcc.br_real (Buildroot -g665592d-dirty) 9.3.0 +# Compiler: arm-buildroot-linux-musleabihf-gcc.br_real (Buildroot -g73f6364-dirty) 9.3.0 # CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=90300 @@ -196,7 +196,7 @@ CONFIG_PERF_EVENTS=y # end of Kernel Performance Events And Counters CONFIG_VM_EVENT_COUNTERS=y -CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG is not set # CONFIG_SLUB_MEMCG_SYSFS_ON is not set # CONFIG_COMPAT_BRK is not set # CONFIG_SLAB is not set @@ -206,7 +206,7 @@ CONFIG_SLAB_MERGE_DEFAULT=y # CONFIG_SLAB_FREELIST_RANDOM is not set # CONFIG_SLAB_FREELIST_HARDENED is not set # CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set -CONFIG_PROFILING=y +# CONFIG_PROFILING is not set CONFIG_TRACEPOINTS=y # end of General setup @@ -466,7 +466,6 @@ CONFIG_CRYPTO_AES_ARM=m # # General architecture-dependent options # -CONFIG_OPROFILE=m CONFIG_HAVE_OPROFILE=y CONFIG_KPROBES=y CONFIG_JUMP_LABEL=y @@ -995,7 +994,6 @@ CONFIG_INPUT_EVDEV=y # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADC is not set # CONFIG_KEYBOARD_ADP5588 is not set # CONFIG_KEYBOARD_ADP5589 is not set # CONFIG_KEYBOARD_ATKBD is not set @@ -1064,7 +1062,6 @@ CONFIG_TOUCHSCREEN_PROPERTIES=y CONFIG_TOUCHSCREEN_ADS7846=m # CONFIG_TOUCHSCREEN_AD7877 is not set # CONFIG_TOUCHSCREEN_AD7879 is not set -# CONFIG_TOUCHSCREEN_ADC is not set # CONFIG_TOUCHSCREEN_AR1021_I2C is not set # CONFIG_TOUCHSCREEN_ATMEL_MXT is not set # CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set @@ -1205,7 +1202,6 @@ CONFIG_GAMEPORT_L4=m CONFIG_BRCM_CHAR_DRIVERS=y CONFIG_BCM2708_VCMEM=y CONFIG_BCM_VCIO=y -CONFIG_BCM_VC_SM=y CONFIG_BCM2835_DEVGPIOMEM=y CONFIG_BCM2835_SMI_DEV=m # CONFIG_RPIVID_MEM is not set @@ -1575,14 +1571,12 @@ CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set CONFIG_POWER_SUPPLY_HWMON=y # CONFIG_PDA_POWER is not set -# CONFIG_GENERIC_ADC_BATTERY is not set # CONFIG_TEST_POWER is not set # CONFIG_CHARGER_ADP5061 is not set CONFIG_BATTERY_DS2760=m # CONFIG_BATTERY_DS2780 is not set # CONFIG_BATTERY_DS2781 is not set # CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_LEGO_EV3 is not set # CONFIG_BATTERY_SBS is not set # CONFIG_CHARGER_SBS is not set # CONFIG_MANAGER_SBS is not set @@ -1642,7 +1636,6 @@ CONFIG_SENSORS_DS1621=m # CONFIG_SENSORS_G762 is not set CONFIG_SENSORS_GPIO_FAN=m # CONFIG_SENSORS_HIH6130 is not set -CONFIG_SENSORS_IIO_HWMON=m # CONFIG_SENSORS_IT87 is not set CONFIG_SENSORS_JC42=m # CONFIG_SENSORS_POWR1220 is not set @@ -1767,7 +1760,6 @@ CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_BCM2835_THERMAL=y # end of Broadcom thermal drivers -# CONFIG_GENERIC_ADC_THERMAL is not set CONFIG_WATCHDOG=y CONFIG_WATCHDOG_CORE=y # CONFIG_WATCHDOG_NOWAYOUT is not set @@ -2231,7 +2223,6 @@ CONFIG_USB_MON=m # CONFIG_USB_FOTG210_HCD is not set # CONFIG_USB_MAX3421_HCD is not set # CONFIG_USB_OHCI_HCD is not set -# CONFIG_USB_U132_HCD is not set # CONFIG_USB_SL811_HCD is not set # CONFIG_USB_R8A66597_HCD is not set CONFIG_USB_DWCOTG=y @@ -2242,10 +2233,10 @@ CONFIG_USB_DWCOTG=y # # USB Device Class drivers # -CONFIG_USB_ACM=m -CONFIG_USB_PRINTER=m -CONFIG_USB_WDM=m -CONFIG_USB_TMC=m +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_WDM is not set +# CONFIG_USB_TMC is not set # # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may @@ -2256,124 +2247,59 @@ CONFIG_USB_TMC=m # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set -CONFIG_USB_STORAGE_REALTEK=m -CONFIG_REALTEK_AUTOPM=y -CONFIG_USB_STORAGE_DATAFAB=m -CONFIG_USB_STORAGE_FREECOM=m -CONFIG_USB_STORAGE_ISD200=m -CONFIG_USB_STORAGE_USBAT=m -CONFIG_USB_STORAGE_SDDR09=m -CONFIG_USB_STORAGE_SDDR55=m -CONFIG_USB_STORAGE_JUMPSHOT=m -CONFIG_USB_STORAGE_ALAUDA=m -CONFIG_USB_STORAGE_ONETOUCH=m -CONFIG_USB_STORAGE_KARMA=m -CONFIG_USB_STORAGE_CYPRESS_ATACB=m -CONFIG_USB_STORAGE_ENE_UB6250=m -CONFIG_USB_UAS=m +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +# CONFIG_USB_UAS is not set # # USB Imaging devices # -CONFIG_USB_MDC800=m -CONFIG_USB_MICROTEK=m +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set # CONFIG_USB_CDNS3 is not set # CONFIG_USB_MUSB_HDRC is not set # CONFIG_USB_DWC3 is not set -CONFIG_USB_DWC2=m -# CONFIG_USB_DWC2_HOST is not set - -# -# Gadget/Dual-role mode requires USB Gadget support to be enabled -# -# CONFIG_USB_DWC2_PERIPHERAL is not set -CONFIG_USB_DWC2_DUAL_ROLE=y -# CONFIG_USB_DWC2_DEBUG is not set -# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set -# CONFIG_USB_CHIPIDEA is not set +# CONFIG_USB_DWC2 is not set # CONFIG_USB_ISP1760 is not set # # USB port drivers # -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_GENERIC=y -# CONFIG_USB_SERIAL_SIMPLE is not set -CONFIG_USB_SERIAL_AIRCABLE=m -CONFIG_USB_SERIAL_ARK3116=m -CONFIG_USB_SERIAL_BELKIN=m -CONFIG_USB_SERIAL_CH341=m -CONFIG_USB_SERIAL_WHITEHEAT=m -CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m -CONFIG_USB_SERIAL_CP210X=m -CONFIG_USB_SERIAL_CYPRESS_M8=m -CONFIG_USB_SERIAL_EMPEG=m -CONFIG_USB_SERIAL_FTDI_SIO=m -CONFIG_USB_SERIAL_VISOR=m -CONFIG_USB_SERIAL_IPAQ=m -CONFIG_USB_SERIAL_IR=m -CONFIG_USB_SERIAL_EDGEPORT=m -CONFIG_USB_SERIAL_EDGEPORT_TI=m -CONFIG_USB_SERIAL_F81232=m -# CONFIG_USB_SERIAL_F8153X is not set -CONFIG_USB_SERIAL_GARMIN=m -CONFIG_USB_SERIAL_IPW=m -CONFIG_USB_SERIAL_IUU=m -CONFIG_USB_SERIAL_KEYSPAN_PDA=m -CONFIG_USB_SERIAL_KEYSPAN=m -CONFIG_USB_SERIAL_KLSI=m -CONFIG_USB_SERIAL_KOBIL_SCT=m -CONFIG_USB_SERIAL_MCT_U232=m -CONFIG_USB_SERIAL_METRO=m -CONFIG_USB_SERIAL_MOS7720=m -CONFIG_USB_SERIAL_MOS7840=m -# CONFIG_USB_SERIAL_MXUPORT is not set -CONFIG_USB_SERIAL_NAVMAN=m -CONFIG_USB_SERIAL_PL2303=m -CONFIG_USB_SERIAL_OTI6858=m -CONFIG_USB_SERIAL_QCAUX=m -CONFIG_USB_SERIAL_QUALCOMM=m -CONFIG_USB_SERIAL_SPCP8X5=m -CONFIG_USB_SERIAL_SAFE=m -# CONFIG_USB_SERIAL_SAFE_PADDED is not set -CONFIG_USB_SERIAL_SIERRAWIRELESS=m -CONFIG_USB_SERIAL_SYMBOL=m -CONFIG_USB_SERIAL_TI=m -CONFIG_USB_SERIAL_CYBERJACK=m -CONFIG_USB_SERIAL_XIRCOM=m -CONFIG_USB_SERIAL_WWAN=m -CONFIG_USB_SERIAL_OPTION=m -CONFIG_USB_SERIAL_OMNINET=m -CONFIG_USB_SERIAL_OPTICON=m -CONFIG_USB_SERIAL_XSENS_MT=m -CONFIG_USB_SERIAL_WISHBONE=m -CONFIG_USB_SERIAL_SSU100=m -CONFIG_USB_SERIAL_QT2=m -# CONFIG_USB_SERIAL_UPD78F0730 is not set -CONFIG_USB_SERIAL_DEBUG=m +# CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # -CONFIG_USB_EMI62=m -CONFIG_USB_EMI26=m -CONFIG_USB_ADUTUX=m -CONFIG_USB_SEVSEG=m -CONFIG_USB_LEGOTOWER=m -CONFIG_USB_LCD=m -CONFIG_USB_CYPRESS_CY7C63=m -CONFIG_USB_CYTHERM=m -CONFIG_USB_IDMOUSE=m -CONFIG_USB_FTDI_ELAN=m -CONFIG_USB_APPLEDISPLAY=m -CONFIG_USB_LD=m -CONFIG_USB_TRANCEVIBRATOR=m -CONFIG_USB_IOWARRIOR=m -CONFIG_USB_TEST=m +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set # CONFIG_USB_EHSET_TEST_FIXTURE is not set -CONFIG_USB_ISIGHTFW=m -CONFIG_USB_YUREX=m -CONFIG_USB_EZUSB_FX2=m +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_EZUSB_FX2 is not set # CONFIG_USB_HUB_USB251XB is not set # CONFIG_USB_HSIC_USB3503 is not set # CONFIG_USB_HSIC_USB4604 is not set @@ -2389,60 +2315,7 @@ CONFIG_USB_EZUSB_FX2=m # CONFIG_USB_ULPI is not set # end of USB Physical Layer drivers -CONFIG_USB_GADGET=m -# CONFIG_USB_GADGET_DEBUG is not set -# CONFIG_USB_GADGET_DEBUG_FILES is not set -# CONFIG_USB_GADGET_DEBUG_FS is not set -CONFIG_USB_GADGET_VBUS_DRAW=2 -CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 -# CONFIG_U_SERIAL_CONSOLE is not set - -# -# USB Peripheral Controller -# -# CONFIG_USB_FUSB300 is not set -# CONFIG_USB_FOTG210_UDC is not set -# CONFIG_USB_GR_UDC is not set -# CONFIG_USB_R8A66597 is not set -# CONFIG_USB_PXA27X is not set -# CONFIG_USB_MV_UDC is not set -# CONFIG_USB_MV_U3D is not set -# CONFIG_USB_SNP_UDC_PLAT is not set -# CONFIG_USB_M66592 is not set -# CONFIG_USB_BDC_UDC is not set -# CONFIG_USB_NET2272 is not set -# CONFIG_USB_GADGET_XILINX is not set -# CONFIG_USB_DUMMY_HCD is not set -# end of USB Peripheral Controller - -CONFIG_USB_LIBCOMPOSITE=m -CONFIG_USB_F_ACM=m -CONFIG_USB_F_SS_LB=m -CONFIG_USB_U_SERIAL=m -CONFIG_USB_F_SERIAL=m -CONFIG_USB_F_OBEX=m -CONFIG_USB_F_MASS_STORAGE=m -CONFIG_USB_F_FS=m -CONFIG_USB_F_HID=m -CONFIG_USB_F_PRINTER=m -CONFIG_USB_CONFIGFS=m -CONFIG_USB_CONFIGFS_SERIAL=y -CONFIG_USB_CONFIGFS_ACM=y -CONFIG_USB_CONFIGFS_OBEX=y -CONFIG_USB_CONFIGFS_MASS_STORAGE=y -CONFIG_USB_CONFIGFS_F_LB_SS=y -CONFIG_USB_CONFIGFS_F_FS=y -CONFIG_USB_CONFIGFS_F_HID=y -CONFIG_USB_CONFIGFS_F_PRINTER=y -CONFIG_USB_ZERO=m -CONFIG_USB_GADGETFS=m -# CONFIG_USB_FUNCTIONFS is not set -CONFIG_USB_MASS_STORAGE=m -CONFIG_USB_G_SERIAL=m -CONFIG_USB_G_PRINTER=m -CONFIG_USB_G_ACM_MS=m -CONFIG_USB_G_HID=m -# CONFIG_USB_G_DBGP is not set +# CONFIG_USB_GADGET is not set # CONFIG_TYPEC is not set # CONFIG_USB_ROLE_SWITCH is not set CONFIG_MMC=y @@ -2611,10 +2484,7 @@ CONFIG_PANEL_BOOT_MESSAGE="ct1986 starting!" # CONFIG_CHARLCD_BL_ON is not set CONFIG_CHARLCD_BL_FLASH=y CONFIG_CHARLCD=y -CONFIG_UIO=m -CONFIG_UIO_PDRV_GENIRQ=m -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_PRUSS is not set +# CONFIG_UIO is not set # CONFIG_VIRT_DRIVERS is not set CONFIG_VIRTIO_MENU=y # CONFIG_VIRTIO_MMIO is not set @@ -2625,144 +2495,7 @@ CONFIG_VIRTIO_MENU=y # end of Microsoft Hyper-V guest support # CONFIG_GREYBUS is not set -CONFIG_STAGING=y -# CONFIG_COMEDI is not set - -# -# IIO staging drivers -# - -# -# Accelerometers -# -# CONFIG_ADIS16203 is not set -# CONFIG_ADIS16240 is not set -# end of Accelerometers - -# -# Analog to digital converters -# -# CONFIG_AD7816 is not set -# CONFIG_AD7192 is not set -# CONFIG_AD7280 is not set -# end of Analog to digital converters - -# -# Analog digital bi-direction converters -# -# CONFIG_ADT7316 is not set -# end of Analog digital bi-direction converters - -# -# Capacitance to digital converters -# -# CONFIG_AD7150 is not set -# CONFIG_AD7746 is not set -# end of Capacitance to digital converters - -# -# Direct Digital Synthesis -# -# CONFIG_AD9832 is not set -# CONFIG_AD9834 is not set -# end of Direct Digital Synthesis - -# -# Network Analyzer, Impedance Converters -# -# CONFIG_AD5933 is not set -# end of Network Analyzer, Impedance Converters - -# -# Active energy metering IC -# -# CONFIG_ADE7854 is not set -# end of Active energy metering IC - -# -# Resolver to digital converters -# -# CONFIG_AD2S1210 is not set -# end of Resolver to digital converters -# end of IIO staging drivers - -# -# Speakup console speech -# -CONFIG_SPEAKUP=m -# CONFIG_SPEAKUP_SYNTH_ACNTSA is not set -# CONFIG_SPEAKUP_SYNTH_APOLLO is not set -# CONFIG_SPEAKUP_SYNTH_AUDPTR is not set -# CONFIG_SPEAKUP_SYNTH_BNS is not set -# CONFIG_SPEAKUP_SYNTH_DECTLK is not set -# CONFIG_SPEAKUP_SYNTH_DECEXT is not set -# CONFIG_SPEAKUP_SYNTH_LTLK is not set -CONFIG_SPEAKUP_SYNTH_SOFT=m -# CONFIG_SPEAKUP_SYNTH_SPKOUT is not set -# CONFIG_SPEAKUP_SYNTH_TXPRT is not set -# CONFIG_SPEAKUP_SYNTH_DUMMY is not set -# end of Speakup console speech - -CONFIG_STAGING_MEDIA=y - -# -# Android -# -# end of Android - -# CONFIG_STAGING_BOARD is not set -# CONFIG_GS_FPGABOOT is not set -# CONFIG_UNISYSSPAR is not set -# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -CONFIG_FB_TFT=m -CONFIG_FB_TFT_AGM1264K_FL=m -CONFIG_FB_TFT_BD663474=m -CONFIG_FB_TFT_HX8340BN=m -CONFIG_FB_TFT_HX8347D=m -CONFIG_FB_TFT_HX8353D=m -CONFIG_FB_TFT_HX8357D=m -CONFIG_FB_TFT_ILI9163=m -CONFIG_FB_TFT_ILI9320=m -CONFIG_FB_TFT_ILI9325=m -CONFIG_FB_TFT_ILI9340=m -CONFIG_FB_TFT_ILI9341=m -CONFIG_FB_TFT_ILI9481=m -CONFIG_FB_TFT_ILI9486=m -CONFIG_FB_TFT_PCD8544=m -CONFIG_FB_TFT_RA8875=m -CONFIG_FB_TFT_S6D02A1=m -CONFIG_FB_TFT_S6D1121=m -CONFIG_FB_TFT_SH1106=m -CONFIG_FB_TFT_SSD1289=m -# CONFIG_FB_TFT_SSD1305 is not set -CONFIG_FB_TFT_SSD1306=m -CONFIG_FB_TFT_SSD1331=m -CONFIG_FB_TFT_SSD1351=m -CONFIG_FB_TFT_ST7735R=m -CONFIG_FB_TFT_ST7789V=m -CONFIG_FB_TFT_TINYLCD=m -CONFIG_FB_TFT_TLS8204=m -# CONFIG_FB_TFT_UC1611 is not set -CONFIG_FB_TFT_UC1701=m -CONFIG_FB_TFT_UPD161704=m -CONFIG_FB_TFT_WATTEROTT=m -# CONFIG_MOST is not set -CONFIG_BCM_VIDEOCORE=y -CONFIG_BCM2835_VCHIQ=y -CONFIG_BCM2835_VCHIQ_MMAL=m -CONFIG_BCM_VC_SM_CMA=m -# CONFIG_PI433 is not set - -# -# Gasket devices -# -# end of Gasket devices - -# CONFIG_XIL_AXIS_FIFO is not set -# CONFIG_FIELDBUS_DEV is not set -# CONFIG_USB_WUSB_CBAF is not set -# CONFIG_UWB is not set -# CONFIG_EXFAT_FS is not set +# CONFIG_STAGING is not set # CONFIG_GOLDFISH is not set # CONFIG_MFD_CROS_EC is not set # CONFIG_CHROME_PLATFORMS is not set @@ -2880,7 +2613,6 @@ CONFIG_EXTCON=m # # Extcon Device Drivers # -# CONFIG_EXTCON_ADC_JACK is not set # CONFIG_EXTCON_FSA9480 is not set # CONFIG_EXTCON_GPIO is not set # CONFIG_EXTCON_MAX3355 is not set @@ -2889,422 +2621,7 @@ CONFIG_EXTCON=m # CONFIG_EXTCON_SM5502 is not set # CONFIG_EXTCON_USB_GPIO is not set # CONFIG_MEMORY is not set -CONFIG_IIO=m -CONFIG_IIO_BUFFER=y -CONFIG_IIO_BUFFER_CB=m -# CONFIG_IIO_BUFFER_HW_CONSUMER is not set -CONFIG_IIO_KFIFO_BUF=m -CONFIG_IIO_TRIGGERED_BUFFER=m -# CONFIG_IIO_CONFIGFS is not set -CONFIG_IIO_TRIGGER=y -CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 -# CONFIG_IIO_SW_DEVICE is not set -# CONFIG_IIO_SW_TRIGGER is not set - -# -# Accelerometers -# -# CONFIG_ADIS16201 is not set -# CONFIG_ADIS16209 is not set -# CONFIG_ADXL372_SPI is not set -# CONFIG_ADXL372_I2C is not set -# CONFIG_BMA180 is not set -# CONFIG_BMA220 is not set -# CONFIG_BMC150_ACCEL is not set -# CONFIG_DA280 is not set -# CONFIG_DA311 is not set -# CONFIG_DMARD06 is not set -# CONFIG_DMARD09 is not set -# CONFIG_DMARD10 is not set -# CONFIG_IIO_ST_ACCEL_3AXIS is not set -# CONFIG_KXSD9 is not set -# CONFIG_KXCJK1013 is not set -# CONFIG_MC3230 is not set -# CONFIG_MMA7455_I2C is not set -# CONFIG_MMA7455_SPI is not set -# CONFIG_MMA7660 is not set -# CONFIG_MMA8452 is not set -# CONFIG_MMA9551 is not set -# CONFIG_MMA9553 is not set -# CONFIG_MXC4005 is not set -# CONFIG_MXC6255 is not set -# CONFIG_SCA3000 is not set -# CONFIG_STK8312 is not set -# CONFIG_STK8BA50 is not set -# end of Accelerometers - -# -# Analog to digital converters -# -# CONFIG_AD7124 is not set -# CONFIG_AD7266 is not set -# CONFIG_AD7291 is not set -# CONFIG_AD7298 is not set -# CONFIG_AD7476 is not set -# CONFIG_AD7606_IFACE_PARALLEL is not set -# CONFIG_AD7606_IFACE_SPI is not set -# CONFIG_AD7766 is not set -# CONFIG_AD7768_1 is not set -# CONFIG_AD7780 is not set -# CONFIG_AD7791 is not set -# CONFIG_AD7793 is not set -# CONFIG_AD7887 is not set -# CONFIG_AD7923 is not set -# CONFIG_AD7949 is not set -# CONFIG_AD799X is not set -# CONFIG_CC10001_ADC is not set -# CONFIG_ENVELOPE_DETECTOR is not set -# CONFIG_HI8435 is not set -# CONFIG_HX711 is not set -# CONFIG_INA2XX_ADC is not set -# CONFIG_LTC2471 is not set -# CONFIG_LTC2485 is not set -# CONFIG_LTC2497 is not set -# CONFIG_MAX1027 is not set -# CONFIG_MAX11100 is not set -# CONFIG_MAX1118 is not set -# CONFIG_MAX1363 is not set -# CONFIG_MAX9611 is not set -CONFIG_MCP320X=m -CONFIG_MCP3422=m -# CONFIG_MCP3911 is not set -# CONFIG_NAU7802 is not set -# CONFIG_SD_ADC_MODULATOR is not set -# CONFIG_STMPE_ADC is not set -# CONFIG_TI_ADC081C is not set -# CONFIG_TI_ADC0832 is not set -# CONFIG_TI_ADC084S021 is not set -# CONFIG_TI_ADC12138 is not set -# CONFIG_TI_ADC108S102 is not set -# CONFIG_TI_ADC128S052 is not set -# CONFIG_TI_ADC161S626 is not set -CONFIG_TI_ADS1015=m -# CONFIG_TI_ADS7950 is not set -# CONFIG_TI_ADS8344 is not set -# CONFIG_TI_ADS8688 is not set -# CONFIG_TI_ADS124S08 is not set -# CONFIG_TI_TLC4541 is not set -# CONFIG_VF610_ADC is not set -# CONFIG_XILINX_XADC is not set -# end of Analog to digital converters - -# -# Analog Front Ends -# -# CONFIG_IIO_RESCALE is not set -# end of Analog Front Ends - -# -# Amplifiers -# -# CONFIG_AD8366 is not set -# end of Amplifiers - -# -# Chemical Sensors -# -# CONFIG_ATLAS_PH_SENSOR is not set -CONFIG_BME680=m -CONFIG_BME680_I2C=m -CONFIG_BME680_SPI=m -# CONFIG_CCS811 is not set -# CONFIG_IAQCORE is not set -# CONFIG_PMS7003 is not set -# CONFIG_SENSIRION_SGP30 is not set -CONFIG_SPS30=m -# CONFIG_VZ89X is not set -# end of Chemical Sensors - -# -# Hid Sensor IIO Common -# -# end of Hid Sensor IIO Common - -CONFIG_IIO_MS_SENSORS_I2C=m - -# -# SSP Sensor Common -# -# CONFIG_IIO_SSP_SENSORHUB is not set -# end of SSP Sensor Common - -# -# Digital to analog converters -# -# CONFIG_AD5064 is not set -# CONFIG_AD5360 is not set -# CONFIG_AD5380 is not set -# CONFIG_AD5421 is not set -# CONFIG_AD5446 is not set -# CONFIG_AD5449 is not set -# CONFIG_AD5592R is not set -# CONFIG_AD5593R is not set -# CONFIG_AD5504 is not set -# CONFIG_AD5624R_SPI is not set -# CONFIG_LTC1660 is not set -# CONFIG_LTC2632 is not set -# CONFIG_AD5686_SPI is not set -# CONFIG_AD5696_I2C is not set -# CONFIG_AD5755 is not set -# CONFIG_AD5758 is not set -# CONFIG_AD5761 is not set -# CONFIG_AD5764 is not set -# CONFIG_AD5791 is not set -# CONFIG_AD7303 is not set -# CONFIG_AD8801 is not set -# CONFIG_DPOT_DAC is not set -# CONFIG_DS4424 is not set -# CONFIG_M62332 is not set -# CONFIG_MAX517 is not set -# CONFIG_MAX5821 is not set -# CONFIG_MCP4725 is not set -# CONFIG_MCP4922 is not set -# CONFIG_TI_DAC082S085 is not set -# CONFIG_TI_DAC5571 is not set -# CONFIG_TI_DAC7311 is not set -# CONFIG_TI_DAC7612 is not set -# CONFIG_VF610_DAC is not set -# end of Digital to analog converters - -# -# IIO dummy driver -# -# end of IIO dummy driver - -# -# Frequency Synthesizers DDS/PLL -# - -# -# Clock Generator/Distribution -# -# CONFIG_AD9523 is not set -# end of Clock Generator/Distribution - -# -# Phase-Locked Loop (PLL) frequency synthesizers -# -# CONFIG_ADF4350 is not set -# CONFIG_ADF4371 is not set -# end of Phase-Locked Loop (PLL) frequency synthesizers -# end of Frequency Synthesizers DDS/PLL - -# -# Digital gyroscope sensors -# -# CONFIG_ADIS16080 is not set -# CONFIG_ADIS16130 is not set -# CONFIG_ADIS16136 is not set -# CONFIG_ADIS16260 is not set -# CONFIG_ADXRS450 is not set -# CONFIG_BMG160 is not set -# CONFIG_FXAS21002C is not set -# CONFIG_MPU3050_I2C is not set -# CONFIG_IIO_ST_GYRO_3AXIS is not set -# CONFIG_ITG3200 is not set -# end of Digital gyroscope sensors - -# -# Health Sensors -# - -# -# Heart Rate Monitors -# -# CONFIG_AFE4403 is not set -# CONFIG_AFE4404 is not set -# CONFIG_MAX30100 is not set -# CONFIG_MAX30102 is not set -# end of Heart Rate Monitors -# end of Health Sensors - -# -# Humidity sensors -# -# CONFIG_AM2315 is not set -CONFIG_DHT11=m -CONFIG_HDC100X=m -# CONFIG_HTS221 is not set -CONFIG_HTU21=m -# CONFIG_SI7005 is not set -# CONFIG_SI7020 is not set -# end of Humidity sensors - -# -# Inertial measurement units -# -# CONFIG_ADIS16400 is not set -# CONFIG_ADIS16460 is not set -# CONFIG_ADIS16480 is not set -# CONFIG_BMI160_I2C is not set -# CONFIG_BMI160_SPI is not set -# CONFIG_KMX61 is not set -CONFIG_INV_MPU6050_IIO=m -CONFIG_INV_MPU6050_I2C=m -# CONFIG_INV_MPU6050_SPI is not set -# CONFIG_IIO_ST_LSM6DSX is not set -# end of Inertial measurement units - -# -# Light sensors -# -# CONFIG_ADJD_S311 is not set -# CONFIG_AL3320A is not set -# CONFIG_APDS9300 is not set -CONFIG_APDS9960=m -# CONFIG_BH1750 is not set -# CONFIG_BH1780 is not set -# CONFIG_CM32181 is not set -# CONFIG_CM3232 is not set -# CONFIG_CM3323 is not set -# CONFIG_CM3605 is not set -# CONFIG_CM36651 is not set -# CONFIG_GP2AP020A00F is not set -# CONFIG_SENSORS_ISL29018 is not set -# CONFIG_SENSORS_ISL29028 is not set -# CONFIG_ISL29125 is not set -# CONFIG_JSA1212 is not set -# CONFIG_RPR0521 is not set -# CONFIG_LTR501 is not set -# CONFIG_LV0104CS is not set -# CONFIG_MAX44000 is not set -# CONFIG_MAX44009 is not set -# CONFIG_NOA1305 is not set -# CONFIG_OPT3001 is not set -# CONFIG_PA12203001 is not set -# CONFIG_SI1133 is not set -# CONFIG_SI1145 is not set -# CONFIG_STK3310 is not set -# CONFIG_ST_UVIS25 is not set -# CONFIG_TCS3414 is not set -# CONFIG_TCS3472 is not set -# CONFIG_SENSORS_TSL2563 is not set -# CONFIG_TSL2583 is not set -# CONFIG_TSL2772 is not set -CONFIG_TSL4531=m -# CONFIG_US5182D is not set -# CONFIG_VCNL4000 is not set -# CONFIG_VCNL4035 is not set -CONFIG_VEML6070=m -# CONFIG_VL6180 is not set -# CONFIG_ZOPT2201 is not set -# end of Light sensors - -# -# Magnetometer sensors -# -# CONFIG_AK8974 is not set -# CONFIG_AK8975 is not set -# CONFIG_AK09911 is not set -# CONFIG_BMC150_MAGN_I2C is not set -# CONFIG_BMC150_MAGN_SPI is not set -# CONFIG_MAG3110 is not set -# CONFIG_MMC35240 is not set -# CONFIG_IIO_ST_MAGN_3AXIS is not set -# CONFIG_SENSORS_HMC5843_I2C is not set -# CONFIG_SENSORS_HMC5843_SPI is not set -# CONFIG_SENSORS_RM3100_I2C is not set -# CONFIG_SENSORS_RM3100_SPI is not set -# end of Magnetometer sensors - -# -# Multiplexers -# -# CONFIG_IIO_MUX is not set -# end of Multiplexers - -# -# Inclinometer sensors -# -# end of Inclinometer sensors - -# -# Triggers - standalone -# -# CONFIG_IIO_INTERRUPT_TRIGGER is not set -# CONFIG_IIO_SYSFS_TRIGGER is not set -# end of Triggers - standalone - -# -# Digital potentiometers -# -# CONFIG_AD5272 is not set -# CONFIG_DS1803 is not set -# CONFIG_MAX5432 is not set -# CONFIG_MAX5481 is not set -# CONFIG_MAX5487 is not set -# CONFIG_MCP4018 is not set -# CONFIG_MCP4131 is not set -# CONFIG_MCP4531 is not set -# CONFIG_MCP41010 is not set -# CONFIG_TPL0102 is not set -# end of Digital potentiometers - -# -# Digital potentiostats -# -# CONFIG_LMP91000 is not set -# end of Digital potentiostats - -# -# Pressure sensors -# -# CONFIG_ABP060MG is not set -CONFIG_BMP280=m -CONFIG_BMP280_I2C=m -CONFIG_BMP280_SPI=m -# CONFIG_DPS310 is not set -# CONFIG_HP03 is not set -# CONFIG_MPL115_I2C is not set -# CONFIG_MPL115_SPI is not set -# CONFIG_MPL3115 is not set -# CONFIG_MS5611 is not set -# CONFIG_MS5637 is not set -# CONFIG_IIO_ST_PRESS is not set -# CONFIG_T5403 is not set -# CONFIG_HP206C is not set -# CONFIG_ZPA2326 is not set -# end of Pressure sensors - -# -# Lightning sensors -# -# CONFIG_AS3935 is not set -# end of Lightning sensors - -# -# Proximity and distance sensors -# -# CONFIG_ISL29501 is not set -# CONFIG_LIDAR_LITE_V2 is not set -# CONFIG_MB1232 is not set -# CONFIG_RFD77402 is not set -# CONFIG_SRF04 is not set -# CONFIG_SX9500 is not set -# CONFIG_SRF08 is not set -# CONFIG_VL53L0X_I2C is not set -# end of Proximity and distance sensors - -# -# Resolver to digital converters -# -# CONFIG_AD2S90 is not set -# CONFIG_AD2S1200 is not set -# end of Resolver to digital converters - -# -# Temperature sensors -# -CONFIG_MAXIM_THERMOCOUPLE=m -# CONFIG_MLX90614 is not set -# CONFIG_MLX90632 is not set -# CONFIG_TMP006 is not set -# CONFIG_TMP007 is not set -# CONFIG_TSYS01 is not set -# CONFIG_TSYS02D is not set -# CONFIG_MAX31856 is not set -# end of Temperature sensors - +# CONFIG_IIO is not set CONFIG_PWM=y CONFIG_PWM_SYSFS=y CONFIG_PWM_BCM2835=m @@ -3336,9 +2653,7 @@ CONFIG_RESET_SIMPLE=y # CONFIG_PHY_MIXEL_MIPI_DPHY is not set # CONFIG_PHY_PXA_28NM_HSIC is not set # CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_CPCAP_USB is not set # CONFIG_PHY_MAPPHONE_MDM6600 is not set -# CONFIG_PHY_SAMSUNG_USB2 is not set # end of PHY Subsystem # CONFIG_POWERCAP is not set @@ -3401,8 +2716,8 @@ CONFIG_FS_IOMAP=y # CONFIG_EXT3_FS is not set CONFIG_EXT4_FS=y CONFIG_EXT4_USE_FOR_EXT2=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXT4_FS_SECURITY=y +# CONFIG_EXT4_FS_POSIX_ACL is not set +# CONFIG_EXT4_FS_SECURITY is not set # CONFIG_EXT4_DEBUG is not set CONFIG_JBD2=y # CONFIG_JBD2_DEBUG is not set @@ -3412,17 +2727,16 @@ CONFIG_FS_MBCACHE=y # CONFIG_XFS_FS is not set # CONFIG_GFS2_FS is not set # CONFIG_BTRFS_FS is not set -CONFIG_NILFS2_FS=m +# CONFIG_NILFS2_FS is not set # CONFIG_F2FS_FS is not set CONFIG_FS_POSIX_ACL=y CONFIG_EXPORTFS=y # CONFIG_EXPORTFS_BLOCK_OPS is not set -CONFIG_FILE_LOCKING=y -CONFIG_MANDATORY_FILE_LOCKING=y +# CONFIG_FILE_LOCKING is not set # CONFIG_FS_ENCRYPTION is not set # CONFIG_FS_VERITY is not set CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y +# CONFIG_DNOTIFY is not set CONFIG_INOTIFY_USER=y CONFIG_FANOTIFY=y # CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set @@ -3863,7 +3177,6 @@ CONFIG_DEBUG_MISC=y # CONFIG_PAGE_POISONING is not set # CONFIG_DEBUG_PAGE_REF is not set # CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SLUB_DEBUG_ON is not set # CONFIG_SLUB_STATS is not set CONFIG_HAVE_DEBUG_KMEMLEAK=y # CONFIG_DEBUG_KMEMLEAK is not set diff --git a/resources/post-build.sh b/resources/post-build.sh new file mode 100644 index 0000000..18335a4 --- /dev/null +++ b/resources/post-build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -u +set -e + +echo "console::respawn:-/bin/sh" >> ${TARGET_DIR}/etc/inittab diff --git a/src/ct1986.c b/src/ct1986.c index cb232fc..4cbe2a7 100644 --- a/src/ct1986.c +++ b/src/ct1986.c @@ -5,12 +5,19 @@ #include <tak.h> #include <minimax_cnn1986.h> -FILE *lcd = NULL; +const char* esc = "[L"; +FILE *lcd = NULL; static char *gamelog = 0; static int human, search_depth; static void +write_line(const char *line) { + fputs(line, lcd); + fflush(lcd); +} + +static void append_to_gamelog(const char *line, const uint8_t win_line) { // I _could_ dynamically compute the size but ... don't let // `perfect' be the enemy of `good' ? @@ -38,8 +45,7 @@ static void end_game(char *line, char *win) { append_to_gamelog(line, 0); append_to_gamelog(win, 1); - fputs("Game over: ",lcd); - fputs(win, lcd); + fprintf(lcd, "Game over: %s\n", win); fflush(lcd); } @@ -49,13 +55,9 @@ handle_turn(char *line) { uint8_t new_win = (won == 0xFF); switch (do_ptn(line)) { // Errors - case PTN_INVALID: { fputs("Invalid PTN.", lcd); return -1; break; } - case ACT_ILLEGAL: { fputs("Illegal action.", lcd); return -1; break; } - case ACT_OVERFLOW: { - fputs("Move would cause internal overflow, select another.", lcd); - return EXIT_FAILURE; - break; - } + case PTN_INVALID: { write_line("Invalid PTN."); break; } + case ACT_ILLEGAL: { write_line("Illegal ply."); break; } + case ACT_OVERFLOW: { write_line("Overflow."); break; } // Game has ended case GAME_END: { // Did it end this turn? @@ -67,92 +69,90 @@ handle_turn(char *line) { case WIN_ROAD_BLACK: { end_game(line,"0-R"); break; } case WIN_ROAD_WHITE: { end_game(line,"R-0"); break; } } + return EXIT_SUCCESS; + } else { + write_line("Game over."); + break; } - fputs("Game over, enter `new' to play again.", lcd); - if (! new_win) return EXIT_FAILURE; - break; } // Valid, append to game log - case PTN_VALID: - case ACT_OK: { + default: { append_to_gamelog(line, 0); - break; + return EXIT_SUCCESS; } } - - return EXIT_SUCCESS; + return EXIT_FAILURE; } static void new_game(uint8_t size) { reset_state(size); - fputs("New 5x5 game! ct1986 at search depth ", lcd); - fputc(search_depth + '0', lcd); - fputc('.', lcd); - fflush(lcd); + write_line("New 5x5 game."); if (gamelog) gamelog = realloc(gamelog, sizeof(char)); else gamelog = malloc(sizeof(char)); gamelog[0] = 0; } // Set up output function for ct1986 + +static uint8_t perc; inline void ct1986_display_progress(const uint8_t depth) { if (depth == 0) { - fputc('#', lcd); + perc++; + // back four spaces + for (int k=0;k<4;k++) { + fprintf(lcd, "%sl", esc); + fflush(lcd); + } + // clear line + fprintf(lcd, "%sk", esc); + fflush(lcd); + // write percentage + fprintf(lcd, "%3d%%", perc*4); } } static int ct1986_turn(const uint8_t search_depth) { // Prepare progress bar - fputs("Computing ", lcd); + fputs("Computing.. ", lcd); fflush(lcd); // Run the minimax + perc = 0; float minimax = ct1986_generate(search_depth); + fputc('\n', lcd); // Failed to find a move? if (minimax <= -infty) { - fputs("Opponent concedes!", lcd); + fprintf(lcd, "%s concedes!\n", (ply & 1) ? "Black" : "White"); return EXIT_FAILURE; } else { - fputs("Result: ", lcd); - fputs(ct1986_ptn, lcd); + fprintf(lcd, "%s: %s\n", + (ply & 1) ? "Black" : "White", + ct1986_ptn); handle_turn(ct1986_ptn); return EXIT_SUCCESS; } } +static void +do_game_log(void) { + fputs(gamelog, lcd); +} + static int input_is_not_turn(const char *line) { - if (!strcmp(line,"help")) { - fputs("Valid commands: depth [0-9], help, new, \ -play (b|w), self-play, <PTN>.", lcd); - } else if (!strcmp(line,"log")) { - fputs(gamelog, lcd); - } else if (!strcmp(line,"new")) { - new_game(5); - } else if (!strcmp(line,"self-play")) { - while (ct1986_turn(search_depth) == 0); - } else if (!strncmp(line,"depth",5)) { - if (strnlen(line,7) == 7 && line[6] >= '0' && line[6] <= '9') { - search_depth = line[6] - '0'; - fputs("New search depth: ", lcd); - fputc(line[6], lcd); + switch (line[0]) { + case 'l': { do_game_log(); break; } + case 'n': { new_game(5); break; } + case 'd': { + search_depth = line[1] - '0'; + fprintf(lcd, "Search depth: %d\n", search_depth); fflush(lcd); - } else { - fputs("Usage: depth [0-9].", lcd); - } - } else if (!strncmp(line,"play",4)) { - if (strnlen(line,7) == 6 - && ((line[5] == 'b' || line[5] == 'B') - || (line[5] == 'w' || line[5] == 'W'))) { - // 'b' is even :) - human = 1 - (line[5] & 1); - new_game(5); - } else { - fputs("Usage: play (b|w).\n", lcd); + break; } - } else { - return EXIT_FAILURE; + case 'b': { human = 1; new_game(5); break; } + case 'w': { human = 0; new_game(5); break; } + default: return EXIT_FAILURE; } return EXIT_SUCCESS; } @@ -162,7 +162,7 @@ main(int argc, char **argv) { (void)(argc); (void)(argv); - lcd = fopen("/dev/lcd","w"); + lcd = fopen("/dev/lcd", "w"); if (lcd == NULL) return EXIT_FAILURE; human = 0; @@ -174,8 +174,7 @@ main(int argc, char **argv) { size_t alloc_size; for (int playing = 1; playing;) { - fputs("Welcome to ct1986!\n", lcd); fflush(lcd); - fflush(stdout); + write_line("Loaded ct1986!\n"); while ((human == 0) && (read = getline(&line, &alloc_size, stdin)) != -1) { if (read) { line[read - 1] = 0; |
