├── .gitignore ├── LICENSE ├── README.md ├── README_EN.md ├── docs └── L9110S-MS规格书.pdf ├── example ├── 01_LED(OFFICAL METHODS) │ ├── main.py │ └── sample.png ├── 02_ACCEL │ └── main.py ├── 03_BUTTON │ └── main.py └── 04_LED(WITH SOURCE CODE) │ ├── esp-idf │ └── alphapi_LED │ │ ├── .devcontainer │ │ ├── Dockerfile │ │ └── devcontainer.json │ │ ├── .vscode │ │ ├── c_cpp_properties.json │ │ ├── launch.json │ │ ├── settings.json │ │ └── tasks.json │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── README_EN.md │ │ ├── build │ │ └── CMakeFiles │ │ │ ├── 3.24.0 │ │ │ ├── CMakeASMCompiler.cmake │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.out │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.out │ │ │ ├── CMakeOutput.log │ │ │ ├── TargetDirectories.txt │ │ │ ├── alphapi_LED.elf.dir │ │ │ └── project_elf_src_esp32c3.c.obj │ │ │ ├── bootloader-complete │ │ │ ├── bootloader.dir │ │ │ ├── Labels.json │ │ │ └── Labels.txt │ │ │ ├── clean_additional.cmake │ │ │ ├── cmake.check_cache │ │ │ ├── git-data │ │ │ ├── HEAD │ │ │ ├── grabRef.cmake │ │ │ └── head-ref │ │ │ └── rules.ninja │ │ ├── images │ │ ├── pic1.jpg │ │ └── pic2.jpg │ │ ├── main │ │ ├── CMakeLists.txt │ │ ├── alphapi.h │ │ └── sparkling_heart.c │ │ └── sdkconfig │ └── micropython │ ├── Code containing library file │ ├── alpha_pi.py │ └── main.py │ └── main.py ├── old ├── AlphaPi_flash_4MB.bin ├── mpy_disassemble │ ├── actuator_led.mpy.freeze │ ├── actuator_led.mpy.txt │ ├── basic.mpy.freeze │ ├── basic.mpy.txt │ ├── control_board_v1.mpy.decompiled │ ├── control_board_v1.mpy.freeze │ ├── control_board_v1.mpy.txt │ ├── sensor_infrared.mpy.freeze │ └── sensor_infrared.mpy.txt └── rootfs │ ├── actuator_led.mpy │ ├── alert.dat │ ├── basic.mpy │ ├── boot.py │ ├── broken.dat │ ├── control_board_v1.mpy │ ├── drop.dat │ ├── du.dat │ ├── electric.dat │ ├── funny.dat │ ├── main.py │ ├── main2.py │ ├── msg.dat │ ├── pass.dat │ ├── r1.dat │ ├── record_end.dat │ ├── record_start.dat │ ├── right.dat │ ├── sensor_infrared.mpy │ ├── tech.dat │ ├── test │ ├── variable.py │ └── wrong.dat ├── test ├── test.mpy └── test.py └── v1.0.3 ├── main.py └── rootfs ├── alert.dat ├── basic.mpy ├── boot.py ├── broken.dat ├── controlBoard.mpy ├── drop.dat ├── du.dat ├── electric.dat ├── funny.dat ├── main.py ├── msg.dat ├── pass.dat ├── record_end.dat ├── record_start.dat ├── right.dat ├── tech.dat └── wrong.dat /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AlphaPi 2 | 3 | 注意!!AlphaPi 电路板的硬件版本和固件随时都在更新,这个项目的固件是比较老的版本,请一定要先提取自己板子上的固件版本,先做好备份! 4 | 5 | 官网: 6 | 7 | http://lingxi.hetao101.com/alphapi 8 | 9 | 10 | 固件使用如下命令提取 4M flash: 11 | 12 | ```shell 13 | ~/Library/Arduino15/packages/esp32/tools/esptool_py/4.2.1/esptool -p /dev/cu.usbmodem101 read_flash 0 0x400000 flash_contents.bin 14 | ``` 15 | 16 | 使用以下命令解析 .mpy 文件: 17 | ```shell 18 | $ micropython/tools/mpy-tool.py -d ./rootfs/control_board_v1.mpy > ./rootfs/control_board_v1.mpy.txt 19 | ``` 20 | 21 | 22 | ```shell 23 | >>> import esp32 24 | >>> esp32.Partition.find() 25 | [] 26 | ``` 27 | 28 | 29 | ```shell 30 | # flash_read: 31 | esp.flash_read(byte_offset, length_or_buffer)¶ 32 | ``` 33 | 34 | # 所有 API 和文档 35 | ## control_board_v1.mpy 36 | 37 | ### 方法 38 | 39 | * control_board_v1.led_show_bytes(bytearray) 40 | 41 | 用 I2C 扩展芯片点亮 5x5 红色LED,参数是5个数字的bytearray。这个是同步接口。 42 | bytearray([8, 0, 0, 0, 0]) 点亮第5行第1列的灯,bytearray([16, 0, 0, 0, 0]) 点亮第4行第1列的灯,同理,bytearray([128, 0, 0, 0, 0]) 点亮第1行第1列的灯,bytearray([255, 255, 255, 255, 255]) 点亮5x5所有的灯。 43 | 44 | ```python 45 | import control_board_v1 46 | # 点亮最下面一行所有的灯 47 | control_board_v1.led_show_bytes(bytearray([8, 8, 8, 8, 8])) 48 | ``` 49 | 50 | * control_board_v1.led_show_bytes_async(bytearray) 51 | 同上,这个是异步接口。 52 | ```python 53 | import control_board_v1 54 | control_board_v1.led_show_bytes_async(bytearray([9, 8, 0, 0, 0])) 55 | ``` 56 | 57 | 58 | ### 类 59 | * control_board_v1.PlayRecordMission 60 | 61 | ### 示例 62 | * 01 5X5 LED(OFFICAL METHODS) 63 | * 02 ACEL 64 | * 03 BUTTON 65 | * 04 5X5 LED(WITH SOURCE CODE) 66 | 67 | 68 | # GPIO对应 69 | 已知: 70 | button a ————— GPIO 10 71 | button b ————— GPIO 20 72 | button c ————— GPIO 21 73 | I2C(SC7A20国产三轴) ————— SDA 6 SCL 7 74 | UART ————— TX 8 RX 9 baudrate 460800 75 | 板子上还有个国产MCU,主要通过UART通信实现音频录制播放、5x5 led的功能。 76 | 未知: 77 | P1 ————— GPIO5 78 | P2 ————— GPIO4 79 | 到此alphapi的硬件基本挖掘完毕,通过螺丝柱供电这种方式确实第一次见。 80 | TODO 81 | -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | # AlphaPi 2 | 3 | Attention: The hardware version and firmware of the AlphaPi circuit board are constantly being updated. The firmware for this project is a relatively old version, so please be sure to extract the firmware version on your own board and make a backup first! 4 | 5 | Official Website: 6 | 7 | http://lingxi.hetao101.com/alphapi 8 | 9 | 10 | The firmware extracts 4M flash using the following command: 11 | 12 | ```shell 13 | ~/Library/Arduino15/packages/esp32/tools/esptool_py/4.2.1/esptool -p /dev/cu.usbmodem101 read_flash 0 0x400000 flash_contents.bin 14 | ``` 15 | 16 | Disassemble .mpy files using: 17 | ```shell 18 | $ micropython/tools/mpy-tool.py -d ./rootfs/control_board_v1.mpy > ./rootfs/control_board_v1.mpy.txt 19 | ``` 20 | 21 | 22 | ```shell 23 | >>> import esp32 24 | >>> esp32.Partition.find() 25 | [] 26 | ``` 27 | 28 | 29 | ```shell 30 | # flash_read: 31 | esp.flash_read(byte_offset, length_or_buffer)¶ 32 | ``` 33 | 34 | # APIs and Docs 35 | ## control_board_v1.mpy 36 | 37 | ### Functions 38 | 39 | * control_board_v1.led_show_bytes(bytearray) 40 | 41 | Use an I2C extension chip to light up a 5x5 red LED with a parameter of a 5-digit bytearray. This is a synchronization interface. 42 | bytearray([8, 0, 0, 0, 0]) Turn on the light in row 5, column 1, bytearray([16, 0, 0, 0, 0]) Turn on the light in row 4, column 1, Similarly, bytearray([128, 0, 0, 0, 0]) Turn on the light in row 1, column 1, bytearray([255, 255, 255, 255, 255]) Turn on all lights of 5x5. 43 | 44 | ```python 45 | import control_board_v1 46 | # Turn on all the lights in the bottom row 47 | control_board_v1.led_show_bytes(bytearray([8, 8, 8, 8, 8])) 48 | ``` 49 | 50 | * control_board_v1.led_show_bytes_async(bytearray) 51 | As above, this is an asynchronous interface. 52 | ```python 53 | import control_board_v1 54 | control_board_v1.led_show_bytes_async(bytearray([9, 8, 0, 0, 0])) 55 | ``` 56 | 57 | 58 | ### Classes 59 | * control_board_v1.PlayRecordMission 60 | 61 | ### Examples 62 | * 01 5X5 LED(OFFICAL METHODS) 63 | * 02 ACEL 64 | * 03 BUTTON 65 | * 04 5X5 LED(WITH SOURCE CODE) 66 | 67 | 68 | # GPIO correspondence 69 | Known: 70 | button a ————— GPIO 10 71 | button b ————— GPIO 20 72 | button c ————— GPIO 21 73 | I2C (SC7A20 domestic three-axis) -- SDA 6 SCL 7 74 | UART ————— TX 8 RX 9 baudrate 460800 75 | There is also a domestically produced MCU on the board, which mainly achieves audio recording and playback, 5x5 LED functions through UART communication. 76 | Unknown: 77 | P1 ————— GPIO5 78 | P2 ————— GPIO4 79 | At this point, the hardware of alphapi has been basically excavated, and it is indeed the first time to see this method of power supply through screw posts. 80 | TODO 81 | -------------------------------------------------------------------------------- /docs/L9110S-MS规格书.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/docs/L9110S-MS规格书.pdf -------------------------------------------------------------------------------- /example/01_LED(OFFICAL METHODS)/main.py: -------------------------------------------------------------------------------- 1 | import control_board_v1 2 | import actuator_led 3 | import sensor_infrared 4 | import variable 5 | import time 6 | import math 7 | import basic 8 | from basic import DataStruct 9 | from basic import wait_time 10 | 11 | 12 | control_board_v1.led_show_bytes(bytearray([0x00, 0x00, 0x00, 0x00, 0x00])) 13 | soundLoop = control_board_v1.play_record_loop() 14 | 15 | 16 | def Loop1(): 17 | control_board_v1.led_show_bytes_async(bytearray([128, 0, 0, 0, 0])) 18 | my_show_index = control_board_v1.showIndex 19 | time_waiting = wait_time(256) 20 | while next(time_waiting) and my_show_index == control_board_v1.showIndex: 21 | yield True 22 | yield False 23 | 24 | 25 | loop1 = Loop1() 26 | loop1HasNext = True 27 | 28 | 29 | while True: 30 | control_board_v1.UpdateButtonStatus() 31 | next(soundLoop) 32 | if loop1HasNext: 33 | loop1HasNext = next(loop1) 34 | 35 | 36 | -------------------------------------------------------------------------------- /example/01_LED(OFFICAL METHODS)/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/01_LED(OFFICAL METHODS)/sample.png -------------------------------------------------------------------------------- /example/02_ACCEL/main.py: -------------------------------------------------------------------------------- 1 | from machine import Pin,SoftI2C,I2C 2 | import time 3 | 4 | sc7a20=I2C(scl=Pin(7),sda=Pin(6),freq=500000) 5 | print(sc7a20.scan()) 6 | check=sc7a20.readfrom_mem(24,0x0f,1) #chip_id=0x11 7 | print(check) 8 | sc7a20.writeto_mem(24,0x20,b'\x57') #set to 100hz 9 | 10 | def transdata(l,m): 11 | a=int.from_bytes(m,'big') 12 | b=int.from_bytes(l,'big') 13 | temp=a<<8|b 14 | temp=temp>>4 15 | temp=temp&0x0fff 16 | if temp&0x0800: 17 | temp=temp&0x07ff 18 | temp=~temp 19 | temp+=1 20 | temp=temp&0x07ff 21 | temp=-temp 22 | return temp 23 | 24 | def read_accel(): 25 | x1=sc7a20.readfrom_mem(24,0x28,1) 26 | x2=sc7a20.readfrom_mem(24,0x29,1) 27 | y1=sc7a20.readfrom_mem(24,0x2a,1) 28 | y2=sc7a20.readfrom_mem(24,0x2b,1) 29 | z1=sc7a20.readfrom_mem(24,0x2c,1) 30 | z2=sc7a20.readfrom_mem(24,0x2d,1) 31 | x=transdata(x1,x2) 32 | y=transdata(y1,y2) 33 | z=transdata(z1,z2) 34 | return x,y,z 35 | 36 | while 1: 37 | x,y,z=read_accel() 38 | print('x:%d|y:%d|z:%d'%(x,y,z)) 39 | time.sleep_ms(100) 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/03_BUTTON/main.py: -------------------------------------------------------------------------------- 1 | from machine import Pin,SoftI2C,I2C 2 | import time 3 | 4 | class Button: 5 | def __init__(self, pin): 6 | 7 | self.pin = Pin(pin, Pin.IN) 8 | 9 | def get_presses(self, delay = 1): 10 | last_time, last_state, presses = time.time(), 0, 0 11 | while time.time() < last_time + delay: 12 | time.sleep_ms(50) 13 | if last_state == 0 and self.pin.value() == 1: 14 | last_state = 1 15 | if last_state == 1 and self.pin.value() == 0: 16 | last_state, presses = 0, presses + 1 17 | return presses 18 | 19 | def is_pressed(self, flag = 0): 20 | return self.pin.value() == flag 21 | 22 | def was_pressed(self, flag = 1): 23 | last_state = self.pin.value() 24 | if flag: 25 | if not last_state: 26 | return False 27 | else: 28 | while self.pin.value(): 29 | time.sleep_ms(10) 30 | return True 31 | else: 32 | if last_state: 33 | return False 34 | else: 35 | while not self.pin.value(): 36 | time.sleep_ms(10) 37 | return True 38 | 39 | def irq(self, handler, trigger): 40 | self.pin.irq(handler = handler, trigger = trigger) 41 | 42 | button_a=Button(10) 43 | button_b=Button(20) 44 | button_c=Button(21) 45 | 46 | 47 | while 1: 48 | time.sleep(0.01) 49 | if button_a.was_pressed(): 50 | print('button a') 51 | if button_b.was_pressed(): 52 | print('button b') 53 | if button_c.was_pressed(): 54 | print('button c') 55 | 56 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM espressif/idf 2 | 3 | ARG DEBIAN_FRONTEND=nointeractive 4 | ARG CONTAINER_USER=esp 5 | ARG USER_UID=1050 6 | ARG USER_GID=$USER_UID 7 | 8 | RUN apt-get update \ 9 | && apt install -y -q \ 10 | cmake \ 11 | git \ 12 | libglib2.0-0 \ 13 | libnuma1 \ 14 | libpixman-1-0 \ 15 | && rm -rf /var/lib/apt/lists/* 16 | 17 | # QEMU 18 | ENV QEMU_REL=esp_develop_8.2.0_20240122 19 | ENV QEMU_SHA256=e7c72ef5705ad1444d391711088c8717fc89f42e9bf6d1487f9c2a326b8cfa83 20 | ENV QEMU_DIST=qemu-xtensa-softmmu-${QEMU_REL}-x86_64-linux-gnu.tar.xz 21 | ENV QEMU_URL=https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/${QEMU_DIST} 22 | 23 | ENV LC_ALL=C.UTF-8 24 | ENV LANG=C.UTF-8 25 | 26 | RUN wget --no-verbose ${QEMU_URL} \ 27 | && echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \ 28 | && tar -xf $QEMU_DIST -C /opt \ 29 | && rm ${QEMU_DIST} 30 | 31 | ENV PATH=/opt/qemu/bin:${PATH} 32 | 33 | RUN groupadd --gid $USER_GID $CONTAINER_USER \ 34 | && adduser --uid $USER_UID --gid $USER_GID --disabled-password --gecos "" ${CONTAINER_USER} \ 35 | && usermod -a -G root $CONTAINER_USER && usermod -a -G dialout $CONTAINER_USER 36 | 37 | RUN chmod -R 775 /opt/esp/python_env/ 38 | 39 | USER ${CONTAINER_USER} 40 | ENV USER=${CONTAINER_USER} 41 | WORKDIR /home/${CONTAINER_USER} 42 | 43 | RUN echo "source /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc 44 | 45 | ENTRYPOINT [ "/opt/esp/entrypoint.sh" ] 46 | 47 | CMD ["/bin/bash", "-c"] -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ESP-IDF QEMU", 3 | "build": { 4 | "dockerfile": "Dockerfile" 5 | }, 6 | "customizations": { 7 | "vscode": { 8 | "settings": { 9 | "terminal.integrated.defaultProfile.linux": "bash", 10 | "idf.espIdfPath": "/opt/esp/idf", 11 | "idf.customExtraPaths": "", 12 | "idf.pythonBinPath": "/opt/esp/python_env/idf5.4_py3.12_env/bin/python", 13 | "idf.toolsPath": "/opt/esp", 14 | "idf.gitPath": "/usr/bin/git" 15 | }, 16 | "extensions": [ 17 | "espressif.esp-idf-extension" 18 | ] 19 | }, 20 | "codespaces": { 21 | "settings": { 22 | "terminal.integrated.defaultProfile.linux": "bash", 23 | "idf.espIdfPath": "/opt/esp/idf", 24 | "idf.customExtraPaths": "", 25 | "idf.pythonBinPath": "/opt/esp/python_env/idf5.4_py3.12_env/bin/python", 26 | "idf.toolsPath": "/opt/esp", 27 | "idf.gitPath": "/usr/bin/git" 28 | }, 29 | "extensions": [ 30 | "espressif.esp-idf-extension", 31 | "espressif.esp-idf-web" 32 | ] 33 | } 34 | }, 35 | "runArgs": ["--privileged"] 36 | } -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "ESP-IDF", 5 | "compilerPath": "${config:idf.toolsPathWin}\\tools\\riscv32-esp-elf\\esp-13.2.0_20240530\\riscv32-esp-elf\\bin\\riscv32-esp-elf-gcc.exe", 6 | "compileCommands": "${config:idf.buildPath}/compile_commands.json", 7 | "includePath": [ 8 | "${config:idf.espIdfPath}/components/**", 9 | "${config:idf.espIdfPathWin}/components/**", 10 | "${workspaceFolder}/**" 11 | ], 12 | "browse": { 13 | "path": [ 14 | "${config:idf.espIdfPath}/components", 15 | "${config:idf.espIdfPathWin}/components", 16 | "${workspaceFolder}" 17 | ], 18 | "limitSymbolsToIncludedHeaders": true 19 | } 20 | } 21 | ], 22 | "version": 4 23 | } 24 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "gdbtarget", 6 | "request": "attach", 7 | "name": "Eclipse CDT GDB Adapter" 8 | }, 9 | { 10 | "type": "espidf", 11 | "name": "Launch", 12 | "request": "launch" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.intelliSenseEngine": "default", 3 | "idf.adapterTargetName": "esp32c3", 4 | "idf.customExtraPaths": "C:\\esp\\Espressif\\tools\\xtensa-esp-elf-gdb\\14.2_20240403\\xtensa-esp-elf-gdb\\bin;C:\\esp\\Espressif\\tools\\riscv32-esp-elf-gdb\\14.2_20240403\\riscv32-esp-elf-gdb\\bin;C:\\esp\\Espressif\\tools\\xtensa-esp-elf\\esp-13.2.0_20240530\\xtensa-esp-elf\\bin;C:\\esp\\Espressif\\tools\\riscv32-esp-elf\\esp-13.2.0_20240530\\riscv32-esp-elf\\bin;C:\\esp\\Espressif\\tools\\esp32ulp-elf\\2.38_20240113\\esp32ulp-elf\\bin;C:\\esp\\Espressif\\tools\\cmake\\3.24.0\\bin;C:\\esp\\Espressif\\tools\\openocd-esp32\\v0.12.0-esp32-20240318\\openocd-esp32\\bin;C:\\esp\\Espressif\\tools\\ninja\\1.11.1;C:\\esp\\Espressif\\tools\\idf-exe\\1.0.3;C:\\esp\\Espressif\\tools\\ccache\\4.8\\ccache-4.8-windows-x86_64;C:\\esp\\Espressif\\tools\\dfu-util\\0.11\\dfu-util-0.11-win64;C:\\esp\\Espressif\\tools\\esp-rom-elfs\\20240305", 5 | "idf.customExtraVars": { 6 | "OPENOCD_SCRIPTS": "C:\\esp\\Espressif\\tools\\openocd-esp32\\v0.12.0-esp32-20240318/openocd-esp32/share/openocd/scripts", 7 | "IDF_CCACHE_ENABLE": "1", 8 | "ESP_ROM_ELF_DIR": "C:\\esp\\Espressif\\tools\\esp-rom-elfs\\20240305/" 9 | }, 10 | "idf.espIdfPathWin": "C:/esp/Espressif/frameworks/esp-idf-v5.3/", 11 | "idf.openOcdConfigs": [ 12 | "board/esp32c3-builtin.cfg" 13 | ], 14 | "idf.portWin": "COM6", 15 | "idf.pythonBinPathWin": "C:/esp/Espressif/python_env/idf5.3_py3.11_env/Scripts/python.exe", 16 | "idf.toolsPathWin": "C:\\esp\\Espressif" 17 | } 18 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Build - Build project", 6 | "type": "shell", 7 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py build", 8 | "windows": { 9 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py build", 10 | "options": { 11 | "env": { 12 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 13 | } 14 | } 15 | }, 16 | "options": { 17 | "env": { 18 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 19 | } 20 | }, 21 | "problemMatcher": [ 22 | { 23 | "owner": "cpp", 24 | "fileLocation": [ 25 | "autoDetect", 26 | "${workspaceFolder}" 27 | ], 28 | "pattern": { 29 | "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", 30 | "file": 1, 31 | "line": 2, 32 | "column": 3, 33 | "severity": 4, 34 | "message": 5 35 | } 36 | } 37 | ], 38 | "group": { 39 | "kind": "build", 40 | "isDefault": true 41 | } 42 | }, 43 | { 44 | "label": "Set ESP-IDF Target", 45 | "type": "shell", 46 | "command": "${command:espIdf.setTarget}", 47 | "problemMatcher": { 48 | "owner": "cpp", 49 | "fileLocation": [ 50 | "autoDetect", 51 | "${workspaceFolder}" 52 | ], 53 | "pattern": { 54 | "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", 55 | "file": 1, 56 | "line": 2, 57 | "column": 3, 58 | "severity": 4, 59 | "message": 5 60 | } 61 | } 62 | }, 63 | { 64 | "label": "Clean - Clean the project", 65 | "type": "shell", 66 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py fullclean", 67 | "windows": { 68 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py fullclean", 69 | "options": { 70 | "env": { 71 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 72 | } 73 | } 74 | }, 75 | "options": { 76 | "env": { 77 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 78 | } 79 | }, 80 | "problemMatcher": [ 81 | { 82 | "owner": "cpp", 83 | "fileLocation": [ 84 | "autoDetect", 85 | "${workspaceFolder}" 86 | ], 87 | "pattern": { 88 | "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", 89 | "file": 1, 90 | "line": 2, 91 | "column": 3, 92 | "severity": 4, 93 | "message": 5 94 | } 95 | } 96 | ] 97 | }, 98 | { 99 | "label": "Flash - Flash the device", 100 | "type": "shell", 101 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.flashBaudRate} flash", 102 | "windows": { 103 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py flash -p ${config:idf.portWin} -b ${config:idf.flashBaudRate}", 104 | "options": { 105 | "env": { 106 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 107 | } 108 | } 109 | }, 110 | "options": { 111 | "env": { 112 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 113 | } 114 | }, 115 | "problemMatcher": [ 116 | { 117 | "owner": "cpp", 118 | "fileLocation": [ 119 | "autoDetect", 120 | "${workspaceFolder}" 121 | ], 122 | "pattern": { 123 | "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", 124 | "file": 1, 125 | "line": 2, 126 | "column": 3, 127 | "severity": 4, 128 | "message": 5 129 | } 130 | } 131 | ] 132 | }, 133 | { 134 | "label": "Monitor: Start the monitor", 135 | "type": "shell", 136 | "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} monitor", 137 | "windows": { 138 | "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py -p ${config:idf.portWin} monitor", 139 | "options": { 140 | "env": { 141 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 142 | } 143 | } 144 | }, 145 | "options": { 146 | "env": { 147 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 148 | } 149 | }, 150 | "problemMatcher": [ 151 | { 152 | "owner": "cpp", 153 | "fileLocation": [ 154 | "autoDetect", 155 | "${workspaceFolder}" 156 | ], 157 | "pattern": { 158 | "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", 159 | "file": 1, 160 | "line": 2, 161 | "column": 3, 162 | "severity": 4, 163 | "message": 5 164 | } 165 | } 166 | ], 167 | "dependsOn": "Flash - Flash the device" 168 | }, 169 | { 170 | "label": "OpenOCD: Start openOCD", 171 | "type": "shell", 172 | "presentation": { 173 | "echo": true, 174 | "reveal": "never", 175 | "focus": false, 176 | "panel": "new" 177 | }, 178 | "command": "openocd -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}", 179 | "windows": { 180 | "command": "openocd.exe -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}", 181 | "options": { 182 | "env": { 183 | "PATH": "${env:PATH};${config:idf.customExtraPaths}" 184 | } 185 | } 186 | }, 187 | "options": { 188 | "env": { 189 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}" 190 | } 191 | }, 192 | "problemMatcher": { 193 | "owner": "cpp", 194 | "fileLocation": [ 195 | "autoDetect", 196 | "${workspaceFolder}" 197 | ], 198 | "pattern": { 199 | "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", 200 | "file": 1, 201 | "line": 2, 202 | "column": 3, 203 | "severity": 4, 204 | "message": 5 205 | } 206 | } 207 | }, 208 | { 209 | "label": "adapter", 210 | "type": "shell", 211 | "command": "${config:idf.pythonBinPath}", 212 | "isBackground": true, 213 | "options": { 214 | "env": { 215 | "PATH": "${env:PATH}:${config:idf.customExtraPaths}", 216 | "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter" 217 | } 218 | }, 219 | "problemMatcher": { 220 | "background": { 221 | "beginsPattern": "\bDEBUG_ADAPTER_STARTED\b", 222 | "endsPattern": "DEBUG_ADAPTER_READY2CONNECT", 223 | "activeOnStart": true 224 | }, 225 | "pattern": { 226 | "regexp": "(\\d+)-(\\d+)-(\\d+)\\s(\\d+):(\\d+):(\\d+),(\\d+)\\s-(.+)\\s(ERROR)", 227 | "file": 8, 228 | "line": 2, 229 | "column": 3, 230 | "severity": 4, 231 | "message": 9 232 | } 233 | }, 234 | "args": [ 235 | "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter_main.py", 236 | "-e", 237 | "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf", 238 | "-s", 239 | "$OPENOCD_SCRIPTS", 240 | "-dn", 241 | "esp32", 242 | "-om", 243 | "connect_to_instance", 244 | "-t", 245 | "xtensa-esp32-elf-" 246 | 247 | ], 248 | "windows": { 249 | "command": "${config:idf.pythonBinPathWin}", 250 | "options": { 251 | "env": { 252 | "PATH": "${env:PATH};${config:idf.customExtraPaths}", 253 | "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter" 254 | } 255 | } 256 | } 257 | } 258 | ] 259 | } -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's CMakeLists 2 | # in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.16) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | project(alphapi_LED) 7 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/README.md: -------------------------------------------------------------------------------- 1 | # 闪烁 LED 示例 2 | 3 | 这是一个如何使用 alphapi LED 的简单示例。 4 | 5 | ## 控制LED 6 | 7 | alphapi LED 是一个通过 UART 控制的 LED 8 | 9 | ``` 10 | GPIO: TX:8, RX:9 11 | ``` 12 | 13 | ## 方法 14 | 15 | alphapi LED 具有以下方法: 16 | 17 | 1、alphapi_display_init() - 初始化LED 18 | 19 | 2、led_show_matrix() - 显示矩阵 20 | 21 | ## 效果 22 | 23 | 在本项目示例中,实现的效果如下: 24 | ![LED](./images/pic1.jpg "Markdown") 25 | ![LED](./images/pic2.jpg "Markdown") -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/README_EN.md: -------------------------------------------------------------------------------- 1 | # Sparkling Heart Example 2 | 3 | This is a simple example of how to use the alphapi LED in your own projects. 4 | 5 | ## Controlling the LED 6 | 7 | The alphapi LED is a simple LED that can be controlled by UART. 8 | GPIO: TX: 8, RX: 9 9 | 10 | ## Functions 11 | 12 | The alphapi LED has the following functions: 13 | 1. alphapi_display_init() - Initialize the LED 14 | 2. led_show_matrix() - Display a matrix 15 | 16 | ## Example 17 | 18 | In this project example, the achieved effect is as follows: 19 | ![LED](./images/pic1.jpg "Markdown") 20 | ![LED](./images/pic2.jpg "Markdown") -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeASMCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_ASM_COMPILER "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe") 2 | set(CMAKE_ASM_COMPILER_ARG1 "") 3 | set(CMAKE_AR "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ar.exe") 4 | set(CMAKE_ASM_COMPILER_AR "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc-ar.exe") 5 | set(CMAKE_RANLIB "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ranlib.exe") 6 | set(CMAKE_ASM_COMPILER_RANLIB "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc-ranlib.exe") 7 | set(CMAKE_LINKER "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ld.exe") 8 | set(CMAKE_MT "") 9 | set(CMAKE_ASM_COMPILER_LOADED 1) 10 | set(CMAKE_ASM_COMPILER_ID "GNU") 11 | set(CMAKE_ASM_COMPILER_VERSION "") 12 | set(CMAKE_ASM_COMPILER_ENV_VAR "ASM") 13 | 14 | 15 | 16 | 17 | set(CMAKE_ASM_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 18 | set(CMAKE_ASM_LINKER_PREFERENCE 0) 19 | 20 | 21 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "13.2.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") 8 | set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") 9 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") 10 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 11 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 12 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 13 | set(CMAKE_C17_COMPILE_FEATURES "c_std_17") 14 | set(CMAKE_C23_COMPILE_FEATURES "c_std_23") 15 | 16 | set(CMAKE_C_PLATFORM_ID "") 17 | set(CMAKE_C_SIMULATE_ID "") 18 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 19 | set(CMAKE_C_SIMULATE_VERSION "") 20 | 21 | 22 | 23 | 24 | set(CMAKE_AR "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ar.exe") 25 | set(CMAKE_C_COMPILER_AR "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc-ar.exe") 26 | set(CMAKE_RANLIB "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ranlib.exe") 27 | set(CMAKE_C_COMPILER_RANLIB "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc-ranlib.exe") 28 | set(CMAKE_LINKER "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ld.exe") 29 | set(CMAKE_MT "") 30 | set(CMAKE_COMPILER_IS_GNUCC 1) 31 | set(CMAKE_C_COMPILER_LOADED 1) 32 | set(CMAKE_C_COMPILER_WORKS TRUE) 33 | set(CMAKE_C_ABI_COMPILED TRUE) 34 | 35 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 36 | 37 | set(CMAKE_C_COMPILER_ID_RUN 1) 38 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 39 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 40 | set(CMAKE_C_LINKER_PREFERENCE 10) 41 | 42 | # Save compiler ABI information. 43 | set(CMAKE_C_SIZEOF_DATA_PTR "4") 44 | set(CMAKE_C_COMPILER_ABI "ELF") 45 | set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") 46 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 47 | 48 | if(CMAKE_C_SIZEOF_DATA_PTR) 49 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 50 | endif() 51 | 52 | if(CMAKE_C_COMPILER_ABI) 53 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 54 | endif() 55 | 56 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 57 | set(CMAKE_LIBRARY_ARCHITECTURE "") 58 | endif() 59 | 60 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 61 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 62 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 63 | endif() 64 | 65 | 66 | 67 | 68 | 69 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0/include;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0/include-fixed;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/include") 70 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;c;nosys;c;gcc;gcc;c;nosys") 71 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0/rv32imc_zicsr_zifencei/ilp32;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/lib") 72 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 73 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-g++.exe") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "13.2.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17") 8 | set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") 9 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") 10 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 11 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 12 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 13 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 14 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 15 | set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") 16 | 17 | set(CMAKE_CXX_PLATFORM_ID "") 18 | set(CMAKE_CXX_SIMULATE_ID "") 19 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 20 | set(CMAKE_CXX_SIMULATE_VERSION "") 21 | 22 | 23 | 24 | 25 | set(CMAKE_AR "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ar.exe") 26 | set(CMAKE_CXX_COMPILER_AR "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc-ar.exe") 27 | set(CMAKE_RANLIB "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ranlib.exe") 28 | set(CMAKE_CXX_COMPILER_RANLIB "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc-ranlib.exe") 29 | set(CMAKE_LINKER "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-ld.exe") 30 | set(CMAKE_MT "") 31 | set(CMAKE_COMPILER_IS_GNUCXX 1) 32 | set(CMAKE_CXX_COMPILER_LOADED 1) 33 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 34 | set(CMAKE_CXX_ABI_COMPILED TRUE) 35 | 36 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 37 | 38 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 39 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm) 40 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 41 | 42 | foreach (lang C OBJC OBJCXX) 43 | if (CMAKE_${lang}_COMPILER_ID_RUN) 44 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 45 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 46 | endforeach() 47 | endif() 48 | endforeach() 49 | 50 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 51 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 52 | 53 | # Save compiler ABI information. 54 | set(CMAKE_CXX_SIZEOF_DATA_PTR "4") 55 | set(CMAKE_CXX_COMPILER_ABI "ELF") 56 | set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") 57 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 58 | 59 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 60 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 61 | endif() 62 | 63 | if(CMAKE_CXX_COMPILER_ABI) 64 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 65 | endif() 66 | 67 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 68 | set(CMAKE_LIBRARY_ARCHITECTURE "") 69 | endif() 70 | 71 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 72 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 73 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 74 | endif() 75 | 76 | 77 | 78 | 79 | 80 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/include/c++/13.2.0;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/include/c++/13.2.0/riscv32-esp-elf/rv32imc_zicsr_zifencei/ilp32;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/include/c++/13.2.0/backward;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0/include;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0/include-fixed;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/include") 81 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc;c;nosys;c;gcc;gcc;c;nosys") 82 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0/rv32imc_zicsr_zifencei/ilp32;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc/riscv32-esp-elf/13.2.0;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/lib/gcc;C:/esp/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/riscv32-esp-elf/lib") 83 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 84 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Windows-10.0.19045") 2 | set(CMAKE_HOST_SYSTEM_NAME "Windows") 3 | set(CMAKE_HOST_SYSTEM_VERSION "10.0.19045") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") 5 | 6 | include("C:/esp/Espressif/frameworks/esp-idf-v5.3/tools/cmake/toolchain-esp32c3.cmake") 7 | 8 | set(CMAKE_SYSTEM "Generic") 9 | set(CMAKE_SYSTEM_NAME "Generic") 10 | set(CMAKE_SYSTEM_VERSION "") 11 | set(CMAKE_SYSTEM_PROCESSOR "") 12 | 13 | set(CMAKE_CROSSCOMPILING "TRUE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CompilerIdC/CMakeCCompilerId.c: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | # error "A C++ compiler has been selected for C." 3 | #endif 4 | 5 | #if defined(__18CXX) 6 | # define ID_VOID_MAIN 7 | #endif 8 | #if defined(__CLASSIC_C__) 9 | /* cv-qualifiers did not exist in K&R C */ 10 | # define const 11 | # define volatile 12 | #endif 13 | 14 | #if !defined(__has_include) 15 | /* If the compiler does not have __has_include, pretend the answer is 16 | always no. */ 17 | # define __has_include(x) 0 18 | #endif 19 | 20 | 21 | /* Version number components: V=Version, R=Revision, P=Patch 22 | Version date components: YYYY=Year, MM=Month, DD=Day */ 23 | 24 | #if defined(__INTEL_COMPILER) || defined(__ICC) 25 | # define COMPILER_ID "Intel" 26 | # if defined(_MSC_VER) 27 | # define SIMULATE_ID "MSVC" 28 | # endif 29 | # if defined(__GNUC__) 30 | # define SIMULATE_ID "GNU" 31 | # endif 32 | /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, 33 | except that a few beta releases use the old format with V=2021. */ 34 | # if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 35 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 36 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 37 | # if defined(__INTEL_COMPILER_UPDATE) 38 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 39 | # else 40 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 41 | # endif 42 | # else 43 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) 44 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) 45 | /* The third version component from --version is an update index, 46 | but no macro is provided for it. */ 47 | # define COMPILER_VERSION_PATCH DEC(0) 48 | # endif 49 | # if defined(__INTEL_COMPILER_BUILD_DATE) 50 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 51 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 52 | # endif 53 | # if defined(_MSC_VER) 54 | /* _MSC_VER = VVRR */ 55 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 56 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 57 | # endif 58 | # if defined(__GNUC__) 59 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 60 | # elif defined(__GNUG__) 61 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 62 | # endif 63 | # if defined(__GNUC_MINOR__) 64 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 65 | # endif 66 | # if defined(__GNUC_PATCHLEVEL__) 67 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 68 | # endif 69 | 70 | #elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) 71 | # define COMPILER_ID "IntelLLVM" 72 | #if defined(_MSC_VER) 73 | # define SIMULATE_ID "MSVC" 74 | #endif 75 | #if defined(__GNUC__) 76 | # define SIMULATE_ID "GNU" 77 | #endif 78 | /* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and 79 | * later. Look for 6 digit vs. 8 digit version number to decide encoding. 80 | * VVVV is no smaller than the current year when a version is released. 81 | */ 82 | #if __INTEL_LLVM_COMPILER < 1000000L 83 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) 84 | # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) 85 | # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) 86 | #else 87 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) 88 | # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) 89 | # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) 90 | #endif 91 | #if defined(_MSC_VER) 92 | /* _MSC_VER = VVRR */ 93 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 94 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 95 | #endif 96 | #if defined(__GNUC__) 97 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 98 | #elif defined(__GNUG__) 99 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 100 | #endif 101 | #if defined(__GNUC_MINOR__) 102 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 103 | #endif 104 | #if defined(__GNUC_PATCHLEVEL__) 105 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 106 | #endif 107 | 108 | #elif defined(__PATHCC__) 109 | # define COMPILER_ID "PathScale" 110 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 111 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 112 | # if defined(__PATHCC_PATCHLEVEL__) 113 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 114 | # endif 115 | 116 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 117 | # define COMPILER_ID "Embarcadero" 118 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 119 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 120 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 121 | 122 | #elif defined(__BORLANDC__) 123 | # define COMPILER_ID "Borland" 124 | /* __BORLANDC__ = 0xVRR */ 125 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 126 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 127 | 128 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 129 | # define COMPILER_ID "Watcom" 130 | /* __WATCOMC__ = VVRR */ 131 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 132 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 133 | # if (__WATCOMC__ % 10) > 0 134 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 135 | # endif 136 | 137 | #elif defined(__WATCOMC__) 138 | # define COMPILER_ID "OpenWatcom" 139 | /* __WATCOMC__ = VVRP + 1100 */ 140 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 141 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 142 | # if (__WATCOMC__ % 10) > 0 143 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 144 | # endif 145 | 146 | #elif defined(__SUNPRO_C) 147 | # define COMPILER_ID "SunPro" 148 | # if __SUNPRO_C >= 0x5100 149 | /* __SUNPRO_C = 0xVRRP */ 150 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) 151 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) 152 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 153 | # else 154 | /* __SUNPRO_CC = 0xVRP */ 155 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) 156 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) 157 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 158 | # endif 159 | 160 | #elif defined(__HP_cc) 161 | # define COMPILER_ID "HP" 162 | /* __HP_cc = VVRRPP */ 163 | # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) 164 | # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) 165 | # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) 166 | 167 | #elif defined(__DECC) 168 | # define COMPILER_ID "Compaq" 169 | /* __DECC_VER = VVRRTPPPP */ 170 | # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) 171 | # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) 172 | # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) 173 | 174 | #elif defined(__IBMC__) && defined(__COMPILER_VER__) 175 | # define COMPILER_ID "zOS" 176 | /* __IBMC__ = VRP */ 177 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 178 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 179 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 180 | 181 | #elif defined(__open_xl__) && defined(__clang__) 182 | # define COMPILER_ID "IBMClang" 183 | # define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) 184 | # define COMPILER_VERSION_MINOR DEC(__open_xl_release__) 185 | # define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) 186 | # define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) 187 | 188 | 189 | #elif defined(__ibmxl__) && defined(__clang__) 190 | # define COMPILER_ID "XLClang" 191 | # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) 192 | # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) 193 | # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) 194 | # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) 195 | 196 | 197 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 198 | # define COMPILER_ID "XL" 199 | /* __IBMC__ = VRP */ 200 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 201 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 202 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 203 | 204 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 205 | # define COMPILER_ID "VisualAge" 206 | /* __IBMC__ = VRP */ 207 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 208 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 209 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 210 | 211 | #elif defined(__NVCOMPILER) 212 | # define COMPILER_ID "NVHPC" 213 | # define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) 214 | # define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) 215 | # if defined(__NVCOMPILER_PATCHLEVEL__) 216 | # define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) 217 | # endif 218 | 219 | #elif defined(__PGI) 220 | # define COMPILER_ID "PGI" 221 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 222 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 223 | # if defined(__PGIC_PATCHLEVEL__) 224 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 225 | # endif 226 | 227 | #elif defined(_CRAYC) 228 | # define COMPILER_ID "Cray" 229 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 230 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 231 | 232 | #elif defined(__TI_COMPILER_VERSION__) 233 | # define COMPILER_ID "TI" 234 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 235 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 236 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 237 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 238 | 239 | #elif defined(__CLANG_FUJITSU) 240 | # define COMPILER_ID "FujitsuClang" 241 | # define COMPILER_VERSION_MAJOR DEC(__FCC_major__) 242 | # define COMPILER_VERSION_MINOR DEC(__FCC_minor__) 243 | # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) 244 | # define COMPILER_VERSION_INTERNAL_STR __clang_version__ 245 | 246 | 247 | #elif defined(__FUJITSU) 248 | # define COMPILER_ID "Fujitsu" 249 | # if defined(__FCC_version__) 250 | # define COMPILER_VERSION __FCC_version__ 251 | # elif defined(__FCC_major__) 252 | # define COMPILER_VERSION_MAJOR DEC(__FCC_major__) 253 | # define COMPILER_VERSION_MINOR DEC(__FCC_minor__) 254 | # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) 255 | # endif 256 | # if defined(__fcc_version) 257 | # define COMPILER_VERSION_INTERNAL DEC(__fcc_version) 258 | # elif defined(__FCC_VERSION) 259 | # define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) 260 | # endif 261 | 262 | 263 | #elif defined(__ghs__) 264 | # define COMPILER_ID "GHS" 265 | /* __GHS_VERSION_NUMBER = VVVVRP */ 266 | # ifdef __GHS_VERSION_NUMBER 267 | # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) 268 | # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) 269 | # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) 270 | # endif 271 | 272 | #elif defined(__TINYC__) 273 | # define COMPILER_ID "TinyCC" 274 | 275 | #elif defined(__BCC__) 276 | # define COMPILER_ID "Bruce" 277 | 278 | #elif defined(__SCO_VERSION__) 279 | # define COMPILER_ID "SCO" 280 | 281 | #elif defined(__ARMCC_VERSION) && !defined(__clang__) 282 | # define COMPILER_ID "ARMCC" 283 | #if __ARMCC_VERSION >= 1000000 284 | /* __ARMCC_VERSION = VRRPPPP */ 285 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 286 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 287 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 288 | #else 289 | /* __ARMCC_VERSION = VRPPPP */ 290 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 291 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 292 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 293 | #endif 294 | 295 | 296 | #elif defined(__clang__) && defined(__apple_build_version__) 297 | # define COMPILER_ID "AppleClang" 298 | # if defined(_MSC_VER) 299 | # define SIMULATE_ID "MSVC" 300 | # endif 301 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 302 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 303 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 304 | # if defined(_MSC_VER) 305 | /* _MSC_VER = VVRR */ 306 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 307 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 308 | # endif 309 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 310 | 311 | #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) 312 | # define COMPILER_ID "ARMClang" 313 | # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) 314 | # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) 315 | # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) 316 | # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) 317 | 318 | #elif defined(__clang__) 319 | # define COMPILER_ID "Clang" 320 | # if defined(_MSC_VER) 321 | # define SIMULATE_ID "MSVC" 322 | # endif 323 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 324 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 325 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 326 | # if defined(_MSC_VER) 327 | /* _MSC_VER = VVRR */ 328 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 329 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 330 | # endif 331 | 332 | #elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) 333 | # define COMPILER_ID "LCC" 334 | # define COMPILER_VERSION_MAJOR DEC(1) 335 | # if defined(__LCC__) 336 | # define COMPILER_VERSION_MINOR DEC(__LCC__- 100) 337 | # endif 338 | # if defined(__LCC_MINOR__) 339 | # define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) 340 | # endif 341 | # if defined(__GNUC__) && defined(__GNUC_MINOR__) 342 | # define SIMULATE_ID "GNU" 343 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 344 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 345 | # if defined(__GNUC_PATCHLEVEL__) 346 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 347 | # endif 348 | # endif 349 | 350 | #elif defined(__GNUC__) 351 | # define COMPILER_ID "GNU" 352 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 353 | # if defined(__GNUC_MINOR__) 354 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 355 | # endif 356 | # if defined(__GNUC_PATCHLEVEL__) 357 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 358 | # endif 359 | 360 | #elif defined(_MSC_VER) 361 | # define COMPILER_ID "MSVC" 362 | /* _MSC_VER = VVRR */ 363 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 364 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 365 | # if defined(_MSC_FULL_VER) 366 | # if _MSC_VER >= 1400 367 | /* _MSC_FULL_VER = VVRRPPPPP */ 368 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 369 | # else 370 | /* _MSC_FULL_VER = VVRRPPPP */ 371 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 372 | # endif 373 | # endif 374 | # if defined(_MSC_BUILD) 375 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 376 | # endif 377 | 378 | #elif defined(_ADI_COMPILER) 379 | # define COMPILER_ID "ADSP" 380 | #if defined(__VERSIONNUM__) 381 | /* __VERSIONNUM__ = 0xVVRRPPTT */ 382 | # define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) 383 | # define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) 384 | # define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) 385 | # define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) 386 | #endif 387 | 388 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 389 | # define COMPILER_ID "IAR" 390 | # if defined(__VER__) && defined(__ICCARM__) 391 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) 392 | # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) 393 | # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) 394 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 395 | # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) 396 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) 397 | # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) 398 | # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) 399 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 400 | # endif 401 | 402 | #elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) 403 | # define COMPILER_ID "SDCC" 404 | # if defined(__SDCC_VERSION_MAJOR) 405 | # define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) 406 | # define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) 407 | # define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) 408 | # else 409 | /* SDCC = VRP */ 410 | # define COMPILER_VERSION_MAJOR DEC(SDCC/100) 411 | # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) 412 | # define COMPILER_VERSION_PATCH DEC(SDCC % 10) 413 | # endif 414 | 415 | 416 | /* These compilers are either not known or too old to define an 417 | identification macro. Try to identify the platform and guess that 418 | it is the native compiler. */ 419 | #elif defined(__hpux) || defined(__hpua) 420 | # define COMPILER_ID "HP" 421 | 422 | #else /* unknown compiler */ 423 | # define COMPILER_ID "" 424 | #endif 425 | 426 | /* Construct the string literal in pieces to prevent the source from 427 | getting matched. Store it in a pointer rather than an array 428 | because some compilers will just produce instructions to fill the 429 | array rather than assigning a pointer to a static array. */ 430 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 431 | #ifdef SIMULATE_ID 432 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 433 | #endif 434 | 435 | #ifdef __QNXNTO__ 436 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 437 | #endif 438 | 439 | #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) 440 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 441 | #endif 442 | 443 | #define STRINGIFY_HELPER(X) #X 444 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 445 | 446 | /* Identify known platforms by name. */ 447 | #if defined(__linux) || defined(__linux__) || defined(linux) 448 | # define PLATFORM_ID "Linux" 449 | 450 | #elif defined(__MSYS__) 451 | # define PLATFORM_ID "MSYS" 452 | 453 | #elif defined(__CYGWIN__) 454 | # define PLATFORM_ID "Cygwin" 455 | 456 | #elif defined(__MINGW32__) 457 | # define PLATFORM_ID "MinGW" 458 | 459 | #elif defined(__APPLE__) 460 | # define PLATFORM_ID "Darwin" 461 | 462 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 463 | # define PLATFORM_ID "Windows" 464 | 465 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 466 | # define PLATFORM_ID "FreeBSD" 467 | 468 | #elif defined(__NetBSD__) || defined(__NetBSD) 469 | # define PLATFORM_ID "NetBSD" 470 | 471 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 472 | # define PLATFORM_ID "OpenBSD" 473 | 474 | #elif defined(__sun) || defined(sun) 475 | # define PLATFORM_ID "SunOS" 476 | 477 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 478 | # define PLATFORM_ID "AIX" 479 | 480 | #elif defined(__hpux) || defined(__hpux__) 481 | # define PLATFORM_ID "HP-UX" 482 | 483 | #elif defined(__HAIKU__) 484 | # define PLATFORM_ID "Haiku" 485 | 486 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 487 | # define PLATFORM_ID "BeOS" 488 | 489 | #elif defined(__QNX__) || defined(__QNXNTO__) 490 | # define PLATFORM_ID "QNX" 491 | 492 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 493 | # define PLATFORM_ID "Tru64" 494 | 495 | #elif defined(__riscos) || defined(__riscos__) 496 | # define PLATFORM_ID "RISCos" 497 | 498 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 499 | # define PLATFORM_ID "SINIX" 500 | 501 | #elif defined(__UNIX_SV__) 502 | # define PLATFORM_ID "UNIX_SV" 503 | 504 | #elif defined(__bsdos__) 505 | # define PLATFORM_ID "BSDOS" 506 | 507 | #elif defined(_MPRAS) || defined(MPRAS) 508 | # define PLATFORM_ID "MP-RAS" 509 | 510 | #elif defined(__osf) || defined(__osf__) 511 | # define PLATFORM_ID "OSF1" 512 | 513 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 514 | # define PLATFORM_ID "SCO_SV" 515 | 516 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 517 | # define PLATFORM_ID "ULTRIX" 518 | 519 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 520 | # define PLATFORM_ID "Xenix" 521 | 522 | #elif defined(__WATCOMC__) 523 | # if defined(__LINUX__) 524 | # define PLATFORM_ID "Linux" 525 | 526 | # elif defined(__DOS__) 527 | # define PLATFORM_ID "DOS" 528 | 529 | # elif defined(__OS2__) 530 | # define PLATFORM_ID "OS2" 531 | 532 | # elif defined(__WINDOWS__) 533 | # define PLATFORM_ID "Windows3x" 534 | 535 | # elif defined(__VXWORKS__) 536 | # define PLATFORM_ID "VxWorks" 537 | 538 | # else /* unknown platform */ 539 | # define PLATFORM_ID 540 | # endif 541 | 542 | #elif defined(__INTEGRITY) 543 | # if defined(INT_178B) 544 | # define PLATFORM_ID "Integrity178" 545 | 546 | # else /* regular Integrity */ 547 | # define PLATFORM_ID "Integrity" 548 | # endif 549 | 550 | # elif defined(_ADI_COMPILER) 551 | # define PLATFORM_ID "ADSP" 552 | 553 | #else /* unknown platform */ 554 | # define PLATFORM_ID 555 | 556 | #endif 557 | 558 | /* For windows compilers MSVC and Intel we can determine 559 | the architecture of the compiler being used. This is because 560 | the compilers do not have flags that can change the architecture, 561 | but rather depend on which compiler is being used 562 | */ 563 | #if defined(_WIN32) && defined(_MSC_VER) 564 | # if defined(_M_IA64) 565 | # define ARCHITECTURE_ID "IA64" 566 | 567 | # elif defined(_M_ARM64EC) 568 | # define ARCHITECTURE_ID "ARM64EC" 569 | 570 | # elif defined(_M_X64) || defined(_M_AMD64) 571 | # define ARCHITECTURE_ID "x64" 572 | 573 | # elif defined(_M_IX86) 574 | # define ARCHITECTURE_ID "X86" 575 | 576 | # elif defined(_M_ARM64) 577 | # define ARCHITECTURE_ID "ARM64" 578 | 579 | # elif defined(_M_ARM) 580 | # if _M_ARM == 4 581 | # define ARCHITECTURE_ID "ARMV4I" 582 | # elif _M_ARM == 5 583 | # define ARCHITECTURE_ID "ARMV5I" 584 | # else 585 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 586 | # endif 587 | 588 | # elif defined(_M_MIPS) 589 | # define ARCHITECTURE_ID "MIPS" 590 | 591 | # elif defined(_M_SH) 592 | # define ARCHITECTURE_ID "SHx" 593 | 594 | # else /* unknown architecture */ 595 | # define ARCHITECTURE_ID "" 596 | # endif 597 | 598 | #elif defined(__WATCOMC__) 599 | # if defined(_M_I86) 600 | # define ARCHITECTURE_ID "I86" 601 | 602 | # elif defined(_M_IX86) 603 | # define ARCHITECTURE_ID "X86" 604 | 605 | # else /* unknown architecture */ 606 | # define ARCHITECTURE_ID "" 607 | # endif 608 | 609 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 610 | # if defined(__ICCARM__) 611 | # define ARCHITECTURE_ID "ARM" 612 | 613 | # elif defined(__ICCRX__) 614 | # define ARCHITECTURE_ID "RX" 615 | 616 | # elif defined(__ICCRH850__) 617 | # define ARCHITECTURE_ID "RH850" 618 | 619 | # elif defined(__ICCRL78__) 620 | # define ARCHITECTURE_ID "RL78" 621 | 622 | # elif defined(__ICCRISCV__) 623 | # define ARCHITECTURE_ID "RISCV" 624 | 625 | # elif defined(__ICCAVR__) 626 | # define ARCHITECTURE_ID "AVR" 627 | 628 | # elif defined(__ICC430__) 629 | # define ARCHITECTURE_ID "MSP430" 630 | 631 | # elif defined(__ICCV850__) 632 | # define ARCHITECTURE_ID "V850" 633 | 634 | # elif defined(__ICC8051__) 635 | # define ARCHITECTURE_ID "8051" 636 | 637 | # elif defined(__ICCSTM8__) 638 | # define ARCHITECTURE_ID "STM8" 639 | 640 | # else /* unknown architecture */ 641 | # define ARCHITECTURE_ID "" 642 | # endif 643 | 644 | #elif defined(__ghs__) 645 | # if defined(__PPC64__) 646 | # define ARCHITECTURE_ID "PPC64" 647 | 648 | # elif defined(__ppc__) 649 | # define ARCHITECTURE_ID "PPC" 650 | 651 | # elif defined(__ARM__) 652 | # define ARCHITECTURE_ID "ARM" 653 | 654 | # elif defined(__x86_64__) 655 | # define ARCHITECTURE_ID "x64" 656 | 657 | # elif defined(__i386__) 658 | # define ARCHITECTURE_ID "X86" 659 | 660 | # else /* unknown architecture */ 661 | # define ARCHITECTURE_ID "" 662 | # endif 663 | 664 | #elif defined(__TI_COMPILER_VERSION__) 665 | # if defined(__TI_ARM__) 666 | # define ARCHITECTURE_ID "ARM" 667 | 668 | # elif defined(__MSP430__) 669 | # define ARCHITECTURE_ID "MSP430" 670 | 671 | # elif defined(__TMS320C28XX__) 672 | # define ARCHITECTURE_ID "TMS320C28x" 673 | 674 | # elif defined(__TMS320C6X__) || defined(_TMS320C6X) 675 | # define ARCHITECTURE_ID "TMS320C6x" 676 | 677 | # else /* unknown architecture */ 678 | # define ARCHITECTURE_ID "" 679 | # endif 680 | 681 | # elif defined(__ADSPSHARC__) 682 | # define ARCHITECTURE_ID "SHARC" 683 | 684 | # elif defined(__ADSPBLACKFIN__) 685 | # define ARCHITECTURE_ID "Blackfin" 686 | 687 | #else 688 | # define ARCHITECTURE_ID 689 | #endif 690 | 691 | /* Convert integer to decimal digit literals. */ 692 | #define DEC(n) \ 693 | ('0' + (((n) / 10000000)%10)), \ 694 | ('0' + (((n) / 1000000)%10)), \ 695 | ('0' + (((n) / 100000)%10)), \ 696 | ('0' + (((n) / 10000)%10)), \ 697 | ('0' + (((n) / 1000)%10)), \ 698 | ('0' + (((n) / 100)%10)), \ 699 | ('0' + (((n) / 10)%10)), \ 700 | ('0' + ((n) % 10)) 701 | 702 | /* Convert integer to hex digit literals. */ 703 | #define HEX(n) \ 704 | ('0' + ((n)>>28 & 0xF)), \ 705 | ('0' + ((n)>>24 & 0xF)), \ 706 | ('0' + ((n)>>20 & 0xF)), \ 707 | ('0' + ((n)>>16 & 0xF)), \ 708 | ('0' + ((n)>>12 & 0xF)), \ 709 | ('0' + ((n)>>8 & 0xF)), \ 710 | ('0' + ((n)>>4 & 0xF)), \ 711 | ('0' + ((n) & 0xF)) 712 | 713 | /* Construct a string literal encoding the version number. */ 714 | #ifdef COMPILER_VERSION 715 | char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; 716 | 717 | /* Construct a string literal encoding the version number components. */ 718 | #elif defined(COMPILER_VERSION_MAJOR) 719 | char const info_version[] = { 720 | 'I', 'N', 'F', 'O', ':', 721 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 722 | COMPILER_VERSION_MAJOR, 723 | # ifdef COMPILER_VERSION_MINOR 724 | '.', COMPILER_VERSION_MINOR, 725 | # ifdef COMPILER_VERSION_PATCH 726 | '.', COMPILER_VERSION_PATCH, 727 | # ifdef COMPILER_VERSION_TWEAK 728 | '.', COMPILER_VERSION_TWEAK, 729 | # endif 730 | # endif 731 | # endif 732 | ']','\0'}; 733 | #endif 734 | 735 | /* Construct a string literal encoding the internal version number. */ 736 | #ifdef COMPILER_VERSION_INTERNAL 737 | char const info_version_internal[] = { 738 | 'I', 'N', 'F', 'O', ':', 739 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 740 | 'i','n','t','e','r','n','a','l','[', 741 | COMPILER_VERSION_INTERNAL,']','\0'}; 742 | #elif defined(COMPILER_VERSION_INTERNAL_STR) 743 | char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; 744 | #endif 745 | 746 | /* Construct a string literal encoding the version number components. */ 747 | #ifdef SIMULATE_VERSION_MAJOR 748 | char const info_simulate_version[] = { 749 | 'I', 'N', 'F', 'O', ':', 750 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 751 | SIMULATE_VERSION_MAJOR, 752 | # ifdef SIMULATE_VERSION_MINOR 753 | '.', SIMULATE_VERSION_MINOR, 754 | # ifdef SIMULATE_VERSION_PATCH 755 | '.', SIMULATE_VERSION_PATCH, 756 | # ifdef SIMULATE_VERSION_TWEAK 757 | '.', SIMULATE_VERSION_TWEAK, 758 | # endif 759 | # endif 760 | # endif 761 | ']','\0'}; 762 | #endif 763 | 764 | /* Construct the string literal in pieces to prevent the source from 765 | getting matched. Store it in a pointer rather than an array 766 | because some compilers will just produce instructions to fill the 767 | array rather than assigning a pointer to a static array. */ 768 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 769 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 770 | 771 | 772 | 773 | #if !defined(__STDC__) && !defined(__clang__) 774 | # if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) 775 | # define C_VERSION "90" 776 | # else 777 | # define C_VERSION 778 | # endif 779 | #elif __STDC_VERSION__ > 201710L 780 | # define C_VERSION "23" 781 | #elif __STDC_VERSION__ >= 201710L 782 | # define C_VERSION "17" 783 | #elif __STDC_VERSION__ >= 201000L 784 | # define C_VERSION "11" 785 | #elif __STDC_VERSION__ >= 199901L 786 | # define C_VERSION "99" 787 | #else 788 | # define C_VERSION "90" 789 | #endif 790 | const char* info_language_standard_default = 791 | "INFO" ":" "standard_default[" C_VERSION "]"; 792 | 793 | const char* info_language_extensions_default = "INFO" ":" "extensions_default[" 794 | #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ 795 | defined(__TI_COMPILER_VERSION__)) && \ 796 | !defined(__STRICT_ANSI__) 797 | "ON" 798 | #else 799 | "OFF" 800 | #endif 801 | "]"; 802 | 803 | /*--------------------------------------------------------------------------*/ 804 | 805 | #ifdef ID_VOID_MAIN 806 | void main() {} 807 | #else 808 | # if defined(__CLASSIC_C__) 809 | int main(argc, argv) int argc; char *argv[]; 810 | # else 811 | int main(int argc, char* argv[]) 812 | # endif 813 | { 814 | int require = 0; 815 | require += info_compiler[argc]; 816 | require += info_platform[argc]; 817 | require += info_arch[argc]; 818 | #ifdef COMPILER_VERSION_MAJOR 819 | require += info_version[argc]; 820 | #endif 821 | #ifdef COMPILER_VERSION_INTERNAL 822 | require += info_version_internal[argc]; 823 | #endif 824 | #ifdef SIMULATE_ID 825 | require += info_simulate[argc]; 826 | #endif 827 | #ifdef SIMULATE_VERSION_MAJOR 828 | require += info_simulate_version[argc]; 829 | #endif 830 | #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) 831 | require += info_cray[argc]; 832 | #endif 833 | require += info_language_standard_default[argc]; 834 | require += info_language_extensions_default[argc]; 835 | (void)argv; 836 | return require; 837 | } 838 | #endif 839 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CompilerIdC/a.out -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CompilerIdCXX/CMakeCXXCompilerId.cpp: -------------------------------------------------------------------------------- 1 | /* This source file must have a .cpp extension so that all C++ compilers 2 | recognize the extension without flags. Borland does not know .cxx for 3 | example. */ 4 | #ifndef __cplusplus 5 | # error "A C compiler has been selected for C++." 6 | #endif 7 | 8 | #if !defined(__has_include) 9 | /* If the compiler does not have __has_include, pretend the answer is 10 | always no. */ 11 | # define __has_include(x) 0 12 | #endif 13 | 14 | 15 | /* Version number components: V=Version, R=Revision, P=Patch 16 | Version date components: YYYY=Year, MM=Month, DD=Day */ 17 | 18 | #if defined(__COMO__) 19 | # define COMPILER_ID "Comeau" 20 | /* __COMO_VERSION__ = VRR */ 21 | # define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) 22 | # define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) 23 | 24 | #elif defined(__INTEL_COMPILER) || defined(__ICC) 25 | # define COMPILER_ID "Intel" 26 | # if defined(_MSC_VER) 27 | # define SIMULATE_ID "MSVC" 28 | # endif 29 | # if defined(__GNUC__) 30 | # define SIMULATE_ID "GNU" 31 | # endif 32 | /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, 33 | except that a few beta releases use the old format with V=2021. */ 34 | # if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 35 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 36 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 37 | # if defined(__INTEL_COMPILER_UPDATE) 38 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 39 | # else 40 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 41 | # endif 42 | # else 43 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) 44 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) 45 | /* The third version component from --version is an update index, 46 | but no macro is provided for it. */ 47 | # define COMPILER_VERSION_PATCH DEC(0) 48 | # endif 49 | # if defined(__INTEL_COMPILER_BUILD_DATE) 50 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 51 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 52 | # endif 53 | # if defined(_MSC_VER) 54 | /* _MSC_VER = VVRR */ 55 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 56 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 57 | # endif 58 | # if defined(__GNUC__) 59 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 60 | # elif defined(__GNUG__) 61 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 62 | # endif 63 | # if defined(__GNUC_MINOR__) 64 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 65 | # endif 66 | # if defined(__GNUC_PATCHLEVEL__) 67 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 68 | # endif 69 | 70 | #elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) 71 | # define COMPILER_ID "IntelLLVM" 72 | #if defined(_MSC_VER) 73 | # define SIMULATE_ID "MSVC" 74 | #endif 75 | #if defined(__GNUC__) 76 | # define SIMULATE_ID "GNU" 77 | #endif 78 | /* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and 79 | * later. Look for 6 digit vs. 8 digit version number to decide encoding. 80 | * VVVV is no smaller than the current year when a version is released. 81 | */ 82 | #if __INTEL_LLVM_COMPILER < 1000000L 83 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) 84 | # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) 85 | # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) 86 | #else 87 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) 88 | # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) 89 | # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) 90 | #endif 91 | #if defined(_MSC_VER) 92 | /* _MSC_VER = VVRR */ 93 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 94 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 95 | #endif 96 | #if defined(__GNUC__) 97 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 98 | #elif defined(__GNUG__) 99 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 100 | #endif 101 | #if defined(__GNUC_MINOR__) 102 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 103 | #endif 104 | #if defined(__GNUC_PATCHLEVEL__) 105 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 106 | #endif 107 | 108 | #elif defined(__PATHCC__) 109 | # define COMPILER_ID "PathScale" 110 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 111 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 112 | # if defined(__PATHCC_PATCHLEVEL__) 113 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 114 | # endif 115 | 116 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 117 | # define COMPILER_ID "Embarcadero" 118 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 119 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 120 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 121 | 122 | #elif defined(__BORLANDC__) 123 | # define COMPILER_ID "Borland" 124 | /* __BORLANDC__ = 0xVRR */ 125 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 126 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 127 | 128 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 129 | # define COMPILER_ID "Watcom" 130 | /* __WATCOMC__ = VVRR */ 131 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 132 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 133 | # if (__WATCOMC__ % 10) > 0 134 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 135 | # endif 136 | 137 | #elif defined(__WATCOMC__) 138 | # define COMPILER_ID "OpenWatcom" 139 | /* __WATCOMC__ = VVRP + 1100 */ 140 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 141 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 142 | # if (__WATCOMC__ % 10) > 0 143 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 144 | # endif 145 | 146 | #elif defined(__SUNPRO_CC) 147 | # define COMPILER_ID "SunPro" 148 | # if __SUNPRO_CC >= 0x5100 149 | /* __SUNPRO_CC = 0xVRRP */ 150 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) 151 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) 152 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 153 | # else 154 | /* __SUNPRO_CC = 0xVRP */ 155 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) 156 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) 157 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 158 | # endif 159 | 160 | #elif defined(__HP_aCC) 161 | # define COMPILER_ID "HP" 162 | /* __HP_aCC = VVRRPP */ 163 | # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) 164 | # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) 165 | # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) 166 | 167 | #elif defined(__DECCXX) 168 | # define COMPILER_ID "Compaq" 169 | /* __DECCXX_VER = VVRRTPPPP */ 170 | # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) 171 | # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) 172 | # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) 173 | 174 | #elif defined(__IBMCPP__) && defined(__COMPILER_VER__) 175 | # define COMPILER_ID "zOS" 176 | /* __IBMCPP__ = VRP */ 177 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 178 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 179 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 180 | 181 | #elif defined(__open_xl__) && defined(__clang__) 182 | # define COMPILER_ID "IBMClang" 183 | # define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) 184 | # define COMPILER_VERSION_MINOR DEC(__open_xl_release__) 185 | # define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) 186 | # define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) 187 | 188 | 189 | #elif defined(__ibmxl__) && defined(__clang__) 190 | # define COMPILER_ID "XLClang" 191 | # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) 192 | # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) 193 | # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) 194 | # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) 195 | 196 | 197 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 198 | # define COMPILER_ID "XL" 199 | /* __IBMCPP__ = VRP */ 200 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 201 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 202 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 203 | 204 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 205 | # define COMPILER_ID "VisualAge" 206 | /* __IBMCPP__ = VRP */ 207 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 208 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 209 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 210 | 211 | #elif defined(__NVCOMPILER) 212 | # define COMPILER_ID "NVHPC" 213 | # define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) 214 | # define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) 215 | # if defined(__NVCOMPILER_PATCHLEVEL__) 216 | # define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) 217 | # endif 218 | 219 | #elif defined(__PGI) 220 | # define COMPILER_ID "PGI" 221 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 222 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 223 | # if defined(__PGIC_PATCHLEVEL__) 224 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 225 | # endif 226 | 227 | #elif defined(_CRAYC) 228 | # define COMPILER_ID "Cray" 229 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 230 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 231 | 232 | #elif defined(__TI_COMPILER_VERSION__) 233 | # define COMPILER_ID "TI" 234 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 235 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 236 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 237 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 238 | 239 | #elif defined(__CLANG_FUJITSU) 240 | # define COMPILER_ID "FujitsuClang" 241 | # define COMPILER_VERSION_MAJOR DEC(__FCC_major__) 242 | # define COMPILER_VERSION_MINOR DEC(__FCC_minor__) 243 | # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) 244 | # define COMPILER_VERSION_INTERNAL_STR __clang_version__ 245 | 246 | 247 | #elif defined(__FUJITSU) 248 | # define COMPILER_ID "Fujitsu" 249 | # if defined(__FCC_version__) 250 | # define COMPILER_VERSION __FCC_version__ 251 | # elif defined(__FCC_major__) 252 | # define COMPILER_VERSION_MAJOR DEC(__FCC_major__) 253 | # define COMPILER_VERSION_MINOR DEC(__FCC_minor__) 254 | # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) 255 | # endif 256 | # if defined(__fcc_version) 257 | # define COMPILER_VERSION_INTERNAL DEC(__fcc_version) 258 | # elif defined(__FCC_VERSION) 259 | # define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) 260 | # endif 261 | 262 | 263 | #elif defined(__ghs__) 264 | # define COMPILER_ID "GHS" 265 | /* __GHS_VERSION_NUMBER = VVVVRP */ 266 | # ifdef __GHS_VERSION_NUMBER 267 | # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) 268 | # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) 269 | # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) 270 | # endif 271 | 272 | #elif defined(__SCO_VERSION__) 273 | # define COMPILER_ID "SCO" 274 | 275 | #elif defined(__ARMCC_VERSION) && !defined(__clang__) 276 | # define COMPILER_ID "ARMCC" 277 | #if __ARMCC_VERSION >= 1000000 278 | /* __ARMCC_VERSION = VRRPPPP */ 279 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 280 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 281 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 282 | #else 283 | /* __ARMCC_VERSION = VRPPPP */ 284 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 285 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 286 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 287 | #endif 288 | 289 | 290 | #elif defined(__clang__) && defined(__apple_build_version__) 291 | # define COMPILER_ID "AppleClang" 292 | # if defined(_MSC_VER) 293 | # define SIMULATE_ID "MSVC" 294 | # endif 295 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 296 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 297 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 298 | # if defined(_MSC_VER) 299 | /* _MSC_VER = VVRR */ 300 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 301 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 302 | # endif 303 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 304 | 305 | #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) 306 | # define COMPILER_ID "ARMClang" 307 | # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) 308 | # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) 309 | # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) 310 | # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) 311 | 312 | #elif defined(__clang__) 313 | # define COMPILER_ID "Clang" 314 | # if defined(_MSC_VER) 315 | # define SIMULATE_ID "MSVC" 316 | # endif 317 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 318 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 319 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 320 | # if defined(_MSC_VER) 321 | /* _MSC_VER = VVRR */ 322 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 323 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 324 | # endif 325 | 326 | #elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) 327 | # define COMPILER_ID "LCC" 328 | # define COMPILER_VERSION_MAJOR DEC(1) 329 | # if defined(__LCC__) 330 | # define COMPILER_VERSION_MINOR DEC(__LCC__- 100) 331 | # endif 332 | # if defined(__LCC_MINOR__) 333 | # define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) 334 | # endif 335 | # if defined(__GNUC__) && defined(__GNUC_MINOR__) 336 | # define SIMULATE_ID "GNU" 337 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 338 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 339 | # if defined(__GNUC_PATCHLEVEL__) 340 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 341 | # endif 342 | # endif 343 | 344 | #elif defined(__GNUC__) || defined(__GNUG__) 345 | # define COMPILER_ID "GNU" 346 | # if defined(__GNUC__) 347 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 348 | # else 349 | # define COMPILER_VERSION_MAJOR DEC(__GNUG__) 350 | # endif 351 | # if defined(__GNUC_MINOR__) 352 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 353 | # endif 354 | # if defined(__GNUC_PATCHLEVEL__) 355 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 356 | # endif 357 | 358 | #elif defined(_MSC_VER) 359 | # define COMPILER_ID "MSVC" 360 | /* _MSC_VER = VVRR */ 361 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 362 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 363 | # if defined(_MSC_FULL_VER) 364 | # if _MSC_VER >= 1400 365 | /* _MSC_FULL_VER = VVRRPPPPP */ 366 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 367 | # else 368 | /* _MSC_FULL_VER = VVRRPPPP */ 369 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 370 | # endif 371 | # endif 372 | # if defined(_MSC_BUILD) 373 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 374 | # endif 375 | 376 | #elif defined(_ADI_COMPILER) 377 | # define COMPILER_ID "ADSP" 378 | #if defined(__VERSIONNUM__) 379 | /* __VERSIONNUM__ = 0xVVRRPPTT */ 380 | # define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) 381 | # define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) 382 | # define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) 383 | # define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) 384 | #endif 385 | 386 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 387 | # define COMPILER_ID "IAR" 388 | # if defined(__VER__) && defined(__ICCARM__) 389 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) 390 | # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) 391 | # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) 392 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 393 | # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) 394 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) 395 | # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) 396 | # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) 397 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 398 | # endif 399 | 400 | 401 | /* These compilers are either not known or too old to define an 402 | identification macro. Try to identify the platform and guess that 403 | it is the native compiler. */ 404 | #elif defined(__hpux) || defined(__hpua) 405 | # define COMPILER_ID "HP" 406 | 407 | #else /* unknown compiler */ 408 | # define COMPILER_ID "" 409 | #endif 410 | 411 | /* Construct the string literal in pieces to prevent the source from 412 | getting matched. Store it in a pointer rather than an array 413 | because some compilers will just produce instructions to fill the 414 | array rather than assigning a pointer to a static array. */ 415 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 416 | #ifdef SIMULATE_ID 417 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 418 | #endif 419 | 420 | #ifdef __QNXNTO__ 421 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 422 | #endif 423 | 424 | #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) 425 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 426 | #endif 427 | 428 | #define STRINGIFY_HELPER(X) #X 429 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 430 | 431 | /* Identify known platforms by name. */ 432 | #if defined(__linux) || defined(__linux__) || defined(linux) 433 | # define PLATFORM_ID "Linux" 434 | 435 | #elif defined(__MSYS__) 436 | # define PLATFORM_ID "MSYS" 437 | 438 | #elif defined(__CYGWIN__) 439 | # define PLATFORM_ID "Cygwin" 440 | 441 | #elif defined(__MINGW32__) 442 | # define PLATFORM_ID "MinGW" 443 | 444 | #elif defined(__APPLE__) 445 | # define PLATFORM_ID "Darwin" 446 | 447 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 448 | # define PLATFORM_ID "Windows" 449 | 450 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 451 | # define PLATFORM_ID "FreeBSD" 452 | 453 | #elif defined(__NetBSD__) || defined(__NetBSD) 454 | # define PLATFORM_ID "NetBSD" 455 | 456 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 457 | # define PLATFORM_ID "OpenBSD" 458 | 459 | #elif defined(__sun) || defined(sun) 460 | # define PLATFORM_ID "SunOS" 461 | 462 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 463 | # define PLATFORM_ID "AIX" 464 | 465 | #elif defined(__hpux) || defined(__hpux__) 466 | # define PLATFORM_ID "HP-UX" 467 | 468 | #elif defined(__HAIKU__) 469 | # define PLATFORM_ID "Haiku" 470 | 471 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 472 | # define PLATFORM_ID "BeOS" 473 | 474 | #elif defined(__QNX__) || defined(__QNXNTO__) 475 | # define PLATFORM_ID "QNX" 476 | 477 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 478 | # define PLATFORM_ID "Tru64" 479 | 480 | #elif defined(__riscos) || defined(__riscos__) 481 | # define PLATFORM_ID "RISCos" 482 | 483 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 484 | # define PLATFORM_ID "SINIX" 485 | 486 | #elif defined(__UNIX_SV__) 487 | # define PLATFORM_ID "UNIX_SV" 488 | 489 | #elif defined(__bsdos__) 490 | # define PLATFORM_ID "BSDOS" 491 | 492 | #elif defined(_MPRAS) || defined(MPRAS) 493 | # define PLATFORM_ID "MP-RAS" 494 | 495 | #elif defined(__osf) || defined(__osf__) 496 | # define PLATFORM_ID "OSF1" 497 | 498 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 499 | # define PLATFORM_ID "SCO_SV" 500 | 501 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 502 | # define PLATFORM_ID "ULTRIX" 503 | 504 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 505 | # define PLATFORM_ID "Xenix" 506 | 507 | #elif defined(__WATCOMC__) 508 | # if defined(__LINUX__) 509 | # define PLATFORM_ID "Linux" 510 | 511 | # elif defined(__DOS__) 512 | # define PLATFORM_ID "DOS" 513 | 514 | # elif defined(__OS2__) 515 | # define PLATFORM_ID "OS2" 516 | 517 | # elif defined(__WINDOWS__) 518 | # define PLATFORM_ID "Windows3x" 519 | 520 | # elif defined(__VXWORKS__) 521 | # define PLATFORM_ID "VxWorks" 522 | 523 | # else /* unknown platform */ 524 | # define PLATFORM_ID 525 | # endif 526 | 527 | #elif defined(__INTEGRITY) 528 | # if defined(INT_178B) 529 | # define PLATFORM_ID "Integrity178" 530 | 531 | # else /* regular Integrity */ 532 | # define PLATFORM_ID "Integrity" 533 | # endif 534 | 535 | # elif defined(_ADI_COMPILER) 536 | # define PLATFORM_ID "ADSP" 537 | 538 | #else /* unknown platform */ 539 | # define PLATFORM_ID 540 | 541 | #endif 542 | 543 | /* For windows compilers MSVC and Intel we can determine 544 | the architecture of the compiler being used. This is because 545 | the compilers do not have flags that can change the architecture, 546 | but rather depend on which compiler is being used 547 | */ 548 | #if defined(_WIN32) && defined(_MSC_VER) 549 | # if defined(_M_IA64) 550 | # define ARCHITECTURE_ID "IA64" 551 | 552 | # elif defined(_M_ARM64EC) 553 | # define ARCHITECTURE_ID "ARM64EC" 554 | 555 | # elif defined(_M_X64) || defined(_M_AMD64) 556 | # define ARCHITECTURE_ID "x64" 557 | 558 | # elif defined(_M_IX86) 559 | # define ARCHITECTURE_ID "X86" 560 | 561 | # elif defined(_M_ARM64) 562 | # define ARCHITECTURE_ID "ARM64" 563 | 564 | # elif defined(_M_ARM) 565 | # if _M_ARM == 4 566 | # define ARCHITECTURE_ID "ARMV4I" 567 | # elif _M_ARM == 5 568 | # define ARCHITECTURE_ID "ARMV5I" 569 | # else 570 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 571 | # endif 572 | 573 | # elif defined(_M_MIPS) 574 | # define ARCHITECTURE_ID "MIPS" 575 | 576 | # elif defined(_M_SH) 577 | # define ARCHITECTURE_ID "SHx" 578 | 579 | # else /* unknown architecture */ 580 | # define ARCHITECTURE_ID "" 581 | # endif 582 | 583 | #elif defined(__WATCOMC__) 584 | # if defined(_M_I86) 585 | # define ARCHITECTURE_ID "I86" 586 | 587 | # elif defined(_M_IX86) 588 | # define ARCHITECTURE_ID "X86" 589 | 590 | # else /* unknown architecture */ 591 | # define ARCHITECTURE_ID "" 592 | # endif 593 | 594 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 595 | # if defined(__ICCARM__) 596 | # define ARCHITECTURE_ID "ARM" 597 | 598 | # elif defined(__ICCRX__) 599 | # define ARCHITECTURE_ID "RX" 600 | 601 | # elif defined(__ICCRH850__) 602 | # define ARCHITECTURE_ID "RH850" 603 | 604 | # elif defined(__ICCRL78__) 605 | # define ARCHITECTURE_ID "RL78" 606 | 607 | # elif defined(__ICCRISCV__) 608 | # define ARCHITECTURE_ID "RISCV" 609 | 610 | # elif defined(__ICCAVR__) 611 | # define ARCHITECTURE_ID "AVR" 612 | 613 | # elif defined(__ICC430__) 614 | # define ARCHITECTURE_ID "MSP430" 615 | 616 | # elif defined(__ICCV850__) 617 | # define ARCHITECTURE_ID "V850" 618 | 619 | # elif defined(__ICC8051__) 620 | # define ARCHITECTURE_ID "8051" 621 | 622 | # elif defined(__ICCSTM8__) 623 | # define ARCHITECTURE_ID "STM8" 624 | 625 | # else /* unknown architecture */ 626 | # define ARCHITECTURE_ID "" 627 | # endif 628 | 629 | #elif defined(__ghs__) 630 | # if defined(__PPC64__) 631 | # define ARCHITECTURE_ID "PPC64" 632 | 633 | # elif defined(__ppc__) 634 | # define ARCHITECTURE_ID "PPC" 635 | 636 | # elif defined(__ARM__) 637 | # define ARCHITECTURE_ID "ARM" 638 | 639 | # elif defined(__x86_64__) 640 | # define ARCHITECTURE_ID "x64" 641 | 642 | # elif defined(__i386__) 643 | # define ARCHITECTURE_ID "X86" 644 | 645 | # else /* unknown architecture */ 646 | # define ARCHITECTURE_ID "" 647 | # endif 648 | 649 | #elif defined(__TI_COMPILER_VERSION__) 650 | # if defined(__TI_ARM__) 651 | # define ARCHITECTURE_ID "ARM" 652 | 653 | # elif defined(__MSP430__) 654 | # define ARCHITECTURE_ID "MSP430" 655 | 656 | # elif defined(__TMS320C28XX__) 657 | # define ARCHITECTURE_ID "TMS320C28x" 658 | 659 | # elif defined(__TMS320C6X__) || defined(_TMS320C6X) 660 | # define ARCHITECTURE_ID "TMS320C6x" 661 | 662 | # else /* unknown architecture */ 663 | # define ARCHITECTURE_ID "" 664 | # endif 665 | 666 | # elif defined(__ADSPSHARC__) 667 | # define ARCHITECTURE_ID "SHARC" 668 | 669 | # elif defined(__ADSPBLACKFIN__) 670 | # define ARCHITECTURE_ID "Blackfin" 671 | 672 | #else 673 | # define ARCHITECTURE_ID 674 | #endif 675 | 676 | /* Convert integer to decimal digit literals. */ 677 | #define DEC(n) \ 678 | ('0' + (((n) / 10000000)%10)), \ 679 | ('0' + (((n) / 1000000)%10)), \ 680 | ('0' + (((n) / 100000)%10)), \ 681 | ('0' + (((n) / 10000)%10)), \ 682 | ('0' + (((n) / 1000)%10)), \ 683 | ('0' + (((n) / 100)%10)), \ 684 | ('0' + (((n) / 10)%10)), \ 685 | ('0' + ((n) % 10)) 686 | 687 | /* Convert integer to hex digit literals. */ 688 | #define HEX(n) \ 689 | ('0' + ((n)>>28 & 0xF)), \ 690 | ('0' + ((n)>>24 & 0xF)), \ 691 | ('0' + ((n)>>20 & 0xF)), \ 692 | ('0' + ((n)>>16 & 0xF)), \ 693 | ('0' + ((n)>>12 & 0xF)), \ 694 | ('0' + ((n)>>8 & 0xF)), \ 695 | ('0' + ((n)>>4 & 0xF)), \ 696 | ('0' + ((n) & 0xF)) 697 | 698 | /* Construct a string literal encoding the version number. */ 699 | #ifdef COMPILER_VERSION 700 | char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; 701 | 702 | /* Construct a string literal encoding the version number components. */ 703 | #elif defined(COMPILER_VERSION_MAJOR) 704 | char const info_version[] = { 705 | 'I', 'N', 'F', 'O', ':', 706 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 707 | COMPILER_VERSION_MAJOR, 708 | # ifdef COMPILER_VERSION_MINOR 709 | '.', COMPILER_VERSION_MINOR, 710 | # ifdef COMPILER_VERSION_PATCH 711 | '.', COMPILER_VERSION_PATCH, 712 | # ifdef COMPILER_VERSION_TWEAK 713 | '.', COMPILER_VERSION_TWEAK, 714 | # endif 715 | # endif 716 | # endif 717 | ']','\0'}; 718 | #endif 719 | 720 | /* Construct a string literal encoding the internal version number. */ 721 | #ifdef COMPILER_VERSION_INTERNAL 722 | char const info_version_internal[] = { 723 | 'I', 'N', 'F', 'O', ':', 724 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 725 | 'i','n','t','e','r','n','a','l','[', 726 | COMPILER_VERSION_INTERNAL,']','\0'}; 727 | #elif defined(COMPILER_VERSION_INTERNAL_STR) 728 | char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; 729 | #endif 730 | 731 | /* Construct a string literal encoding the version number components. */ 732 | #ifdef SIMULATE_VERSION_MAJOR 733 | char const info_simulate_version[] = { 734 | 'I', 'N', 'F', 'O', ':', 735 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 736 | SIMULATE_VERSION_MAJOR, 737 | # ifdef SIMULATE_VERSION_MINOR 738 | '.', SIMULATE_VERSION_MINOR, 739 | # ifdef SIMULATE_VERSION_PATCH 740 | '.', SIMULATE_VERSION_PATCH, 741 | # ifdef SIMULATE_VERSION_TWEAK 742 | '.', SIMULATE_VERSION_TWEAK, 743 | # endif 744 | # endif 745 | # endif 746 | ']','\0'}; 747 | #endif 748 | 749 | /* Construct the string literal in pieces to prevent the source from 750 | getting matched. Store it in a pointer rather than an array 751 | because some compilers will just produce instructions to fill the 752 | array rather than assigning a pointer to a static array. */ 753 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 754 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 755 | 756 | 757 | 758 | #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L 759 | # if defined(__INTEL_CXX11_MODE__) 760 | # if defined(__cpp_aggregate_nsdmi) 761 | # define CXX_STD 201402L 762 | # else 763 | # define CXX_STD 201103L 764 | # endif 765 | # else 766 | # define CXX_STD 199711L 767 | # endif 768 | #elif defined(_MSC_VER) && defined(_MSVC_LANG) 769 | # define CXX_STD _MSVC_LANG 770 | #else 771 | # define CXX_STD __cplusplus 772 | #endif 773 | 774 | const char* info_language_standard_default = "INFO" ":" "standard_default[" 775 | #if CXX_STD > 202002L 776 | "23" 777 | #elif CXX_STD > 201703L 778 | "20" 779 | #elif CXX_STD >= 201703L 780 | "17" 781 | #elif CXX_STD >= 201402L 782 | "14" 783 | #elif CXX_STD >= 201103L 784 | "11" 785 | #else 786 | "98" 787 | #endif 788 | "]"; 789 | 790 | const char* info_language_extensions_default = "INFO" ":" "extensions_default[" 791 | #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ 792 | defined(__TI_COMPILER_VERSION__)) && \ 793 | !defined(__STRICT_ANSI__) 794 | "ON" 795 | #else 796 | "OFF" 797 | #endif 798 | "]"; 799 | 800 | /*--------------------------------------------------------------------------*/ 801 | 802 | int main(int argc, char* argv[]) 803 | { 804 | int require = 0; 805 | require += info_compiler[argc]; 806 | require += info_platform[argc]; 807 | #ifdef COMPILER_VERSION_MAJOR 808 | require += info_version[argc]; 809 | #endif 810 | #ifdef COMPILER_VERSION_INTERNAL 811 | require += info_version_internal[argc]; 812 | #endif 813 | #ifdef SIMULATE_ID 814 | require += info_simulate[argc]; 815 | #endif 816 | #ifdef SIMULATE_VERSION_MAJOR 817 | require += info_simulate_version[argc]; 818 | #endif 819 | #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) 820 | require += info_cray[argc]; 821 | #endif 822 | require += info_language_standard_default[argc]; 823 | require += info_language_extensions_default[argc]; 824 | (void)argv; 825 | return require; 826 | } 827 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/3.24.0/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/alphapi_LED.elf.dir/project_elf_src_esp32c3.c.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/alphapi_LED.elf.dir/project_elf_src_esp32c3.c.obj -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/bootloader-complete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/bootloader-complete -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/bootloader.dir/Labels.json: -------------------------------------------------------------------------------- 1 | { 2 | "sources" : 3 | [ 4 | { 5 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/bootloader" 6 | }, 7 | { 8 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/bootloader.rule" 9 | }, 10 | { 11 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/bootloader-complete.rule" 12 | }, 13 | { 14 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-build.rule" 15 | }, 16 | { 17 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-configure.rule" 18 | }, 19 | { 20 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-download.rule" 21 | }, 22 | { 23 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-install.rule" 24 | }, 25 | { 26 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-mkdir.rule" 27 | }, 28 | { 29 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-patch.rule" 30 | }, 31 | { 32 | "file" : "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-update.rule" 33 | } 34 | ], 35 | "target" : 36 | { 37 | "labels" : 38 | [ 39 | "bootloader" 40 | ], 41 | "name" : "bootloader" 42 | } 43 | } -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/bootloader.dir/Labels.txt: -------------------------------------------------------------------------------- 1 | # Target labels 2 | bootloader 3 | # Source files and their labels 4 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/bootloader 5 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/bootloader.rule 6 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/bootloader-complete.rule 7 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-build.rule 8 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-configure.rule 9 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-download.rule 10 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-install.rule 11 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-mkdir.rule 12 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-patch.rule 13 | C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/bootloader-prefix/src/bootloader-stamp/bootloader-update.rule 14 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/clean_additional.cmake: -------------------------------------------------------------------------------- 1 | # Additional clean files 2 | cmake_minimum_required(VERSION 3.16) 3 | 4 | if("${CONFIG}" STREQUAL "" OR "${CONFIG}" STREQUAL "") 5 | file(REMOVE_RECURSE 6 | "alphapi_LED.bin" 7 | "alphapi_LED.map" 8 | "bootloader\\bootloader.bin" 9 | "bootloader\\bootloader.elf" 10 | "bootloader\\bootloader.map" 11 | "config\\sdkconfig.cmake" 12 | "config\\sdkconfig.h" 13 | "esp-idf\\esptool_py\\flasher_args.json.in" 14 | "esp-idf\\mbedtls\\x509_crt_bundle" 15 | "flash_app_args" 16 | "flash_bootloader_args" 17 | "flash_project_args" 18 | "flasher_args.json" 19 | "ldgen_libraries" 20 | "ldgen_libraries.in" 21 | "project_elf_src_esp32c3.c" 22 | "x509_crt_bundle.S" 23 | ) 24 | endif() 25 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/git-data/HEAD: -------------------------------------------------------------------------------- 1 | e0991facf5ecb362af6aac1fae972139eb38d2e4 2 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/git-data/grabRef.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/git-data/HEAD" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | set(GIT_DIR "C:/esp/Espressif/frameworks/esp-idf-v5.3/.git") 22 | # handle git-worktree 23 | if(EXISTS "${GIT_DIR}/commondir") 24 | file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024) 25 | string(STRIP "${GIT_DIR_NEW}" GIT_DIR_NEW) 26 | if(NOT IS_ABSOLUTE "${GIT_DIR_NEW}") 27 | get_filename_component(GIT_DIR_NEW ${GIT_DIR}/${GIT_DIR_NEW} ABSOLUTE) 28 | endif() 29 | if(EXISTS "${GIT_DIR_NEW}") 30 | set(GIT_DIR "${GIT_DIR_NEW}") 31 | endif() 32 | endif() 33 | if(HEAD_CONTENTS MATCHES "ref") 34 | # named branch 35 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 36 | if(EXISTS "${GIT_DIR}/${HEAD_REF}") 37 | configure_file("${GIT_DIR}/${HEAD_REF}" "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/git-data/head-ref" COPYONLY) 38 | elseif(EXISTS "${GIT_DIR}/logs/${HEAD_REF}") 39 | configure_file("${GIT_DIR}/logs/${HEAD_REF}" "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/git-data/head-ref" COPYONLY) 40 | set(HEAD_HASH "${HEAD_REF}") 41 | endif() 42 | else() 43 | # detached HEAD 44 | configure_file("${GIT_DIR}/HEAD" "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/git-data/head-ref" COPYONLY) 45 | endif() 46 | 47 | if(NOT HEAD_HASH) 48 | file(READ "C:/Users/lcy/Desktop/Code/lcy-project/alphapi_LED/build/CMakeFiles/git-data/head-ref" HEAD_HASH LIMIT 1024) 49 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 50 | endif() 51 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/build/CMakeFiles/git-data/head-ref: -------------------------------------------------------------------------------- 1 | e0991facf5ecb362af6aac1fae972139eb38d2e4 2 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/images/pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/images/pic1.jpg -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/images/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/images/pic2.jpg -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "sparkling_heart.c" 2 | INCLUDE_DIRS ".") 3 | -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/main/alphapi.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "driver/uart.h" 3 | #include "driver/gpio.h" 4 | 5 | const uart_port_t alphapi_uart_display_write_num = UART_NUM_1; 6 | uart_config_t uart_config = { 7 | .baud_rate = 460800, 8 | .data_bits = UART_DATA_8_BITS, 9 | .parity = UART_PARITY_DISABLE, 10 | .stop_bits = UART_STOP_BITS_1, 11 | .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, 12 | .rx_flow_ctrl_thresh = 122, 13 | }; 14 | int calc_checksum(char *data) 15 | { 16 | int sum = 0, data_len = strlen(data) - 1; 17 | for (int i = 0; i < data_len; ++ i) 18 | sum += data[i]; 19 | return sum & 0xff; 20 | } 21 | bool uart_write(char addr, char *data) 22 | { 23 | if (strlen(data) == 0) 24 | return false; 25 | char byteToWrite[101] = ""; 26 | byteToWrite[0] = 0x90, byteToWrite[1] = addr, byteToWrite[2] = strlen(data); 27 | strcat(byteToWrite, data); 28 | strcat(byteToWrite, " "); 29 | byteToWrite[strlen(byteToWrite)] = 0; 30 | byteToWrite[strlen(byteToWrite) - 1] = calc_checksum(byteToWrite); 31 | for (int i = 1; i <= 3; ++ i) 32 | uart_write_bytes(alphapi_uart_display_write_num, byteToWrite, 9); 33 | return true; 34 | } 35 | void alphapi_display_init() 36 | { 37 | ESP_ERROR_CHECK(uart_param_config(alphapi_uart_display_write_num, &uart_config)); 38 | ESP_ERROR_CHECK(uart_set_pin(alphapi_uart_display_write_num, 8, 9, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE)); 39 | // Setup UART buffered IO with event queue 40 | const int uart_buffer_size = (1024 * 2); 41 | QueueHandle_t uart_queue; 42 | // Install UART driver using an event queue here 43 | ESP_ERROR_CHECK(uart_driver_install(alphapi_uart_display_write_num, uart_buffer_size, uart_buffer_size, 10, &uart_queue, 0)); 44 | char alphapi_display_test[6] = {4, 4, 4, 4, 4}; 45 | uart_write(0x08, alphapi_display_test); 46 | } 47 | void led_show_matrix(char show_image[6][6]) 48 | { 49 | bool to_row[6][6]; 50 | char led_image_res[6] = {0, 0, 0, 0, 0}; 51 | for (int i = 0; i < 5; ++ i) 52 | for (int j = 0; j < 5; ++ j) 53 | { 54 | if (show_image[i][j] == '.') 55 | to_row[j][i] = 0; 56 | else if (show_image[i][j] == '#') 57 | to_row[j][i] = 1; 58 | else 59 | { 60 | printf("The provided image format is incorrect\n"); 61 | exit(1); 62 | } 63 | } 64 | for (int i = 0; i < 5; ++ i) 65 | { 66 | led_image_res[i] += to_row[i][4] * 0x08 + to_row[i][3] * 0x10 + to_row[i][2] * 0x20 + to_row[i][1] * 0x40 + to_row[i][0] * 0x80; 67 | if (led_image_res[i] == 0) led_image_res[i] = 0x04; 68 | } 69 | uart_write(0x08, led_image_res); 70 | } -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/esp-idf/alphapi_LED/main/sparkling_heart.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "freertos/FreeRTOS.h" 3 | #include "freertos/task.h" 4 | #include "alphapi.h" 5 | void app_main(void) 6 | { 7 | alphapi_display_init(); 8 | char image_shower[2][6][6] = {\ 9 | {".#.#.", \ 10 | "#####", \ 11 | "#####", \ 12 | ".###.", \ 13 | "..#.."},\ 14 | {".....", \ 15 | ".#.#.", \ 16 | ".###.", \ 17 | "..#..", \ 18 | "....."}}; 19 | while (1) 20 | { 21 | led_show_matrix(image_shower[0]); 22 | vTaskDelay(pdMS_TO_TICKS(500)); 23 | led_show_matrix(image_shower[1]); 24 | vTaskDelay(pdMS_TO_TICKS(500)); 25 | } 26 | } -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/micropython/Code containing library file/alpha_pi.py: -------------------------------------------------------------------------------- 1 | import machine 2 | import time 3 | from machine import SoftI2C, Pin 4 | 5 | uart = machine.UART(1, 460966, tx = 8, rx = 9, timeout=200) 6 | i2c = SoftI2C(scl=Pin(7), sda=Pin(6), freq=400000) 7 | 8 | number_map=[ 9 | bytearray([0xf8,0x88,0x88,0x88,0xF8]), 10 | bytearray([0,0,0xf8,0,0]), 11 | bytearray([0xb8,0xa8,0xa8,0xa8,0xe8]), 12 | bytearray([0xa8,0xa8,0xa8,0xa8,0xf8]), 13 | bytearray([0xe0,0x20,0x20,0x20,0xf8]), 14 | bytearray([0xe8,0xa8,0xa8,0xa8,0xb8]), 15 | bytearray([0xf8,0xa8,0xa8,0xa8,0xb8]), 16 | bytearray([0x80,0x80,0x80,0x80,0xf8]), 17 | bytearray([0xf8,0xa8,0xa8,0xa8,0xf8]), 18 | bytearray([0xe0,0xa0,0xa0,0xa0,0xf8]), 19 | ] 20 | letter_map=[] 21 | 22 | def calc_checksum(data : bytearray): 23 | sum = 0 24 | for i in range(0,len(data)-1): 25 | sum+=data[i] 26 | return sum&0xff 27 | 28 | def uart_write(addr, data:bytearray) -> num: 29 | #与国产MCU通信,格式为头帧0x90+地址+数据长度+数据+累加和校验值 30 | #如通信成功会返回3bytes数据b'\x91\x08\x05',有时通信会卡死,原因未知,连续写两次则必定成功,奇怪??? 31 | if(len(data)==0): 32 | return False 33 | byteToWrite = bytearray([0x90]) 34 | print(byteToWrite) 35 | byteToWrite.append(addr) 36 | print(byteToWrite) 37 | byteToWrite.append(len(data)) 38 | print(byteToWrite) 39 | byteToWrite.extend(data) 40 | print(byteToWrite) 41 | byteToWrite.append(0) 42 | print(byteToWrite) 43 | byteToWrite[len(byteToWrite)-1]=calc_checksum(byteToWrite) 44 | print(byteToWrite) 45 | for i in range(0,2): 46 | uart.write(byteToWrite) 47 | ansbytes = uart.read(3) 48 | try: 49 | if len(ansbytes)==3: 50 | return ansbytes[2] 51 | else: 52 | print("write error: ", ansbytes) 53 | return False 54 | except: 55 | pass 56 | 57 | def led_rect(): 58 | databytes = bytearray([0xf8,0xf8,0xf8,0x88,0xF8]) 59 | uart_write(0x08, databytes) 60 | return 61 | 62 | def led_array_demo(): 63 | databytes = bytearray([0xf8,0xf8,0xf8,0xf8,0xf8]) 64 | for i in range(0,10): 65 | for j in range(0,5): 66 | databytes[j]=databytes[j]<<1 67 | if databytes[j] == 0: 68 | databytes[j] = 0x08 69 | uart_write(0x08, databytes) 70 | time.sleep_ms(100) 71 | return 72 | 73 | def led_show_matrix(show_image): 74 | to_row = [[], [], [], [], []] 75 | led_image_res = [0, 0, 0, 0, 0] 76 | for i in range(5): 77 | for j in range(5): 78 | if show_image[i][j] == '.': 79 | to_row[j].append(0); 80 | elif show_image[i][j] == '#': 81 | to_row[j].append(1); 82 | else: raise TypeError('The provided image format is incorrect') 83 | for i in range(5): 84 | led_image_res[i] += to_row[i][4] * 0x08 + to_row[i][3] * 0x10 + to_row[i][2] * 0x20 + to_row[i][1] * 0x40 + to_row[i][0] * 0x80 85 | uart_write(0x08, bytearray(led_image_res)) -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/micropython/Code containing library file/main.py: -------------------------------------------------------------------------------- 1 | import alpha_pi as board 2 | import time 3 | board.led_show_matrix(['...##', 4 | '...#.', 5 | '..#..', 6 | '.#...', 7 | '#....']) -------------------------------------------------------------------------------- /example/04_LED(WITH SOURCE CODE)/micropython/main.py: -------------------------------------------------------------------------------- 1 | import machine 2 | import time 3 | from machine import SoftI2C, Pin 4 | 5 | uart = machine.UART(1, 460966, tx = 8, rx = 9, timeout=200) 6 | i2c = SoftI2C(scl=Pin(7), sda=Pin(6), freq=400000) 7 | 8 | number_map=[ 9 | bytearray([0xf8,0x88,0x88,0x88,0xF8]), 10 | bytearray([0,0,0xf8,0,0]), 11 | bytearray([0xb8,0xa8,0xa8,0xa8,0xe8]), 12 | bytearray([0xa8,0xa8,0xa8,0xa8,0xf8]), 13 | bytearray([0xe0,0x20,0x20,0x20,0xf8]), 14 | bytearray([0xe8,0xa8,0xa8,0xa8,0xb8]), 15 | bytearray([0xf8,0xa8,0xa8,0xa8,0xb8]), 16 | bytearray([0x80,0x80,0x80,0x80,0xf8]), 17 | bytearray([0xf8,0xa8,0xa8,0xa8,0xf8]), 18 | bytearray([0xe0,0xa0,0xa0,0xa0,0xf8]), 19 | ] 20 | letter_map=[] 21 | 22 | def calc_checksum(data : bytearray): 23 | sum = 0 24 | for i in range(0,len(data)-1): 25 | sum+=data[i] 26 | return sum&0xff 27 | 28 | def uart_write(addr, data:bytearray) -> num: 29 | #与国产MCU通信,格式为头帧0x90+地址+数据长度+数据+累加和校验值 30 | #如通信成功会返回3bytes数据b'\x91\x08\x05',有时通信会卡死,原因未知,连续写两次则必定成功,奇怪??? 31 | if(len(data)==0): 32 | return False 33 | byteToWrite = bytearray([0x90]) 34 | byteToWrite.append(addr) 35 | byteToWrite.append(len(data)) 36 | byteToWrite.extend(data) 37 | byteToWrite.append(0) 38 | byteToWrite[len(byteToWrite)-1]=calc_checksum(byteToWrite) 39 | for i in range(0,2): 40 | uart.write(byteToWrite) 41 | ansbytes = uart.read(3) 42 | try: 43 | if len(ansbytes)==3: 44 | return ansbytes[2] 45 | else: 46 | print("write error: ", ansbytes) 47 | return False 48 | except: 49 | pass 50 | 51 | def led_rect(): 52 | databytes = bytearray([0xf8,0xf8,0xf8,0x88,0xF8]) 53 | uart_write(0x08, databytes) 54 | return 55 | 56 | def led_array_demo(): 57 | databytes = bytearray([0xf8,0xf8,0xf8,0xf8,0xf8]) 58 | for i in range(0,10): 59 | for j in range(0,5): 60 | databytes[j]=databytes[j]<<1 61 | if databytes[j] == 0: 62 | databytes[j] = 0x08 63 | uart_write(0x08, databytes) 64 | time.sleep_ms(100) 65 | return 66 | 67 | def show_number(n): 68 | uart_write(0x08, number_map[n]) 69 | 70 | for i in range(0,10): 71 | show_number(i) 72 | time.sleep(0.5) 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /old/AlphaPi_flash_4MB.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/AlphaPi_flash_4MB.bin -------------------------------------------------------------------------------- /old/mpy_disassemble/actuator_led.mpy.txt: -------------------------------------------------------------------------------- 1 | mpy_source_file: rootfs/actuator_led.mpy 2 | source_file: .\actuator_led.py 3 | header: 4d:06:00:1f 4 | qstr_table[60]: 5 | .\actuator_led.py 6 | 7 | neopixel 8 | machine 9 | DataStruct 10 | basic 11 | InitNP 12 | NeoPixel 13 | Pin 14 | clear 15 | n 16 | insert 17 | write 18 | BrightnessUp 19 | IntValue 20 | SetBrightness 21 | UpdateBrightness 22 | GetBrightness 23 | ShowRainbow 24 | setPixelColorWithoutWrightRGBOne 25 | setPixelColorWithoutWright 26 | setPixelColor 27 | pixelMove 28 | append 29 | pixelShowU 30 | clamp 31 | hsl 32 | packRGB 33 | packRGBd 34 | unpackR 35 | unpackG 36 | unpackB 37 | version 38 | brightness 39 | np 40 | rawRGB 41 | pin_port 42 | br_d 43 | index 44 | rgb 45 | r 46 | g 47 | b 48 | index_d 49 | rgb_d 50 | step_d 51 | towards 52 | value_d 53 | max_value_d 54 | minValue 55 | maxValue 56 | value 57 | h 58 | s 59 | l 60 | round 61 | abs 62 | r_d 63 | g_d 64 | b_d 65 | obj_table: [(0, 0, 0), 'v_2020_7_30'] 66 | simple_name: 67 | raw bytecode: 157 08:56:01:26:26:4c:23:23:64:84:0a:84:08:84:07:84:0d:64:20:84:21:84:07:84:10:84:0b:84:16:84:18:84:08:84:2e:64:20:84:07:64:40:64:40:64:40:80:51:1b:02:16:02:80:51:1b:03:16:03:80:10:04:2a:01:1b:05:1c:04:16:04:59:8a:17:21:51:17:22:2b:00:16:23:32:00:16:06:32:01:16:0d:32:02:16:0f:32:03:16:10:32:04:16:11:32:05:16:12:32:06:16:13:32:07:16:14:32:08:16:15:32:09:16:16:32:0a:16:18:32:0b:16:19:32:0c:16:1a:32:0d:16:1b:32:0e:16:1c:32:0f:16:1d:32:10:16:1e:32:11:16:1f:32:12:16:20:51:63 68 | prelude: n_state=2, n_exc_stack=0, scope_flags=0, n_pos_args=0, n_kwonly_args=0, n_def_pos_args=0 69 | args: [] 70 | line info: 26:26:4c:23:23:64:84:0a:84:08:84:07:84:0d:64:20:84:21:84:07:84:10:84:0b:84:16:84:18:84:08:84:2e:64:20:84:07:64:40:64:40:64:40 71 | 80 LOAD_CONST_SMALL_INT 0 72 | 51 LOAD_CONST_NONE 73 | 1b:02 IMPORT_NAME neopixel 74 | 16:02 STORE_NAME neopixel 75 | 80 LOAD_CONST_SMALL_INT 0 76 | 51 LOAD_CONST_NONE 77 | 1b:03 IMPORT_NAME machine 78 | 16:03 STORE_NAME machine 79 | 80 LOAD_CONST_SMALL_INT 0 80 | 10:04 LOAD_CONST_STRING DataStruct 81 | 2a:01 BUILD_TUPLE 1 82 | 1b:05 IMPORT_NAME basic 83 | 1c:04 IMPORT_FROM DataStruct 84 | 16:04 STORE_NAME DataStruct 85 | 59 POP_TOP 86 | 8a LOAD_CONST_SMALL_INT 10 87 | 17:21 STORE_GLOBAL brightness 88 | 51 LOAD_CONST_NONE 89 | 17:22 STORE_GLOBAL np 90 | 2b:00 BUILD_LIST 0 91 | 16:23 STORE_NAME rawRGB 92 | 32:00 MAKE_FUNCTION 0 93 | 16:06 STORE_NAME InitNP 94 | 32:01 MAKE_FUNCTION 1 95 | 16:0d STORE_NAME BrightnessUp 96 | 32:02 MAKE_FUNCTION 2 97 | 16:0f STORE_NAME SetBrightness 98 | 32:03 MAKE_FUNCTION 3 99 | 16:10 STORE_NAME UpdateBrightness 100 | 32:04 MAKE_FUNCTION 4 101 | 16:11 STORE_NAME GetBrightness 102 | 32:05 MAKE_FUNCTION 5 103 | 16:12 STORE_NAME ShowRainbow 104 | 32:06 MAKE_FUNCTION 6 105 | 16:13 STORE_NAME setPixelColorWithoutWrightRGBOne 106 | 32:07 MAKE_FUNCTION 7 107 | 16:14 STORE_NAME setPixelColorWithoutWright 108 | 32:08 MAKE_FUNCTION 8 109 | 16:15 STORE_NAME setPixelColor 110 | 32:09 MAKE_FUNCTION 9 111 | 16:16 STORE_NAME pixelMove 112 | 32:0a MAKE_FUNCTION 10 113 | 16:18 STORE_NAME pixelShowU 114 | 32:0b MAKE_FUNCTION 11 115 | 16:19 STORE_NAME clamp 116 | 32:0c MAKE_FUNCTION 12 117 | 16:1a STORE_NAME hsl 118 | 32:0d MAKE_FUNCTION 13 119 | 16:1b STORE_NAME packRGB 120 | 32:0e MAKE_FUNCTION 14 121 | 16:1c STORE_NAME packRGBd 122 | 32:0f MAKE_FUNCTION 15 123 | 16:1d STORE_NAME unpackR 124 | 32:10 MAKE_FUNCTION 16 125 | 16:1e STORE_NAME unpackG 126 | 32:11 MAKE_FUNCTION 17 127 | 16:1f STORE_NAME unpackB 128 | 32:12 MAKE_FUNCTION 18 129 | 16:20 STORE_NAME version 130 | 51 LOAD_CONST_NONE 131 | 63 RETURN_VALUE 132 | children: ['InitNP', 'BrightnessUp', 'SetBrightness', 'UpdateBrightness', 'GetBrightness', 'ShowRainbow', 'setPixelColorWithoutWrightRGBOne', 'setPixelColorWithoutWright', 'setPixelColor', 'pixelMove', 'pixelShowU', 'clamp', 'hsl', 'packRGB', 'packRGBd', 'unpackR', 'unpackG', 'unpackB', 'version'] 133 | simple_name: InitNP 134 | raw bytecode: 78 39:14:06:24:80:0a:20:30:27:29:2a:2f:12:02:14:07:12:03:14:08:b0:36:01:8e:36:02:17:22:12:23:14:09:36:00:59:12:22:13:0a:80:42:54:57:c1:12:23:14:0b:b1:23:00:36:02:59:23:00:12:22:b1:56:81:e5:58:5a:d7:43:27:59:59:12:22:14:0c:36:00:59:51:63 135 | prelude: n_state=8, n_exc_stack=0, scope_flags=0, n_pos_args=1, n_kwonly_args=0, n_def_pos_args=0 136 | args: ['pin_port'] 137 | line info: 80:0a:20:30:27:29:2a:2f 138 | 12:02 LOAD_GLOBAL neopixel 139 | 14:07 LOAD_METHOD NeoPixel 140 | 12:03 LOAD_GLOBAL machine 141 | 14:08 LOAD_METHOD Pin 142 | b0 LOAD_FAST 0 143 | 36:01 CALL_METHOD 1 144 | 8e LOAD_CONST_SMALL_INT 14 145 | 36:02 CALL_METHOD 2 146 | 17:22 STORE_GLOBAL np 147 | 12:23 LOAD_GLOBAL rawRGB 148 | 14:09 LOAD_METHOD clear 149 | 36:00 CALL_METHOD 0 150 | 59 POP_TOP 151 | 12:22 LOAD_GLOBAL np 152 | 13:0a LOAD_ATTR n 153 | 80 LOAD_CONST_SMALL_INT 0 154 | 42:54 JUMP 20 155 | 57 DUP_TOP 156 | c1 STORE_FAST 1 157 | 12:23 LOAD_GLOBAL rawRGB 158 | 14:0b LOAD_METHOD insert 159 | b1 LOAD_FAST 1 160 | 23:00 LOAD_CONST_OBJ (0, 0, 0) 161 | 36:02 CALL_METHOD 2 162 | 59 POP_TOP 163 | 23:00 LOAD_CONST_OBJ (0, 0, 0) 164 | 12:22 LOAD_GLOBAL np 165 | b1 LOAD_FAST 1 166 | 56 STORE_SUBSCR 167 | 81 LOAD_CONST_SMALL_INT 1 168 | e5 BINARY_OP 14 __iadd__ 169 | 58 DUP_TOP_TWO 170 | 5a ROT_TWO 171 | d7 BINARY_OP 0 __lt__ 172 | 43:27 POP_JUMP_IF_TRUE -25 173 | 59 POP_TOP 174 | 59 POP_TOP 175 | 12:22 LOAD_GLOBAL np 176 | 14:0c LOAD_METHOD write 177 | 36:00 CALL_METHOD 0 178 | 59 POP_TOP 179 | 51 LOAD_CONST_NONE 180 | 63 RETURN_VALUE 181 | children: [] 182 | simple_name: BrightnessUp 183 | raw bytecode: 41 29:10:0d:25:80:14:26:20:26:2c:b0:14:0e:36:00:c1:12:21:b1:e5:17:21:12:19:80:22:80:64:12:21:34:03:17:21:12:10:34:00:59:51:63 184 | prelude: n_state=6, n_exc_stack=0, scope_flags=0, n_pos_args=1, n_kwonly_args=0, n_def_pos_args=0 185 | args: ['br_d'] 186 | line info: 80:14:26:20:26:2c 187 | b0 LOAD_FAST 0 188 | 14:0e LOAD_METHOD IntValue 189 | 36:00 CALL_METHOD 0 190 | c1 STORE_FAST 1 191 | 12:21 LOAD_GLOBAL brightness 192 | b1 LOAD_FAST 1 193 | e5 BINARY_OP 14 __iadd__ 194 | 17:21 STORE_GLOBAL brightness 195 | 12:19 LOAD_GLOBAL clamp 196 | 80 LOAD_CONST_SMALL_INT 0 197 | 22:80:64 LOAD_CONST_SMALL_INT 100 198 | 12:21 LOAD_GLOBAL brightness 199 | 34:03 CALL_FUNCTION 3 200 | 17:21 STORE_GLOBAL brightness 201 | 12:10 LOAD_GLOBAL UpdateBrightness 202 | 34:00 CALL_FUNCTION 0 203 | 59 POP_TOP 204 | 51 LOAD_CONST_NONE 205 | 63 RETURN_VALUE 206 | children: [] 207 | simple_name: SetBrightness 208 | raw bytecode: 33 29:0e:0f:25:80:1c:26:20:2b:b0:14:0e:36:00:c1:12:19:80:22:80:64:b1:34:03:17:21:12:10:34:00:59:51:63 209 | prelude: n_state=6, n_exc_stack=0, scope_flags=0, n_pos_args=1, n_kwonly_args=0, n_def_pos_args=0 210 | args: ['br_d'] 211 | line info: 80:1c:26:20:2b 212 | b0 LOAD_FAST 0 213 | 14:0e LOAD_METHOD IntValue 214 | 36:00 CALL_METHOD 0 215 | c1 STORE_FAST 1 216 | 12:19 LOAD_GLOBAL clamp 217 | 80 LOAD_CONST_SMALL_INT 0 218 | 22:80:64 LOAD_CONST_SMALL_INT 100 219 | b1 LOAD_FAST 1 220 | 34:03 CALL_FUNCTION 3 221 | 17:21 STORE_GLOBAL brightness 222 | 12:10 LOAD_GLOBAL UpdateBrightness 223 | 34:00 CALL_FUNCTION 0 224 | 59 POP_TOP 225 | 51 LOAD_CONST_NONE 226 | 63 RETURN_VALUE 227 | children: [] 228 | simple_name: UpdateBrightness 229 | raw bytecode: 88 48:18:10:80:23:20:2b:20:29:29:26:26:26:32:12:21:22:81:7f:f4:22:80:64:f6:c0:12:22:13:0a:80:42:68:57:c1:12:23:b1:55:30:03:c2:c3:c4:b2:b0:f4:88:f1:c2:b3:b0:f4:88:f1:c3:b4:b0:f4:88:f1:c4:b2:b3:b4:2a:03:12:22:b1:56:81:e5:58:5a:d7:43:13:59:59:12:22:14:0c:36:00:59:51:63 230 | prelude: n_state=10, n_exc_stack=0, scope_flags=0, n_pos_args=0, n_kwonly_args=0, n_def_pos_args=0 231 | args: [] 232 | line info: 80:23:20:2b:20:29:29:26:26:26:32 233 | 12:21 LOAD_GLOBAL brightness 234 | 22:81:7f LOAD_CONST_SMALL_INT 255 235 | f4 BINARY_OP 29 __mul__ 236 | 22:80:64 LOAD_CONST_SMALL_INT 100 237 | f6 BINARY_OP 31 __floordiv__ 238 | c0 STORE_FAST 0 239 | 12:22 LOAD_GLOBAL np 240 | 13:0a LOAD_ATTR n 241 | 80 LOAD_CONST_SMALL_INT 0 242 | 42:68 JUMP 40 243 | 57 DUP_TOP 244 | c1 STORE_FAST 1 245 | 12:23 LOAD_GLOBAL rawRGB 246 | b1 LOAD_FAST 1 247 | 55 LOAD_SUBSCR 248 | 30:03 UNPACK_SEQUENCE 3 249 | c2 STORE_FAST 2 250 | c3 STORE_FAST 3 251 | c4 STORE_FAST 4 252 | b2 LOAD_FAST 2 253 | b0 LOAD_FAST 0 254 | f4 BINARY_OP 29 __mul__ 255 | 88 LOAD_CONST_SMALL_INT 8 256 | f1 BINARY_OP 26 __rshift__ 257 | c2 STORE_FAST 2 258 | b3 LOAD_FAST 3 259 | b0 LOAD_FAST 0 260 | f4 BINARY_OP 29 __mul__ 261 | 88 LOAD_CONST_SMALL_INT 8 262 | f1 BINARY_OP 26 __rshift__ 263 | c3 STORE_FAST 3 264 | b4 LOAD_FAST 4 265 | b0 LOAD_FAST 0 266 | f4 BINARY_OP 29 __mul__ 267 | 88 LOAD_CONST_SMALL_INT 8 268 | f1 BINARY_OP 26 __rshift__ 269 | c4 STORE_FAST 4 270 | b2 LOAD_FAST 2 271 | b3 LOAD_FAST 3 272 | b4 LOAD_FAST 4 273 | 2a:03 BUILD_TUPLE 3 274 | 12:22 LOAD_GLOBAL np 275 | b1 LOAD_FAST 1 276 | 56 STORE_SUBSCR 277 | 81 LOAD_CONST_SMALL_INT 1 278 | e5 BINARY_OP 14 __iadd__ 279 | 58 DUP_TOP_TWO 280 | 5a ROT_TWO 281 | d7 BINARY_OP 0 __lt__ 282 | 43:13 POP_JUMP_IF_TRUE -45 283 | 59 POP_TOP 284 | 59 POP_TOP 285 | 12:22 LOAD_GLOBAL np 286 | 14:0c LOAD_METHOD write 287 | 36:00 CALL_METHOD 0 288 | 59 POP_TOP 289 | 51 LOAD_CONST_NONE 290 | 63 RETURN_VALUE 291 | children: [] 292 | simple_name: GetBrightness 293 | raw bytecode: 8 00:06:11:80:30:12:21:63 294 | prelude: n_state=1, n_exc_stack=0, scope_flags=0, n_pos_args=0, n_kwonly_args=0, n_def_pos_args=0 295 | args: [] 296 | line info: 80:30 297 | 12:21 LOAD_GLOBAL brightness 298 | 63 RETURN_VALUE 299 | children: [] 300 | simple_name: ShowRainbow 301 | raw bytecode: 250 f0:10:40:12:80:34:20:25:25:22:22:24:2c:28:22:26:24:24:24:24:24:26:23:23:23:25:26:27:2d:2a:30:2c:2e:3b:2f:12:22:13:0a:c0:b0:80:da:44:42:51:63:81:c1:22:82:68:c2:b2:22:82:68:f2:b1:f3:22:82:68:f8:c3:b3:22:80:64:f4:b0:f6:c4:b4:c5:b1:22:80:64:f4:c6:22:80:64:c7:22:80:64:c8:22:80:64:c9:b9:b8:f3:ca:ba:b0:f6:cb:b8:22:80:64:f4:cc:22:32:cd:22:32:ce:22:32:cf:bf:be:f3:26:10:24:10:b0:f6:26:11:be:22:80:64:f4:26:12:12:13:80:12:1a:b1:b7:bd:34:03:34:02:59:b0:81:f3:81:42:c0:80:57:26:13:b6:24:13:b5:f4:f2:22:80:64:f6:22:82:68:f2:26:14:bc:24:13:bb:f4:f2:22:80:64:f6:26:15:24:12:24:13:24:11:f4:f2:22:80:64:f6:26:16:12:13:24:13:12:1a:24:14:24:15:24:16:34:03:34:02:59:81:e5:58:5a:d7:43:ba:7f:59:59:12:13:b0:81:f3:12:1a:b2:b7:bd:34:03:34:02:59:12:22:14:0c:36:00:59:51:63 302 | prelude: n_state=31, n_exc_stack=0, scope_flags=0, n_pos_args=0, n_kwonly_args=0, n_def_pos_args=0 303 | args: [] 304 | line info: 80:34:20:25:25:22:22:24:2c:28:22:26:24:24:24:24:24:26:23:23:23:25:26:27:2d:2a:30:2c:2e:3b:2f 305 | 12:22 LOAD_GLOBAL np 306 | 13:0a LOAD_ATTR n 307 | c0 STORE_FAST 0 308 | b0 LOAD_FAST 0 309 | 80 LOAD_CONST_SMALL_INT 0 310 | da BINARY_OP 3 __le__ 311 | 44:42 POP_JUMP_IF_FALSE 2 312 | 51 LOAD_CONST_NONE 313 | 63 RETURN_VALUE 314 | 81 LOAD_CONST_SMALL_INT 1 315 | c1 STORE_FAST 1 316 | 22:82:68 LOAD_CONST_SMALL_INT 360 317 | c2 STORE_FAST 2 318 | b2 LOAD_FAST 2 319 | 22:82:68 LOAD_CONST_SMALL_INT 360 320 | f2 BINARY_OP 27 __add__ 321 | b1 LOAD_FAST 1 322 | f3 BINARY_OP 28 __sub__ 323 | 22:82:68 LOAD_CONST_SMALL_INT 360 324 | f8 BINARY_OP 33 __mod__ 325 | c3 STORE_FAST 3 326 | b3 LOAD_FAST 3 327 | 22:80:64 LOAD_CONST_SMALL_INT 100 328 | f4 BINARY_OP 29 __mul__ 329 | b0 LOAD_FAST 0 330 | f6 BINARY_OP 31 __floordiv__ 331 | c4 STORE_FAST 4 332 | b4 LOAD_FAST 4 333 | c5 STORE_FAST 5 334 | b1 LOAD_FAST 1 335 | 22:80:64 LOAD_CONST_SMALL_INT 100 336 | f4 BINARY_OP 29 __mul__ 337 | c6 STORE_FAST 6 338 | 22:80:64 LOAD_CONST_SMALL_INT 100 339 | c7 STORE_FAST 7 340 | 22:80:64 LOAD_CONST_SMALL_INT 100 341 | c8 STORE_FAST 8 342 | 22:80:64 LOAD_CONST_SMALL_INT 100 343 | c9 STORE_FAST 9 344 | b9 LOAD_FAST 9 345 | b8 LOAD_FAST 8 346 | f3 BINARY_OP 28 __sub__ 347 | ca STORE_FAST 10 348 | ba LOAD_FAST 10 349 | b0 LOAD_FAST 0 350 | f6 BINARY_OP 31 __floordiv__ 351 | cb STORE_FAST 11 352 | b8 LOAD_FAST 8 353 | 22:80:64 LOAD_CONST_SMALL_INT 100 354 | f4 BINARY_OP 29 __mul__ 355 | cc STORE_FAST 12 356 | 22:32 LOAD_CONST_SMALL_INT 50 357 | cd STORE_FAST 13 358 | 22:32 LOAD_CONST_SMALL_INT 50 359 | ce STORE_FAST 14 360 | 22:32 LOAD_CONST_SMALL_INT 50 361 | cf STORE_FAST 15 362 | bf LOAD_FAST 15 363 | be LOAD_FAST 14 364 | f3 BINARY_OP 28 __sub__ 365 | 26:10 STORE_FAST_N 16 366 | 24:10 LOAD_FAST_N 16 367 | b0 LOAD_FAST 0 368 | f6 BINARY_OP 31 __floordiv__ 369 | 26:11 STORE_FAST_N 17 370 | be LOAD_FAST 14 371 | 22:80:64 LOAD_CONST_SMALL_INT 100 372 | f4 BINARY_OP 29 __mul__ 373 | 26:12 STORE_FAST_N 18 374 | 12:13 LOAD_GLOBAL setPixelColorWithoutWrightRGBOne 375 | 80 LOAD_CONST_SMALL_INT 0 376 | 12:1a LOAD_GLOBAL hsl 377 | b1 LOAD_FAST 1 378 | b7 LOAD_FAST 7 379 | bd LOAD_FAST 13 380 | 34:03 CALL_FUNCTION 3 381 | 34:02 CALL_FUNCTION 2 382 | 59 POP_TOP 383 | b0 LOAD_FAST 0 384 | 81 LOAD_CONST_SMALL_INT 1 385 | f3 BINARY_OP 28 __sub__ 386 | 81 LOAD_CONST_SMALL_INT 1 387 | 42:c0:80 JUMP 64 388 | 57 DUP_TOP 389 | 26:13 STORE_FAST_N 19 390 | b6 LOAD_FAST 6 391 | 24:13 LOAD_FAST_N 19 392 | b5 LOAD_FAST 5 393 | f4 BINARY_OP 29 __mul__ 394 | f2 BINARY_OP 27 __add__ 395 | 22:80:64 LOAD_CONST_SMALL_INT 100 396 | f6 BINARY_OP 31 __floordiv__ 397 | 22:82:68 LOAD_CONST_SMALL_INT 360 398 | f2 BINARY_OP 27 __add__ 399 | 26:14 STORE_FAST_N 20 400 | bc LOAD_FAST 12 401 | 24:13 LOAD_FAST_N 19 402 | bb LOAD_FAST 11 403 | f4 BINARY_OP 29 __mul__ 404 | f2 BINARY_OP 27 __add__ 405 | 22:80:64 LOAD_CONST_SMALL_INT 100 406 | f6 BINARY_OP 31 __floordiv__ 407 | 26:15 STORE_FAST_N 21 408 | 24:12 LOAD_FAST_N 18 409 | 24:13 LOAD_FAST_N 19 410 | 24:11 LOAD_FAST_N 17 411 | f4 BINARY_OP 29 __mul__ 412 | f2 BINARY_OP 27 __add__ 413 | 22:80:64 LOAD_CONST_SMALL_INT 100 414 | f6 BINARY_OP 31 __floordiv__ 415 | 26:16 STORE_FAST_N 22 416 | 12:13 LOAD_GLOBAL setPixelColorWithoutWrightRGBOne 417 | 24:13 LOAD_FAST_N 19 418 | 12:1a LOAD_GLOBAL hsl 419 | 24:14 LOAD_FAST_N 20 420 | 24:15 LOAD_FAST_N 21 421 | 24:16 LOAD_FAST_N 22 422 | 34:03 CALL_FUNCTION 3 423 | 34:02 CALL_FUNCTION 2 424 | 59 POP_TOP 425 | 81 LOAD_CONST_SMALL_INT 1 426 | e5 BINARY_OP 14 __iadd__ 427 | 58 DUP_TOP_TWO 428 | 5a ROT_TWO 429 | d7 BINARY_OP 0 __lt__ 430 | 43:ba:7f POP_JUMP_IF_TRUE -70 431 | 59 POP_TOP 432 | 59 POP_TOP 433 | 12:13 LOAD_GLOBAL setPixelColorWithoutWrightRGBOne 434 | b0 LOAD_FAST 0 435 | 81 LOAD_CONST_SMALL_INT 1 436 | f3 BINARY_OP 28 __sub__ 437 | 12:1a LOAD_GLOBAL hsl 438 | b2 LOAD_FAST 2 439 | b7 LOAD_FAST 7 440 | bd LOAD_FAST 13 441 | 34:03 CALL_FUNCTION 3 442 | 34:02 CALL_FUNCTION 2 443 | 59 POP_TOP 444 | 12:22 LOAD_GLOBAL np 445 | 14:0c LOAD_METHOD write 446 | 36:00 CALL_METHOD 0 447 | 59 POP_TOP 448 | 51 LOAD_CONST_NONE 449 | 63 RETURN_VALUE 450 | children: [] 451 | simple_name: setPixelColorWithoutWrightRGBOne 452 | raw bytecode: 39 4a:10:13:26:27:80:55:26:26:26:12:1d:b1:34:01:c2:12:1e:b1:34:01:c3:12:1f:b1:34:01:c4:12:14:b0:b2:b3:b4:34:04:59:51:63 453 | prelude: n_state=10, n_exc_stack=0, scope_flags=0, n_pos_args=2, n_kwonly_args=0, n_def_pos_args=0 454 | args: ['index', 'rgb'] 455 | line info: 80:55:26:26:26 456 | 12:1d LOAD_GLOBAL unpackR 457 | b1 LOAD_FAST 1 458 | 34:01 CALL_FUNCTION 1 459 | c2 STORE_FAST 2 460 | 12:1e LOAD_GLOBAL unpackG 461 | b1 LOAD_FAST 1 462 | 34:01 CALL_FUNCTION 1 463 | c3 STORE_FAST 3 464 | 12:1f LOAD_GLOBAL unpackB 465 | b1 LOAD_FAST 1 466 | 34:01 CALL_FUNCTION 1 467 | c4 STORE_FAST 4 468 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 469 | b0 LOAD_FAST 0 470 | b2 LOAD_FAST 2 471 | b3 LOAD_FAST 3 472 | b4 LOAD_FAST 4 473 | 34:04 CALL_FUNCTION 4 474 | 59 POP_TOP 475 | 51 LOAD_CONST_NONE 476 | 63 RETURN_VALUE 477 | children: [] 478 | simple_name: setPixelColorWithoutWright 479 | raw bytecode: 116 e8:04:24:14:26:28:29:2a:80:5c:20:20:2b:26:26:26:28:29:29:54:29:12:21:22:81:7f:f4:22:80:64:f6:c4:b1:b4:f4:88:f1:c5:b2:b4:f4:88:f1:c6:b3:b4:f4:88:f1:c7:b0:12:22:13:0a:db:44:66:12:22:13:0a:80:42:56:57:c8:b5:b6:b7:2a:03:12:22:b8:56:b1:b2:b3:2a:03:12:23:b8:56:81:e5:58:5a:d7:43:25:59:59:42:52:b5:b6:b7:2a:03:12:22:b0:56:b1:b2:b3:2a:03:12:23:b0:56:51:63 480 | prelude: n_state=14, n_exc_stack=0, scope_flags=0, n_pos_args=4, n_kwonly_args=0, n_def_pos_args=0 481 | args: ['index', 'r', 'g', 'b'] 482 | line info: 80:5c:20:20:2b:26:26:26:28:29:29:54:29 483 | 12:21 LOAD_GLOBAL brightness 484 | 22:81:7f LOAD_CONST_SMALL_INT 255 485 | f4 BINARY_OP 29 __mul__ 486 | 22:80:64 LOAD_CONST_SMALL_INT 100 487 | f6 BINARY_OP 31 __floordiv__ 488 | c4 STORE_FAST 4 489 | b1 LOAD_FAST 1 490 | b4 LOAD_FAST 4 491 | f4 BINARY_OP 29 __mul__ 492 | 88 LOAD_CONST_SMALL_INT 8 493 | f1 BINARY_OP 26 __rshift__ 494 | c5 STORE_FAST 5 495 | b2 LOAD_FAST 2 496 | b4 LOAD_FAST 4 497 | f4 BINARY_OP 29 __mul__ 498 | 88 LOAD_CONST_SMALL_INT 8 499 | f1 BINARY_OP 26 __rshift__ 500 | c6 STORE_FAST 6 501 | b3 LOAD_FAST 3 502 | b4 LOAD_FAST 4 503 | f4 BINARY_OP 29 __mul__ 504 | 88 LOAD_CONST_SMALL_INT 8 505 | f1 BINARY_OP 26 __rshift__ 506 | c7 STORE_FAST 7 507 | b0 LOAD_FAST 0 508 | 12:22 LOAD_GLOBAL np 509 | 13:0a LOAD_ATTR n 510 | db BINARY_OP 4 __ge__ 511 | 44:66 POP_JUMP_IF_FALSE 38 512 | 12:22 LOAD_GLOBAL np 513 | 13:0a LOAD_ATTR n 514 | 80 LOAD_CONST_SMALL_INT 0 515 | 42:56 JUMP 22 516 | 57 DUP_TOP 517 | c8 STORE_FAST 8 518 | b5 LOAD_FAST 5 519 | b6 LOAD_FAST 6 520 | b7 LOAD_FAST 7 521 | 2a:03 BUILD_TUPLE 3 522 | 12:22 LOAD_GLOBAL np 523 | b8 LOAD_FAST 8 524 | 56 STORE_SUBSCR 525 | b1 LOAD_FAST 1 526 | b2 LOAD_FAST 2 527 | b3 LOAD_FAST 3 528 | 2a:03 BUILD_TUPLE 3 529 | 12:23 LOAD_GLOBAL rawRGB 530 | b8 LOAD_FAST 8 531 | 56 STORE_SUBSCR 532 | 81 LOAD_CONST_SMALL_INT 1 533 | e5 BINARY_OP 14 __iadd__ 534 | 58 DUP_TOP_TWO 535 | 5a ROT_TWO 536 | d7 BINARY_OP 0 __lt__ 537 | 43:25 POP_JUMP_IF_TRUE -27 538 | 59 POP_TOP 539 | 59 POP_TOP 540 | 42:52 JUMP 18 541 | b5 LOAD_FAST 5 542 | b6 LOAD_FAST 6 543 | b7 LOAD_FAST 7 544 | 2a:03 BUILD_TUPLE 3 545 | 12:22 LOAD_GLOBAL np 546 | b0 LOAD_FAST 0 547 | 56 STORE_SUBSCR 548 | b1 LOAD_FAST 1 549 | b2 LOAD_FAST 2 550 | b3 LOAD_FAST 3 551 | 2a:03 BUILD_TUPLE 3 552 | 12:23 LOAD_GLOBAL rawRGB 553 | b0 LOAD_FAST 0 554 | 56 STORE_SUBSCR 555 | 51 LOAD_CONST_NONE 556 | 63 RETURN_VALUE 557 | children: [] 558 | simple_name: setPixelColor 559 | raw bytecode: 62 5a:18:15:2b:2c:80:6c:20:26:26:26:26:26:29:b0:14:0e:36:00:c2:b1:14:0e:36:00:c3:12:1d:b3:34:01:c4:12:1e:b3:34:01:c5:12:1f:b3:34:01:c6:12:14:b2:b4:b5:b6:34:04:59:12:22:14:0c:36:00:59:51:63 560 | prelude: n_state=12, n_exc_stack=0, scope_flags=0, n_pos_args=2, n_kwonly_args=0, n_def_pos_args=0 561 | args: ['index_d', 'rgb_d'] 562 | line info: 80:6c:20:26:26:26:26:26:29 563 | b0 LOAD_FAST 0 564 | 14:0e LOAD_METHOD IntValue 565 | 36:00 CALL_METHOD 0 566 | c2 STORE_FAST 2 567 | b1 LOAD_FAST 1 568 | 14:0e LOAD_METHOD IntValue 569 | 36:00 CALL_METHOD 0 570 | c3 STORE_FAST 3 571 | 12:1d LOAD_GLOBAL unpackR 572 | b3 LOAD_FAST 3 573 | 34:01 CALL_FUNCTION 1 574 | c4 STORE_FAST 4 575 | 12:1e LOAD_GLOBAL unpackG 576 | b3 LOAD_FAST 3 577 | 34:01 CALL_FUNCTION 1 578 | c5 STORE_FAST 5 579 | 12:1f LOAD_GLOBAL unpackB 580 | b3 LOAD_FAST 3 581 | 34:01 CALL_FUNCTION 1 582 | c6 STORE_FAST 6 583 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 584 | b2 LOAD_FAST 2 585 | b4 LOAD_FAST 4 586 | b5 LOAD_FAST 5 587 | b6 LOAD_FAST 6 588 | 34:04 CALL_FUNCTION 4 589 | 59 POP_TOP 590 | 12:22 LOAD_GLOBAL np 591 | 14:0c LOAD_METHOD write 592 | 36:00 CALL_METHOD 0 593 | 59 POP_TOP 594 | 51 LOAD_CONST_NONE 595 | 63 RETURN_VALUE 596 | children: [] 597 | simple_name: pixelMove 598 | raw bytecode: 178 62:2e:16:2d:2e:80:77:26:20:27:25:22:23:23:2b:2a:33:2b:26:2a:2b:25:2b:27:31:b0:14:0e:36:00:c2:b2:12:22:13:0a:f8:c2:b2:80:d9:44:42:51:63:2b:00:c3:2b:00:c4:12:22:13:0a:82:f3:80:42:58:57:c5:b3:14:17:12:22:b5:55:36:01:59:b4:14:17:12:23:b5:55:36:01:59:81:e5:58:5a:d7:43:23:59:59:12:22:13:0a:82:f3:80:42:7d:57:c5:b5:b2:b1:f4:f3:c6:b6:12:22:13:0a:82:f3:db:44:4b:b6:12:22:13:0a:82:f3:e6:c6:42:50:b6:80:d7:44:4b:b6:12:22:13:0a:82:f3:e5:c6:42:40:b3:b6:55:12:22:b5:56:b4:b6:55:12:23:b5:56:81:e5:58:5a:d7:43:bd:7f:59:59:12:22:14:0c:36:00:59:51:63 599 | prelude: n_state=13, n_exc_stack=0, scope_flags=0, n_pos_args=2, n_kwonly_args=0, n_def_pos_args=0 600 | args: ['step_d', 'towards'] 601 | line info: 80:77:26:20:27:25:22:23:23:2b:2a:33:2b:26:2a:2b:25:2b:27:31 602 | b0 LOAD_FAST 0 603 | 14:0e LOAD_METHOD IntValue 604 | 36:00 CALL_METHOD 0 605 | c2 STORE_FAST 2 606 | b2 LOAD_FAST 2 607 | 12:22 LOAD_GLOBAL np 608 | 13:0a LOAD_ATTR n 609 | f8 BINARY_OP 33 __mod__ 610 | c2 STORE_FAST 2 611 | b2 LOAD_FAST 2 612 | 80 LOAD_CONST_SMALL_INT 0 613 | d9 BINARY_OP 2 __eq__ 614 | 44:42 POP_JUMP_IF_FALSE 2 615 | 51 LOAD_CONST_NONE 616 | 63 RETURN_VALUE 617 | 2b:00 BUILD_LIST 0 618 | c3 STORE_FAST 3 619 | 2b:00 BUILD_LIST 0 620 | c4 STORE_FAST 4 621 | 12:22 LOAD_GLOBAL np 622 | 13:0a LOAD_ATTR n 623 | 82 LOAD_CONST_SMALL_INT 2 624 | f3 BINARY_OP 28 __sub__ 625 | 80 LOAD_CONST_SMALL_INT 0 626 | 42:58 JUMP 24 627 | 57 DUP_TOP 628 | c5 STORE_FAST 5 629 | b3 LOAD_FAST 3 630 | 14:17 LOAD_METHOD append 631 | 12:22 LOAD_GLOBAL np 632 | b5 LOAD_FAST 5 633 | 55 LOAD_SUBSCR 634 | 36:01 CALL_METHOD 1 635 | 59 POP_TOP 636 | b4 LOAD_FAST 4 637 | 14:17 LOAD_METHOD append 638 | 12:23 LOAD_GLOBAL rawRGB 639 | b5 LOAD_FAST 5 640 | 55 LOAD_SUBSCR 641 | 36:01 CALL_METHOD 1 642 | 59 POP_TOP 643 | 81 LOAD_CONST_SMALL_INT 1 644 | e5 BINARY_OP 14 __iadd__ 645 | 58 DUP_TOP_TWO 646 | 5a ROT_TWO 647 | d7 BINARY_OP 0 __lt__ 648 | 43:23 POP_JUMP_IF_TRUE -29 649 | 59 POP_TOP 650 | 59 POP_TOP 651 | 12:22 LOAD_GLOBAL np 652 | 13:0a LOAD_ATTR n 653 | 82 LOAD_CONST_SMALL_INT 2 654 | f3 BINARY_OP 28 __sub__ 655 | 80 LOAD_CONST_SMALL_INT 0 656 | 42:7d JUMP 61 657 | 57 DUP_TOP 658 | c5 STORE_FAST 5 659 | b5 LOAD_FAST 5 660 | b2 LOAD_FAST 2 661 | b1 LOAD_FAST 1 662 | f4 BINARY_OP 29 __mul__ 663 | f3 BINARY_OP 28 __sub__ 664 | c6 STORE_FAST 6 665 | b6 LOAD_FAST 6 666 | 12:22 LOAD_GLOBAL np 667 | 13:0a LOAD_ATTR n 668 | 82 LOAD_CONST_SMALL_INT 2 669 | f3 BINARY_OP 28 __sub__ 670 | db BINARY_OP 4 __ge__ 671 | 44:4b POP_JUMP_IF_FALSE 11 672 | b6 LOAD_FAST 6 673 | 12:22 LOAD_GLOBAL np 674 | 13:0a LOAD_ATTR n 675 | 82 LOAD_CONST_SMALL_INT 2 676 | f3 BINARY_OP 28 __sub__ 677 | e6 BINARY_OP 15 __isub__ 678 | c6 STORE_FAST 6 679 | 42:50 JUMP 16 680 | b6 LOAD_FAST 6 681 | 80 LOAD_CONST_SMALL_INT 0 682 | d7 BINARY_OP 0 __lt__ 683 | 44:4b POP_JUMP_IF_FALSE 11 684 | b6 LOAD_FAST 6 685 | 12:22 LOAD_GLOBAL np 686 | 13:0a LOAD_ATTR n 687 | 82 LOAD_CONST_SMALL_INT 2 688 | f3 BINARY_OP 28 __sub__ 689 | e5 BINARY_OP 14 __iadd__ 690 | c6 STORE_FAST 6 691 | 42:40 JUMP 0 692 | b3 LOAD_FAST 3 693 | b6 LOAD_FAST 6 694 | 55 LOAD_SUBSCR 695 | 12:22 LOAD_GLOBAL np 696 | b5 LOAD_FAST 5 697 | 56 STORE_SUBSCR 698 | b4 LOAD_FAST 4 699 | b6 LOAD_FAST 6 700 | 55 LOAD_SUBSCR 701 | 12:23 LOAD_GLOBAL rawRGB 702 | b5 LOAD_FAST 5 703 | 56 STORE_SUBSCR 704 | 81 LOAD_CONST_SMALL_INT 1 705 | e5 BINARY_OP 14 __iadd__ 706 | 58 DUP_TOP_TWO 707 | 5a ROT_TWO 708 | d7 BINARY_OP 0 __lt__ 709 | 43:bd:7f POP_JUMP_IF_TRUE -67 710 | 59 POP_TOP 711 | 59 POP_TOP 712 | 12:22 LOAD_GLOBAL np 713 | 14:0c LOAD_METHOD write 714 | 36:00 CALL_METHOD 0 715 | 59 POP_TOP 716 | 51 LOAD_CONST_NONE 717 | 63 RETURN_VALUE 718 | children: [] 719 | simple_name: pixelShowU 720 | raw bytecode: 233 52:32:18:2f:30:80:8d:26:28:25:31:25:2d:2d:27:2d:2d:27:2d:2d:27:2d:2d:27:2c:2c:20:b0:14:0e:36:00:c2:b1:14:0e:36:00:86:f6:c3:80:42:4d:57:c4:12:14:b4:80:80:80:34:04:59:81:e5:57:8e:d7:43:2e:59:b2:b3:d8:44:5a:12:14:81:22:81:7f:22:81:7f:80:34:04:59:12:14:8b:22:81:7f:22:81:7f:80:34:04:59:b2:82:b3:f4:d8:44:5a:12:14:82:22:81:7f:22:81:4c:80:34:04:59:12:14:8a:22:81:7f:22:81:4c:80:34:04:59:b2:83:b3:f4:d8:44:5a:12:14:83:22:81:7f:22:81:19:80:34:04:59:12:14:89:22:81:7f:22:81:19:80:34:04:59:b2:84:b3:f4:d8:44:5a:12:14:88:22:81:7f:22:80:66:80:34:04:59:12:14:84:22:81:7f:22:80:66:80:34:04:59:b2:85:b3:f4:d8:44:58:12:14:85:22:81:7f:22:33:80:34:04:59:12:14:87:22:81:7f:22:33:80:34:04:59:12:22:14:0c:36:00:59:51:63 721 | prelude: n_state=11, n_exc_stack=0, scope_flags=0, n_pos_args=2, n_kwonly_args=0, n_def_pos_args=0 722 | args: ['value_d', 'max_value_d'] 723 | line info: 80:8d:26:28:25:31:25:2d:2d:27:2d:2d:27:2d:2d:27:2d:2d:27:2c:2c:20 724 | b0 LOAD_FAST 0 725 | 14:0e LOAD_METHOD IntValue 726 | 36:00 CALL_METHOD 0 727 | c2 STORE_FAST 2 728 | b1 LOAD_FAST 1 729 | 14:0e LOAD_METHOD IntValue 730 | 36:00 CALL_METHOD 0 731 | 86 LOAD_CONST_SMALL_INT 6 732 | f6 BINARY_OP 31 __floordiv__ 733 | c3 STORE_FAST 3 734 | 80 LOAD_CONST_SMALL_INT 0 735 | 42:4d JUMP 13 736 | 57 DUP_TOP 737 | c4 STORE_FAST 4 738 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 739 | b4 LOAD_FAST 4 740 | 80 LOAD_CONST_SMALL_INT 0 741 | 80 LOAD_CONST_SMALL_INT 0 742 | 80 LOAD_CONST_SMALL_INT 0 743 | 34:04 CALL_FUNCTION 4 744 | 59 POP_TOP 745 | 81 LOAD_CONST_SMALL_INT 1 746 | e5 BINARY_OP 14 __iadd__ 747 | 57 DUP_TOP 748 | 8e LOAD_CONST_SMALL_INT 14 749 | d7 BINARY_OP 0 __lt__ 750 | 43:2e POP_JUMP_IF_TRUE -18 751 | 59 POP_TOP 752 | b2 LOAD_FAST 2 753 | b3 LOAD_FAST 3 754 | d8 BINARY_OP 1 __gt__ 755 | 44:5a POP_JUMP_IF_FALSE 26 756 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 757 | 81 LOAD_CONST_SMALL_INT 1 758 | 22:81:7f LOAD_CONST_SMALL_INT 255 759 | 22:81:7f LOAD_CONST_SMALL_INT 255 760 | 80 LOAD_CONST_SMALL_INT 0 761 | 34:04 CALL_FUNCTION 4 762 | 59 POP_TOP 763 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 764 | 8b LOAD_CONST_SMALL_INT 11 765 | 22:81:7f LOAD_CONST_SMALL_INT 255 766 | 22:81:7f LOAD_CONST_SMALL_INT 255 767 | 80 LOAD_CONST_SMALL_INT 0 768 | 34:04 CALL_FUNCTION 4 769 | 59 POP_TOP 770 | b2 LOAD_FAST 2 771 | 82 LOAD_CONST_SMALL_INT 2 772 | b3 LOAD_FAST 3 773 | f4 BINARY_OP 29 __mul__ 774 | d8 BINARY_OP 1 __gt__ 775 | 44:5a POP_JUMP_IF_FALSE 26 776 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 777 | 82 LOAD_CONST_SMALL_INT 2 778 | 22:81:7f LOAD_CONST_SMALL_INT 255 779 | 22:81:4c LOAD_CONST_SMALL_INT 204 780 | 80 LOAD_CONST_SMALL_INT 0 781 | 34:04 CALL_FUNCTION 4 782 | 59 POP_TOP 783 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 784 | 8a LOAD_CONST_SMALL_INT 10 785 | 22:81:7f LOAD_CONST_SMALL_INT 255 786 | 22:81:4c LOAD_CONST_SMALL_INT 204 787 | 80 LOAD_CONST_SMALL_INT 0 788 | 34:04 CALL_FUNCTION 4 789 | 59 POP_TOP 790 | b2 LOAD_FAST 2 791 | 83 LOAD_CONST_SMALL_INT 3 792 | b3 LOAD_FAST 3 793 | f4 BINARY_OP 29 __mul__ 794 | d8 BINARY_OP 1 __gt__ 795 | 44:5a POP_JUMP_IF_FALSE 26 796 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 797 | 83 LOAD_CONST_SMALL_INT 3 798 | 22:81:7f LOAD_CONST_SMALL_INT 255 799 | 22:81:19 LOAD_CONST_SMALL_INT 153 800 | 80 LOAD_CONST_SMALL_INT 0 801 | 34:04 CALL_FUNCTION 4 802 | 59 POP_TOP 803 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 804 | 89 LOAD_CONST_SMALL_INT 9 805 | 22:81:7f LOAD_CONST_SMALL_INT 255 806 | 22:81:19 LOAD_CONST_SMALL_INT 153 807 | 80 LOAD_CONST_SMALL_INT 0 808 | 34:04 CALL_FUNCTION 4 809 | 59 POP_TOP 810 | b2 LOAD_FAST 2 811 | 84 LOAD_CONST_SMALL_INT 4 812 | b3 LOAD_FAST 3 813 | f4 BINARY_OP 29 __mul__ 814 | d8 BINARY_OP 1 __gt__ 815 | 44:5a POP_JUMP_IF_FALSE 26 816 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 817 | 88 LOAD_CONST_SMALL_INT 8 818 | 22:81:7f LOAD_CONST_SMALL_INT 255 819 | 22:80:66 LOAD_CONST_SMALL_INT 102 820 | 80 LOAD_CONST_SMALL_INT 0 821 | 34:04 CALL_FUNCTION 4 822 | 59 POP_TOP 823 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 824 | 84 LOAD_CONST_SMALL_INT 4 825 | 22:81:7f LOAD_CONST_SMALL_INT 255 826 | 22:80:66 LOAD_CONST_SMALL_INT 102 827 | 80 LOAD_CONST_SMALL_INT 0 828 | 34:04 CALL_FUNCTION 4 829 | 59 POP_TOP 830 | b2 LOAD_FAST 2 831 | 85 LOAD_CONST_SMALL_INT 5 832 | b3 LOAD_FAST 3 833 | f4 BINARY_OP 29 __mul__ 834 | d8 BINARY_OP 1 __gt__ 835 | 44:58 POP_JUMP_IF_FALSE 24 836 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 837 | 85 LOAD_CONST_SMALL_INT 5 838 | 22:81:7f LOAD_CONST_SMALL_INT 255 839 | 22:33 LOAD_CONST_SMALL_INT 51 840 | 80 LOAD_CONST_SMALL_INT 0 841 | 34:04 CALL_FUNCTION 4 842 | 59 POP_TOP 843 | 12:14 LOAD_GLOBAL setPixelColorWithoutWright 844 | 87 LOAD_CONST_SMALL_INT 7 845 | 22:81:7f LOAD_CONST_SMALL_INT 255 846 | 22:33 LOAD_CONST_SMALL_INT 51 847 | 80 LOAD_CONST_SMALL_INT 0 848 | 34:04 CALL_FUNCTION 4 849 | 59 POP_TOP 850 | 12:22 LOAD_GLOBAL np 851 | 14:0c LOAD_METHOD write 852 | 36:00 CALL_METHOD 0 853 | 59 POP_TOP 854 | 51 LOAD_CONST_NONE 855 | 63 RETURN_VALUE 856 | children: [] 857 | simple_name: clamp 858 | raw bytecode: 28 23:14:19:31:32:33:80:a5:25:22:25:22:b2:b0:d7:44:42:b0:63:b2:b1:d8:44:42:b1:63:b2:63 859 | prelude: n_state=5, n_exc_stack=0, scope_flags=0, n_pos_args=3, n_kwonly_args=0, n_def_pos_args=0 860 | args: ['minValue', 'maxValue', 'value'] 861 | line info: 80:a5:25:22:25:22 862 | b2 LOAD_FAST 2 863 | b0 LOAD_FAST 0 864 | d7 BINARY_OP 0 __lt__ 865 | 44:42 POP_JUMP_IF_FALSE 2 866 | b0 LOAD_FAST 0 867 | 63 RETURN_VALUE 868 | b2 LOAD_FAST 2 869 | b1 LOAD_FAST 1 870 | d8 BINARY_OP 1 __gt__ 871 | 44:42 POP_JUMP_IF_FALSE 2 872 | b1 LOAD_FAST 1 873 | 63 RETURN_VALUE 874 | b2 LOAD_FAST 2 875 | 63 RETURN_VALUE 876 | children: [] 877 | simple_name: hsl 878 | raw bytecode: 284 93:10:60:1a:34:35:36:80:ad:26:26:26:26:2a:2a:39:25:2e:30:2a:22:22:22:25:22:22:25:25:22:22:24:25:22:22:24:25:22:22:24:25:22:22:24:25:22:22:24:2e:24:24:24:12:37:b0:34:01:c0:12:37:b1:34:01:c1:12:37:b2:34:01:c2:b0:22:82:68:f8:c0:12:19:80:22:80:63:b1:34:03:c1:12:19:80:22:80:63:b2:34:03:c2:22:80:64:12:38:82:b2:f4:22:80:64:f3:34:01:f3:b1:f4:88:f0:22:80:ce:10:f6:c3:b0:22:3c:f6:c4:b0:b4:22:3c:f4:f3:22:82:00:f4:22:3c:f6:c5:12:38:b4:82:f8:88:f0:b5:f2:22:82:00:f3:34:01:c6:b3:22:82:00:b6:f3:f4:88:f1:c7:80:c8:80:c9:80:ca:b4:80:d9:44:49:b7:c8:b3:c9:80:ca:42:c1:80:b4:81:d9:44:48:b3:c8:b7:c9:80:ca:42:74:b4:82:d9:44:48:80:c8:b3:c9:b7:ca:42:67:b4:83:d9:44:48:80:c8:b7:c9:b3:ca:42:5a:b4:84:d9:44:48:b7:c8:80:c9:b3:ca:42:4d:b4:85:d9:44:48:b3:c8:80:c9:b7:ca:42:40:b2:82:f4:88:f0:22:80:64:f6:b3:f3:82:f6:cb:b8:bb:f2:cc:b9:bb:f2:cd:ba:bb:f2:ce:12:1b:bc:bd:be:34:03:63 879 | prelude: n_state=19, n_exc_stack=0, scope_flags=0, n_pos_args=3, n_kwonly_args=0, n_def_pos_args=0 880 | args: ['h', 's', 'l'] 881 | line info: 80:ad:26:26:26:26:2a:2a:39:25:2e:30:2a:22:22:22:25:22:22:25:25:22:22:24:25:22:22:24:25:22:22:24:25:22:22:24:25:22:22:24:2e:24:24:24 882 | 12:37 LOAD_GLOBAL round 883 | b0 LOAD_FAST 0 884 | 34:01 CALL_FUNCTION 1 885 | c0 STORE_FAST 0 886 | 12:37 LOAD_GLOBAL round 887 | b1 LOAD_FAST 1 888 | 34:01 CALL_FUNCTION 1 889 | c1 STORE_FAST 1 890 | 12:37 LOAD_GLOBAL round 891 | b2 LOAD_FAST 2 892 | 34:01 CALL_FUNCTION 1 893 | c2 STORE_FAST 2 894 | b0 LOAD_FAST 0 895 | 22:82:68 LOAD_CONST_SMALL_INT 360 896 | f8 BINARY_OP 33 __mod__ 897 | c0 STORE_FAST 0 898 | 12:19 LOAD_GLOBAL clamp 899 | 80 LOAD_CONST_SMALL_INT 0 900 | 22:80:63 LOAD_CONST_SMALL_INT 99 901 | b1 LOAD_FAST 1 902 | 34:03 CALL_FUNCTION 3 903 | c1 STORE_FAST 1 904 | 12:19 LOAD_GLOBAL clamp 905 | 80 LOAD_CONST_SMALL_INT 0 906 | 22:80:63 LOAD_CONST_SMALL_INT 99 907 | b2 LOAD_FAST 2 908 | 34:03 CALL_FUNCTION 3 909 | c2 STORE_FAST 2 910 | 22:80:64 LOAD_CONST_SMALL_INT 100 911 | 12:38 LOAD_GLOBAL abs 912 | 82 LOAD_CONST_SMALL_INT 2 913 | b2 LOAD_FAST 2 914 | f4 BINARY_OP 29 __mul__ 915 | 22:80:64 LOAD_CONST_SMALL_INT 100 916 | f3 BINARY_OP 28 __sub__ 917 | 34:01 CALL_FUNCTION 1 918 | f3 BINARY_OP 28 __sub__ 919 | b1 LOAD_FAST 1 920 | f4 BINARY_OP 29 __mul__ 921 | 88 LOAD_CONST_SMALL_INT 8 922 | f0 BINARY_OP 25 __lshift__ 923 | 22:80:ce:10 LOAD_CONST_SMALL_INT 10000 924 | f6 BINARY_OP 31 __floordiv__ 925 | c3 STORE_FAST 3 926 | b0 LOAD_FAST 0 927 | 22:3c LOAD_CONST_SMALL_INT 60 928 | f6 BINARY_OP 31 __floordiv__ 929 | c4 STORE_FAST 4 930 | b0 LOAD_FAST 0 931 | b4 LOAD_FAST 4 932 | 22:3c LOAD_CONST_SMALL_INT 60 933 | f4 BINARY_OP 29 __mul__ 934 | f3 BINARY_OP 28 __sub__ 935 | 22:82:00 LOAD_CONST_SMALL_INT 256 936 | f4 BINARY_OP 29 __mul__ 937 | 22:3c LOAD_CONST_SMALL_INT 60 938 | f6 BINARY_OP 31 __floordiv__ 939 | c5 STORE_FAST 5 940 | 12:38 LOAD_GLOBAL abs 941 | b4 LOAD_FAST 4 942 | 82 LOAD_CONST_SMALL_INT 2 943 | f8 BINARY_OP 33 __mod__ 944 | 88 LOAD_CONST_SMALL_INT 8 945 | f0 BINARY_OP 25 __lshift__ 946 | b5 LOAD_FAST 5 947 | f2 BINARY_OP 27 __add__ 948 | 22:82:00 LOAD_CONST_SMALL_INT 256 949 | f3 BINARY_OP 28 __sub__ 950 | 34:01 CALL_FUNCTION 1 951 | c6 STORE_FAST 6 952 | b3 LOAD_FAST 3 953 | 22:82:00 LOAD_CONST_SMALL_INT 256 954 | b6 LOAD_FAST 6 955 | f3 BINARY_OP 28 __sub__ 956 | f4 BINARY_OP 29 __mul__ 957 | 88 LOAD_CONST_SMALL_INT 8 958 | f1 BINARY_OP 26 __rshift__ 959 | c7 STORE_FAST 7 960 | 80 LOAD_CONST_SMALL_INT 0 961 | c8 STORE_FAST 8 962 | 80 LOAD_CONST_SMALL_INT 0 963 | c9 STORE_FAST 9 964 | 80 LOAD_CONST_SMALL_INT 0 965 | ca STORE_FAST 10 966 | b4 LOAD_FAST 4 967 | 80 LOAD_CONST_SMALL_INT 0 968 | d9 BINARY_OP 2 __eq__ 969 | 44:49 POP_JUMP_IF_FALSE 9 970 | b7 LOAD_FAST 7 971 | c8 STORE_FAST 8 972 | b3 LOAD_FAST 3 973 | c9 STORE_FAST 9 974 | 80 LOAD_CONST_SMALL_INT 0 975 | ca STORE_FAST 10 976 | 42:c1:80 JUMP 65 977 | b4 LOAD_FAST 4 978 | 81 LOAD_CONST_SMALL_INT 1 979 | d9 BINARY_OP 2 __eq__ 980 | 44:48 POP_JUMP_IF_FALSE 8 981 | b3 LOAD_FAST 3 982 | c8 STORE_FAST 8 983 | b7 LOAD_FAST 7 984 | c9 STORE_FAST 9 985 | 80 LOAD_CONST_SMALL_INT 0 986 | ca STORE_FAST 10 987 | 42:74 JUMP 52 988 | b4 LOAD_FAST 4 989 | 82 LOAD_CONST_SMALL_INT 2 990 | d9 BINARY_OP 2 __eq__ 991 | 44:48 POP_JUMP_IF_FALSE 8 992 | 80 LOAD_CONST_SMALL_INT 0 993 | c8 STORE_FAST 8 994 | b3 LOAD_FAST 3 995 | c9 STORE_FAST 9 996 | b7 LOAD_FAST 7 997 | ca STORE_FAST 10 998 | 42:67 JUMP 39 999 | b4 LOAD_FAST 4 1000 | 83 LOAD_CONST_SMALL_INT 3 1001 | d9 BINARY_OP 2 __eq__ 1002 | 44:48 POP_JUMP_IF_FALSE 8 1003 | 80 LOAD_CONST_SMALL_INT 0 1004 | c8 STORE_FAST 8 1005 | b7 LOAD_FAST 7 1006 | c9 STORE_FAST 9 1007 | b3 LOAD_FAST 3 1008 | ca STORE_FAST 10 1009 | 42:5a JUMP 26 1010 | b4 LOAD_FAST 4 1011 | 84 LOAD_CONST_SMALL_INT 4 1012 | d9 BINARY_OP 2 __eq__ 1013 | 44:48 POP_JUMP_IF_FALSE 8 1014 | b7 LOAD_FAST 7 1015 | c8 STORE_FAST 8 1016 | 80 LOAD_CONST_SMALL_INT 0 1017 | c9 STORE_FAST 9 1018 | b3 LOAD_FAST 3 1019 | ca STORE_FAST 10 1020 | 42:4d JUMP 13 1021 | b4 LOAD_FAST 4 1022 | 85 LOAD_CONST_SMALL_INT 5 1023 | d9 BINARY_OP 2 __eq__ 1024 | 44:48 POP_JUMP_IF_FALSE 8 1025 | b3 LOAD_FAST 3 1026 | c8 STORE_FAST 8 1027 | 80 LOAD_CONST_SMALL_INT 0 1028 | c9 STORE_FAST 9 1029 | b7 LOAD_FAST 7 1030 | ca STORE_FAST 10 1031 | 42:40 JUMP 0 1032 | b2 LOAD_FAST 2 1033 | 82 LOAD_CONST_SMALL_INT 2 1034 | f4 BINARY_OP 29 __mul__ 1035 | 88 LOAD_CONST_SMALL_INT 8 1036 | f0 BINARY_OP 25 __lshift__ 1037 | 22:80:64 LOAD_CONST_SMALL_INT 100 1038 | f6 BINARY_OP 31 __floordiv__ 1039 | b3 LOAD_FAST 3 1040 | f3 BINARY_OP 28 __sub__ 1041 | 82 LOAD_CONST_SMALL_INT 2 1042 | f6 BINARY_OP 31 __floordiv__ 1043 | cb STORE_FAST 11 1044 | b8 LOAD_FAST 8 1045 | bb LOAD_FAST 11 1046 | f2 BINARY_OP 27 __add__ 1047 | cc STORE_FAST 12 1048 | b9 LOAD_FAST 9 1049 | bb LOAD_FAST 11 1050 | f2 BINARY_OP 27 __add__ 1051 | cd STORE_FAST 13 1052 | ba LOAD_FAST 10 1053 | bb LOAD_FAST 11 1054 | f2 BINARY_OP 27 __add__ 1055 | ce STORE_FAST 14 1056 | 12:1b LOAD_GLOBAL packRGB 1057 | bc LOAD_FAST 12 1058 | bd LOAD_FAST 13 1059 | be LOAD_FAST 14 1060 | 34:03 CALL_FUNCTION 3 1061 | 63 RETURN_VALUE 1062 | children: [] 1063 | simple_name: packRGB 1064 | raw bytecode: 30 2b:0c:1b:28:29:2a:80:db:b0:22:81:7f:ef:90:f0:b1:22:81:7f:ef:88:f0:ed:b2:22:81:7f:ef:ed:63 1065 | prelude: n_state=6, n_exc_stack=0, scope_flags=0, n_pos_args=3, n_kwonly_args=0, n_def_pos_args=0 1066 | args: ['r', 'g', 'b'] 1067 | line info: 80:db 1068 | b0 LOAD_FAST 0 1069 | 22:81:7f LOAD_CONST_SMALL_INT 255 1070 | ef BINARY_OP 24 __and__ 1071 | 90 LOAD_CONST_SMALL_INT 16 1072 | f0 BINARY_OP 25 __lshift__ 1073 | b1 LOAD_FAST 1 1074 | 22:81:7f LOAD_CONST_SMALL_INT 255 1075 | ef BINARY_OP 24 __and__ 1076 | 88 LOAD_CONST_SMALL_INT 8 1077 | f0 BINARY_OP 25 __lshift__ 1078 | ed BINARY_OP 22 __or__ 1079 | b2 LOAD_FAST 2 1080 | 22:81:7f LOAD_CONST_SMALL_INT 255 1081 | ef BINARY_OP 24 __and__ 1082 | ed BINARY_OP 22 __or__ 1083 | 63 RETURN_VALUE 1084 | children: [] 1085 | simple_name: packRGBd 1086 | raw bytecode: 55 4b:12:1c:39:3a:3b:80:df:26:26:26:b0:14:0e:36:00:c3:b1:14:0e:36:00:c4:b2:14:0e:36:00:c5:12:04:b3:22:81:7f:ef:90:f0:b4:22:81:7f:ef:88:f0:ed:b5:22:81:7f:ef:ed:34:01:63 1087 | prelude: n_state=10, n_exc_stack=0, scope_flags=0, n_pos_args=3, n_kwonly_args=0, n_def_pos_args=0 1088 | args: ['r_d', 'g_d', 'b_d'] 1089 | line info: 80:df:26:26:26 1090 | b0 LOAD_FAST 0 1091 | 14:0e LOAD_METHOD IntValue 1092 | 36:00 CALL_METHOD 0 1093 | c3 STORE_FAST 3 1094 | b1 LOAD_FAST 1 1095 | 14:0e LOAD_METHOD IntValue 1096 | 36:00 CALL_METHOD 0 1097 | c4 STORE_FAST 4 1098 | b2 LOAD_FAST 2 1099 | 14:0e LOAD_METHOD IntValue 1100 | 36:00 CALL_METHOD 0 1101 | c5 STORE_FAST 5 1102 | 12:04 LOAD_GLOBAL DataStruct 1103 | b3 LOAD_FAST 3 1104 | 22:81:7f LOAD_CONST_SMALL_INT 255 1105 | ef BINARY_OP 24 __and__ 1106 | 90 LOAD_CONST_SMALL_INT 16 1107 | f0 BINARY_OP 25 __lshift__ 1108 | b4 LOAD_FAST 4 1109 | 22:81:7f LOAD_CONST_SMALL_INT 255 1110 | ef BINARY_OP 24 __and__ 1111 | 88 LOAD_CONST_SMALL_INT 8 1112 | f0 BINARY_OP 25 __lshift__ 1113 | ed BINARY_OP 22 __or__ 1114 | b5 LOAD_FAST 5 1115 | 22:81:7f LOAD_CONST_SMALL_INT 255 1116 | ef BINARY_OP 24 __and__ 1117 | ed BINARY_OP 22 __or__ 1118 | 34:01 CALL_FUNCTION 1 1119 | 63 RETURN_VALUE 1120 | children: [] 1121 | simple_name: unpackR 1122 | raw bytecode: 17 19:0a:1d:27:80:e6:28:b0:90:f1:22:81:7f:ef:c1:b1:63 1123 | prelude: n_state=4, n_exc_stack=0, scope_flags=0, n_pos_args=1, n_kwonly_args=0, n_def_pos_args=0 1124 | args: ['rgb'] 1125 | line info: 80:e6:28 1126 | b0 LOAD_FAST 0 1127 | 90 LOAD_CONST_SMALL_INT 16 1128 | f1 BINARY_OP 26 __rshift__ 1129 | 22:81:7f LOAD_CONST_SMALL_INT 255 1130 | ef BINARY_OP 24 __and__ 1131 | c1 STORE_FAST 1 1132 | b1 LOAD_FAST 1 1133 | 63 RETURN_VALUE 1134 | children: [] 1135 | simple_name: unpackG 1136 | raw bytecode: 17 19:0a:1e:27:80:eb:28:b0:88:f1:22:81:7f:ef:c1:b1:63 1137 | prelude: n_state=4, n_exc_stack=0, scope_flags=0, n_pos_args=1, n_kwonly_args=0, n_def_pos_args=0 1138 | args: ['rgb'] 1139 | line info: 80:eb:28 1140 | b0 LOAD_FAST 0 1141 | 88 LOAD_CONST_SMALL_INT 8 1142 | f1 BINARY_OP 26 __rshift__ 1143 | 22:81:7f LOAD_CONST_SMALL_INT 255 1144 | ef BINARY_OP 24 __and__ 1145 | c1 STORE_FAST 1 1146 | b1 LOAD_FAST 1 1147 | 63 RETURN_VALUE 1148 | children: [] 1149 | simple_name: unpackB 1150 | raw bytecode: 15 19:0a:1f:27:80:f0:26:b0:22:81:7f:ef:c1:b1:63 1151 | prelude: n_state=4, n_exc_stack=0, scope_flags=0, n_pos_args=1, n_kwonly_args=0, n_def_pos_args=0 1152 | args: ['rgb'] 1153 | line info: 80:f0:26 1154 | b0 LOAD_FAST 0 1155 | 22:81:7f LOAD_CONST_SMALL_INT 255 1156 | ef BINARY_OP 24 __and__ 1157 | c1 STORE_FAST 1 1158 | b1 LOAD_FAST 1 1159 | 63 RETURN_VALUE 1160 | children: [] 1161 | simple_name: version 1162 | raw bytecode: 8 00:06:20:80:f5:23:01:63 1163 | prelude: n_state=1, n_exc_stack=0, scope_flags=0, n_pos_args=0, n_kwonly_args=0, n_def_pos_args=0 1164 | args: [] 1165 | line info: 80:f5 1166 | 23:01 LOAD_CONST_OBJ 'v_2020_7_30' 1167 | 63 RETURN_VALUE 1168 | children: [] 1169 | -------------------------------------------------------------------------------- /old/mpy_disassemble/sensor_infrared.mpy.freeze: -------------------------------------------------------------------------------- 1 | #include "py/mpconfig.h" 2 | #include "py/objint.h" 3 | #include "py/objstr.h" 4 | #include "py/emitglue.h" 5 | #include "py/nativeglue.h" 6 | 7 | #if MICROPY_LONGINT_IMPL != 2 8 | #error "incompatible MICROPY_LONGINT_IMPL" 9 | #endif 10 | 11 | #if MPZ_DIG_SIZE != 16 12 | #error "incompatible MPZ_DIG_SIZE" 13 | #endif 14 | 15 | #if MICROPY_PY_BUILTINS_FLOAT 16 | typedef struct _mp_obj_float_t { 17 | mp_obj_base_t base; 18 | mp_float_t value; 19 | } mp_obj_float_t; 20 | #endif 21 | 22 | #if MICROPY_PY_BUILTINS_COMPLEX 23 | typedef struct _mp_obj_complex_t { 24 | mp_obj_base_t base; 25 | mp_float_t real; 26 | mp_float_t imag; 27 | } mp_obj_complex_t; 28 | #endif 29 | 30 | enum { 31 | MP_QSTR__0x0a_ = MP_QSTRnumber_of, 32 | MP_QSTR__space_, 33 | MP_QSTR__star_, 34 | MP_QSTR__slash_, 35 | MP_QSTR__lt_module_gt_, 36 | MP_QSTR_utf_hyphen_8, 37 | MP_QSTR__dot__backslash_sensor_infrared_dot_py, 38 | MP_QSTR_Pin, 39 | MP_QSTR_machine, 40 | MP_QSTR_pin_map, 41 | MP_QSTR_control_board_v1, 42 | MP_QSTR_read_infrared_sensor, 43 | MP_QSTR_IN, 44 | MP_QSTR_version, 45 | MP_QSTR_pin_port, 46 | MP_QSTR_v_2020_7_30, 47 | }; 48 | 49 | const qstr_hash_t mp_qstr_frozen_const_hashes[] = { 50 | 175, 51 | 133, 52 | 143, 53 | 138, 54 | 189, 55 | 183, 56 | 120, 57 | 18, 58 | 96, 59 | 81, 60 | 95, 61 | 1, 62 | 34, 63 | 191, 64 | 180, 65 | 216, 66 | }; 67 | 68 | const qstr_len_t mp_qstr_frozen_const_lengths[] = { 69 | 1, 70 | 1, 71 | 1, 72 | 1, 73 | 8, 74 | 5, 75 | 20, 76 | 3, 77 | 7, 78 | 7, 79 | 16, 80 | 20, 81 | 2, 82 | 7, 83 | 8, 84 | 11, 85 | }; 86 | 87 | extern const qstr_pool_t mp_qstr_const_pool; 88 | const qstr_pool_t mp_qstr_frozen_const_pool = { 89 | &mp_qstr_const_pool, // previous pool 90 | MP_QSTRnumber_of, // previous pool size 91 | 10, // allocated entries 92 | 16, // used entries 93 | (qstr_hash_t *)mp_qstr_frozen_const_hashes, 94 | (qstr_len_t *)mp_qstr_frozen_const_lengths, 95 | { 96 | "\x0a", 97 | " ", 98 | "*", 99 | "/", 100 | "", 101 | "utf-8", 102 | "\x2e\x5c\x73\x65\x6e\x73\x6f\x72\x5f\x69\x6e\x66\x72\x61\x72\x65\x64\x2e\x70\x79", 103 | "Pin", 104 | "machine", 105 | "pin_map", 106 | "control_board_v1", 107 | "read_infrared_sensor", 108 | "IN", 109 | "version", 110 | "pin_port", 111 | "v_2020_7_30", 112 | }, 113 | }; 114 | 115 | //////////////////////////////////////////////////////////////////////////////// 116 | // frozen module .\sensor_infrared 117 | // - original source file: ./rootfs/sensor_infrared.mpy 118 | // - frozen file name: .\sensor_infrared.py 119 | // - .mpy header: 4d:06:00:1f 120 | 121 | // frozen bytecode for file .\sensor_infrared.py, scope .\sensor_infrared__lt_module_gt_ 122 | static const byte fun_data_.\sensor_infrared__lt_module_gt_[41] = { 123 | 0x08,0x0a, // prelude 124 | 0x01, // names: 125 | 0x2c,0x6c,0x64,0x40, // code info 126 | 0x80, // LOAD_CONST_SMALL_INT 0 127 | 0x10,0x02, // LOAD_CONST_STRING 'Pin' 128 | 0x2a,0x01, // BUILD_TUPLE 1 129 | 0x1b,0x03, // IMPORT_NAME 'machine' 130 | 0x1c,0x02, // IMPORT_FROM 'Pin' 131 | 0x16,0x02, // STORE_NAME 'Pin' 132 | 0x59, // POP_TOP 133 | 0x80, // LOAD_CONST_SMALL_INT 0 134 | 0x10,0x04, // LOAD_CONST_STRING 'pin_map' 135 | 0x2a,0x01, // BUILD_TUPLE 1 136 | 0x1b,0x05, // IMPORT_NAME 'control_board_v1' 137 | 0x1c,0x04, // IMPORT_FROM 'pin_map' 138 | 0x16,0x04, // STORE_NAME 'pin_map' 139 | 0x59, // POP_TOP 140 | 0x32,0x00, // MAKE_FUNCTION 0 141 | 0x16,0x06, // STORE_NAME 'read_infrared_sensor' 142 | 0x32,0x01, // MAKE_FUNCTION 1 143 | 0x16,0x09, // STORE_NAME 'version' 144 | 0x51, // LOAD_CONST_NONE 145 | 0x63, // RETURN_VALUE 146 | }; 147 | // child of .\sensor_infrared__lt_module_gt_ 148 | // frozen bytecode for file .\sensor_infrared.py, scope .\sensor_infrared_read_infrared_sensor 149 | static const byte fun_data_.\sensor_infrared_read_infrared_sensor[29] = { 150 | 0x19,0x0a, // prelude 151 | 0x06,0x0a, // names: read_infrared_sensor, pin_port 152 | 0x60,0x40,0x2d, // code info 153 | 0x12,0x02, // LOAD_GLOBAL 'Pin' 154 | 0xb0, // LOAD_FAST 0 155 | 0x12,0x02, // LOAD_GLOBAL 'Pin' 156 | 0x13,0x07, // LOAD_ATTR 'IN' 157 | 0x34,0x02, // CALL_FUNCTION 2 158 | 0x12,0x04, // LOAD_GLOBAL 'pin_map' 159 | 0xb0, // LOAD_FAST 0 160 | 0x56, // STORE_SUBSCR 161 | 0x12,0x04, // LOAD_GLOBAL 'pin_map' 162 | 0xb0, // LOAD_FAST 0 163 | 0x55, // LOAD_SUBSCR 164 | 0x14,0x08, // LOAD_METHOD 'value' 165 | 0x36,0x00, // CALL_METHOD 0 166 | 0x63, // RETURN_VALUE 167 | }; 168 | static const mp_raw_code_t raw_code_.\sensor_infrared_read_infrared_sensor = { 169 | .kind = MP_CODE_BYTECODE, 170 | .scope_flags = 0x00, 171 | .n_pos_args = 1, 172 | .fun_data = fun_data_.\sensor_infrared_read_infrared_sensor, 173 | #if MICROPY_PERSISTENT_CODE_SAVE || MICROPY_DEBUG_PRINTERS 174 | .fun_data_len = 29, 175 | #endif 176 | .children = NULL, 177 | #if MICROPY_PERSISTENT_CODE_SAVE 178 | .n_children = 0, 179 | #if MICROPY_PY_SYS_SETTRACE 180 | .prelude = { 181 | .n_state = 4, 182 | .n_exc_stack = 0, 183 | .scope_flags = 0, 184 | .n_pos_args = 1, 185 | .n_kwonly_args = 0, 186 | .n_def_pos_args = 0, 187 | .qstr_block_name_idx = 6, 188 | .line_info = fun_data_.\sensor_infrared_read_infrared_sensor + 4, 189 | .opcodes = fun_data_.\sensor_infrared_read_infrared_sensor + 7, 190 | }, 191 | .line_of_definition = 0, 192 | #endif 193 | #if MICROPY_EMIT_MACHINE_CODE 194 | .prelude_offset = 0, 195 | #endif 196 | #endif 197 | #if MICROPY_EMIT_MACHINE_CODE 198 | .type_sig = 0, 199 | #endif 200 | }; 201 | 202 | // child of .\sensor_infrared__lt_module_gt_ 203 | // frozen bytecode for file .\sensor_infrared.py, scope .\sensor_infrared_version 204 | static const byte fun_data_.\sensor_infrared_version[8] = { 205 | 0x00,0x06, // prelude 206 | 0x09, // names: version 207 | 0x80,0x0a, // code info 208 | 0x23,0x00, // LOAD_CONST_OBJ 0 209 | 0x63, // RETURN_VALUE 210 | }; 211 | static const mp_raw_code_t raw_code_.\sensor_infrared_version = { 212 | .kind = MP_CODE_BYTECODE, 213 | .scope_flags = 0x00, 214 | .n_pos_args = 0, 215 | .fun_data = fun_data_.\sensor_infrared_version, 216 | #if MICROPY_PERSISTENT_CODE_SAVE || MICROPY_DEBUG_PRINTERS 217 | .fun_data_len = 8, 218 | #endif 219 | .children = NULL, 220 | #if MICROPY_PERSISTENT_CODE_SAVE 221 | .n_children = 0, 222 | #if MICROPY_PY_SYS_SETTRACE 223 | .prelude = { 224 | .n_state = 1, 225 | .n_exc_stack = 0, 226 | .scope_flags = 0, 227 | .n_pos_args = 0, 228 | .n_kwonly_args = 0, 229 | .n_def_pos_args = 0, 230 | .qstr_block_name_idx = 9, 231 | .line_info = fun_data_.\sensor_infrared_version + 3, 232 | .opcodes = fun_data_.\sensor_infrared_version + 5, 233 | }, 234 | .line_of_definition = 0, 235 | #endif 236 | #if MICROPY_EMIT_MACHINE_CODE 237 | .prelude_offset = 0, 238 | #endif 239 | #endif 240 | #if MICROPY_EMIT_MACHINE_CODE 241 | .type_sig = 0, 242 | #endif 243 | }; 244 | 245 | static const mp_raw_code_t *const children_.\sensor_infrared__lt_module_gt_[] = { 246 | &raw_code_.\sensor_infrared_read_infrared_sensor, 247 | &raw_code_.\sensor_infrared_version, 248 | }; 249 | 250 | static const mp_raw_code_t raw_code_.\sensor_infrared__lt_module_gt_ = { 251 | .kind = MP_CODE_BYTECODE, 252 | .scope_flags = 0x00, 253 | .n_pos_args = 0, 254 | .fun_data = fun_data_.\sensor_infrared__lt_module_gt_, 255 | #if MICROPY_PERSISTENT_CODE_SAVE || MICROPY_DEBUG_PRINTERS 256 | .fun_data_len = 41, 257 | #endif 258 | .children = (void *)&children_.\sensor_infrared__lt_module_gt_, 259 | #if MICROPY_PERSISTENT_CODE_SAVE 260 | .n_children = 2, 261 | #if MICROPY_PY_SYS_SETTRACE 262 | .prelude = { 263 | .n_state = 2, 264 | .n_exc_stack = 0, 265 | .scope_flags = 0, 266 | .n_pos_args = 0, 267 | .n_kwonly_args = 0, 268 | .n_def_pos_args = 0, 269 | .qstr_block_name_idx = 1, 270 | .line_info = fun_data_.\sensor_infrared__lt_module_gt_ + 3, 271 | .opcodes = fun_data_.\sensor_infrared__lt_module_gt_ + 7, 272 | }, 273 | .line_of_definition = 0, 274 | #endif 275 | #if MICROPY_EMIT_MACHINE_CODE 276 | .prelude_offset = 0, 277 | #endif 278 | #endif 279 | #if MICROPY_EMIT_MACHINE_CODE 280 | .type_sig = 0, 281 | #endif 282 | }; 283 | 284 | static const qstr_short_t const_qstr_table_data_.\sensor_infrared[11] = { 285 | MP_QSTR__dot__backslash_sensor_infrared_dot_py, 286 | MP_QSTR__lt_module_gt_, 287 | MP_QSTR_Pin, 288 | MP_QSTR_machine, 289 | MP_QSTR_pin_map, 290 | MP_QSTR_control_board_v1, 291 | MP_QSTR_read_infrared_sensor, 292 | MP_QSTR_IN, 293 | MP_QSTR_value, 294 | MP_QSTR_version, 295 | MP_QSTR_pin_port, 296 | }; 297 | 298 | // constants 299 | 300 | // constant table 301 | static const mp_rom_obj_t const_obj_table_data_.\sensor_infrared[1] = { 302 | MP_ROM_QSTR(MP_QSTR_v_2020_7_30), 303 | }; 304 | 305 | static const mp_frozen_module_t frozen_module_.\sensor_infrared = { 306 | .constants = { 307 | .qstr_table = (qstr_short_t *)&const_qstr_table_data_.\sensor_infrared, 308 | .obj_table = (mp_obj_t *)&const_obj_table_data_.\sensor_infrared, 309 | }, 310 | .rc = &raw_code_.\sensor_infrared__lt_module_gt_, 311 | }; 312 | 313 | //////////////////////////////////////////////////////////////////////////////// 314 | // collection of all frozen modules 315 | 316 | const char mp_frozen_names[] = { 317 | #ifdef MP_FROZEN_STR_NAMES 318 | MP_FROZEN_STR_NAMES 319 | #endif 320 | ".\sensor_infrared.py\0" 321 | "\0" 322 | }; 323 | 324 | const mp_frozen_module_t *const mp_frozen_mpy_content[] = { 325 | &frozen_module_.\sensor_infrared, 326 | }; 327 | 328 | #ifdef MICROPY_FROZEN_LIST_ITEM 329 | MICROPY_FROZEN_LIST_ITEM(".\sensor_infrared", ".\sensor_infrared.py") 330 | #endif 331 | 332 | /* 333 | byte sizes: 334 | qstr content: 16 unique, 166 bytes 335 | bc content: 78 336 | const str content: 0 337 | const int content: 0 338 | const obj content: 0 339 | const table qstr content: 0 entries, 0 bytes 340 | const table ptr content: 1 entries, 4 bytes 341 | raw code content: 3 * 4 = 48 342 | mp_frozen_mpy_names_content: 22 343 | mp_frozen_mpy_content_size: 4 344 | total: 322 345 | */ 346 | -------------------------------------------------------------------------------- /old/mpy_disassemble/sensor_infrared.mpy.txt: -------------------------------------------------------------------------------- 1 | mpy_source_file: rootfs/sensor_infrared.mpy 2 | source_file: .\sensor_infrared.py 3 | header: 4d:06:00:1f 4 | qstr_table[11]: 5 | .\sensor_infrared.py 6 | 7 | Pin 8 | machine 9 | pin_map 10 | control_board_v1 11 | read_infrared_sensor 12 | IN 13 | value 14 | version 15 | pin_port 16 | obj_table: ['v_2020_7_30'] 17 | simple_name: 18 | raw bytecode: 41 08:0a:01:2c:6c:64:40:80:10:02:2a:01:1b:03:1c:02:16:02:59:80:10:04:2a:01:1b:05:1c:04:16:04:59:32:00:16:06:32:01:16:09:51:63 19 | prelude: n_state=2, n_exc_stack=0, scope_flags=0, n_pos_args=0, n_kwonly_args=0, n_def_pos_args=0 20 | args: [] 21 | line info: 2c:6c:64:40 22 | 80 LOAD_CONST_SMALL_INT 0 23 | 10:02 LOAD_CONST_STRING Pin 24 | 2a:01 BUILD_TUPLE 1 25 | 1b:03 IMPORT_NAME machine 26 | 1c:02 IMPORT_FROM Pin 27 | 16:02 STORE_NAME Pin 28 | 59 POP_TOP 29 | 80 LOAD_CONST_SMALL_INT 0 30 | 10:04 LOAD_CONST_STRING pin_map 31 | 2a:01 BUILD_TUPLE 1 32 | 1b:05 IMPORT_NAME control_board_v1 33 | 1c:04 IMPORT_FROM pin_map 34 | 16:04 STORE_NAME pin_map 35 | 59 POP_TOP 36 | 32:00 MAKE_FUNCTION 0 37 | 16:06 STORE_NAME read_infrared_sensor 38 | 32:01 MAKE_FUNCTION 1 39 | 16:09 STORE_NAME version 40 | 51 LOAD_CONST_NONE 41 | 63 RETURN_VALUE 42 | children: ['read_infrared_sensor', 'version'] 43 | simple_name: read_infrared_sensor 44 | raw bytecode: 29 19:0a:06:0a:60:40:2d:12:02:b0:12:02:13:07:34:02:12:04:b0:56:12:04:b0:55:14:08:36:00:63 45 | prelude: n_state=4, n_exc_stack=0, scope_flags=0, n_pos_args=1, n_kwonly_args=0, n_def_pos_args=0 46 | args: ['pin_port'] 47 | line info: 60:40:2d 48 | 12:02 LOAD_GLOBAL Pin 49 | b0 LOAD_FAST 0 50 | 12:02 LOAD_GLOBAL Pin 51 | 13:07 LOAD_ATTR IN 52 | 34:02 CALL_FUNCTION 2 53 | 12:04 LOAD_GLOBAL pin_map 54 | b0 LOAD_FAST 0 55 | 56 STORE_SUBSCR 56 | 12:04 LOAD_GLOBAL pin_map 57 | b0 LOAD_FAST 0 58 | 55 LOAD_SUBSCR 59 | 14:08 LOAD_METHOD value 60 | 36:00 CALL_METHOD 0 61 | 63 RETURN_VALUE 62 | children: [] 63 | simple_name: version 64 | raw bytecode: 8 00:06:09:80:0a:23:00:63 65 | prelude: n_state=1, n_exc_stack=0, scope_flags=0, n_pos_args=0, n_kwonly_args=0, n_def_pos_args=0 66 | args: [] 67 | line info: 80:0a 68 | 23:00 LOAD_CONST_OBJ 'v_2020_7_30' 69 | 63 RETURN_VALUE 70 | children: [] 71 | -------------------------------------------------------------------------------- /old/rootfs/actuator_led.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/actuator_led.mpy -------------------------------------------------------------------------------- /old/rootfs/alert.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/alert.dat -------------------------------------------------------------------------------- /old/rootfs/basic.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/basic.mpy -------------------------------------------------------------------------------- /old/rootfs/boot.py: -------------------------------------------------------------------------------- 1 | # This file is executed on every boot (including wake-boot from deepsleep) 2 | #import esp 3 | #esp.osdebug(None) 4 | #import webrepl 5 | #webrepl.start() 6 | -------------------------------------------------------------------------------- /old/rootfs/broken.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/broken.dat -------------------------------------------------------------------------------- /old/rootfs/control_board_v1.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/control_board_v1.mpy -------------------------------------------------------------------------------- /old/rootfs/drop.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/drop.dat -------------------------------------------------------------------------------- /old/rootfs/du.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/du.dat -------------------------------------------------------------------------------- /old/rootfs/electric.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/electric.dat -------------------------------------------------------------------------------- /old/rootfs/funny.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/funny.dat -------------------------------------------------------------------------------- /old/rootfs/main.py: -------------------------------------------------------------------------------- 1 | import machine 2 | import time 3 | import os 4 | import esp 5 | from machine import SoftI2C, Pin 6 | 7 | uart = machine.UART(1, 460800, tx = 8, rx = 9, timeout=100) 8 | i2c = SoftI2C(scl=Pin(7), sda=Pin(6), freq=400000) 9 | def calc_checksum(data : bytearray): 10 | sum = 0 11 | for i in range(0,len(data)-1): 12 | sum+=data[i] 13 | return sum&0xff 14 | def uart_write(addr, data:bytearray) -> num: 15 | if(len(data)==0): 16 | return False 17 | byteToWrite = bytearray([0x90]) 18 | byteToWrite.append(addr) 19 | byteToWrite.append(len(data)) 20 | byteToWrite.extend(data) 21 | byteToWrite.append(0) 22 | byteToWrite[len(byteToWrite)-1]=calc_checksum(byteToWrite) 23 | uart.write(byteToWrite) 24 | bytes = uart.read(3) 25 | if len(bytes)==3: 26 | return bytes[2] 27 | else: 28 | print("write error: ", bytes) 29 | return False 30 | 31 | def led_rect(): 32 | bytes = bytearray([0xf8,0x88,0x88,0x88,0xF8]) 33 | uart_write(0x08, bytes) 34 | return 35 | 36 | def led_array_demo(): 37 | bytes = bytearray([0x80,0x40,0x20,0x10,0x08]) 38 | for i in range(0,10): 39 | for j in range(0,5): 40 | bytes[j]=bytes[j]<<1 41 | if bytes[j] == 0: 42 | bytes[j] = 0x08 43 | uart_write(0x08, bytes) 44 | time.sleep_ms(100) 45 | return 46 | 47 | addr = 0x160000 48 | def readFile(length:numbers): 49 | global addr 50 | temp_buf = bytearray(length) 51 | esp.flash_read(addr, temp_buf) 52 | addr+=length 53 | return temp_buf 54 | 55 | def get_files_from_flash(): 56 | status = 0 57 | length = 0 58 | while(True): 59 | length = 0; 60 | if(status ==0): 61 | length = int.from_bytes(readFile(4), 'big') 62 | if(length > 1000000): 63 | break; 64 | filename = readFile(28) 65 | while(filename[len(filename)-1]==0xff): 66 | filename = filename[0:len(filename)-1] 67 | filename = filename.decode() 68 | print(filename+":"+str(length)) 69 | fo=open(filename,'wb') 70 | fo.write(readFile(length)) 71 | fo.close() 72 | 73 | 74 | wav_count=0 75 | files = os.listdir() 76 | if(len(files) <15): 77 | get_files_from_flash() 78 | 79 | t=i2c.scan() 80 | if(t[0]==18 or t[0]==24): 81 | led_rect() 82 | -------------------------------------------------------------------------------- /old/rootfs/main2.py: -------------------------------------------------------------------------------- 1 | import control_board_v1 2 | import actuator_led 3 | import sensor_infrared 4 | import variable 5 | import time 6 | import math 7 | import basic 8 | from basic import DataStruct 9 | from basic import wait_time 10 | 11 | 12 | control_board_v1.led_show_bytes(bytearray([0x00, 0x00, 0x00, 0x00, 0x00])) 13 | soundLoop = control_board_v1.play_record_loop() 14 | 15 | 16 | def proc_1(proc_1_var_0): 17 | actuator_led.pixelShowU(proc_1_var_0, DataStruct(255)) 18 | yield False 19 | 20 | 21 | def Loop1(): 22 | actuator_led.InitNP(5) 23 | actuator_led.ShowRainbow() 24 | while True: 25 | proc_1_loop = proc_1(DataStruct(control_board_v1.read_volume())) 26 | proc_1_loop_has_next = True 27 | while (proc_1_loop_has_next): 28 | proc_1_loop_has_next = next(proc_1_loop) 29 | yield True 30 | yield True 31 | yield False 32 | 33 | 34 | loop1 = Loop1() 35 | loop1HasNext = True 36 | 37 | 38 | while True: 39 | control_board_v1.UpdateButtonStatus() 40 | next(soundLoop) 41 | if loop1HasNext: 42 | loop1HasNext = next(loop1) 43 | 44 | 45 | -------------------------------------------------------------------------------- /old/rootfs/msg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/msg.dat -------------------------------------------------------------------------------- /old/rootfs/pass.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/pass.dat -------------------------------------------------------------------------------- /old/rootfs/r1.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/r1.dat -------------------------------------------------------------------------------- /old/rootfs/record_end.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/record_end.dat -------------------------------------------------------------------------------- /old/rootfs/record_start.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/record_start.dat -------------------------------------------------------------------------------- /old/rootfs/right.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/right.dat -------------------------------------------------------------------------------- /old/rootfs/sensor_infrared.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/sensor_infrared.mpy -------------------------------------------------------------------------------- /old/rootfs/tech.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/tech.dat -------------------------------------------------------------------------------- /old/rootfs/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/test -------------------------------------------------------------------------------- /old/rootfs/variable.py: -------------------------------------------------------------------------------- 1 | from basic import DataStruct 2 | 3 | 4 | defaultVariable = DataStruct(0) 5 | -------------------------------------------------------------------------------- /old/rootfs/wrong.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/old/rootfs/wrong.dat -------------------------------------------------------------------------------- /test/test.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/test/test.mpy -------------------------------------------------------------------------------- /test/test.py: -------------------------------------------------------------------------------- 1 | ../..//pycdc/test.py -------------------------------------------------------------------------------- /v1.0.3/main.py: -------------------------------------------------------------------------------- 1 | import machine 2 | import time 3 | import os 4 | import esp 5 | import protocal as p 6 | 7 | addr = 0x160000 8 | def readFile(length:numbers): 9 | global addr 10 | temp_buf = bytearray(length) 11 | esp.flash_read(addr, temp_buf) 12 | addr+=length 13 | return temp_buf 14 | 15 | def get_files_from_flash(): 16 | status = 0 17 | length = 0 18 | while(True): 19 | length = 0; 20 | if(status ==0): 21 | length = int.from_bytes(readFile(4), 'big') 22 | if(length > 1000000): 23 | break; 24 | filename = readFile(28) 25 | while(filename[len(filename)-1]==0xff): 26 | filename = filename[0:len(filename)-1] 27 | filename = filename.decode() 28 | print(filename+":"+str(length)) 29 | fo=open(filename,'wb') 30 | while (length > 1024*64): 31 | fo.write(readFile(1024*64)) 32 | length = length - 1024*64 33 | fo.write(readFile(length)) 34 | fo.close() 35 | 36 | files = os.listdir() 37 | if(len(files) < 10): 38 | get_files_from_flash() 39 | p.check_hardware() 40 | -------------------------------------------------------------------------------- /v1.0.3/rootfs/alert.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/alert.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/basic.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/basic.mpy -------------------------------------------------------------------------------- /v1.0.3/rootfs/boot.py: -------------------------------------------------------------------------------- 1 | # This file is executed on every boot (including wake-boot from deepsleep) 2 | #import esp 3 | #esp.osdebug(None) 4 | #import webrepl 5 | #webrepl.start() 6 | -------------------------------------------------------------------------------- /v1.0.3/rootfs/broken.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/broken.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/controlBoard.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/controlBoard.mpy -------------------------------------------------------------------------------- /v1.0.3/rootfs/drop.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/drop.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/du.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/du.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/electric.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/electric.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/funny.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/funny.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/main.py: -------------------------------------------------------------------------------- 1 | import machine 2 | import time 3 | import os 4 | import esp 5 | import protocal as p 6 | 7 | addr = 0x160000 8 | def readFile(length:numbers): 9 | global addr 10 | temp_buf = bytearray(length) 11 | esp.flash_read(addr, temp_buf) 12 | addr+=length 13 | return temp_buf 14 | 15 | def get_files_from_flash(): 16 | status = 0 17 | length = 0 18 | while(True): 19 | length = 0; 20 | if(status ==0): 21 | length = int.from_bytes(readFile(4), 'big') 22 | if(length > 1000000): 23 | break; 24 | filename = readFile(28) 25 | while(filename[len(filename)-1]==0xff): 26 | filename = filename[0:len(filename)-1] 27 | filename = filename.decode() 28 | print(filename+":"+str(length)) 29 | fo=open(filename,'wb') 30 | while (length > 1024*64): 31 | fo.write(readFile(1024*64)) 32 | length = length - 1024*64 33 | fo.write(readFile(length)) 34 | fo.close() 35 | 36 | files = os.listdir() 37 | if(len(files) < 10): 38 | get_files_from_flash() 39 | p.check_hardware() 40 | -------------------------------------------------------------------------------- /v1.0.3/rootfs/msg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/msg.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/pass.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/pass.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/record_end.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/record_end.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/record_start.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/record_start.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/right.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/right.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/tech.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/tech.dat -------------------------------------------------------------------------------- /v1.0.3/rootfs/wrong.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggfly/AlphaPi/1c7df929b7809a2b8c4c2d4235c2c0db21f597e5/v1.0.3/rootfs/wrong.dat --------------------------------------------------------------------------------