When writing code to be compiled with SDCC targetting Z80, assembler code fragments can be inserted in the C functions by enclosing them between the __asm and __endasm; tags:
void DoNotDisturb()
{
__asm
di
| import os | |
| import machine | |
| import time | |
| class GowinConfig(object): | |
| def __init__(self, pin_cs:machine.Pin, pin_mode0:machine.Pin, pin_reconfig_n:machine.Pin, pin_ready:machine.Pin, spi:machine.SPI): | |
| self.__pin_cs = pin_cs | |
| self.__pin_mode0 = pin_mode0 | |
| self.__pin_reconfig_n = pin_reconfig_n | |
| self.__pin_ready = pin_ready |
| # Program to parse VGA data (EDID) accessed from I2C device 0x50 | |
| # | |
| # This is a quick demo not a supported program, so don't expect | |
| # correctness from it. | |
| # | |
| # Edid format from: | |
| # https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#EDID_1.4_data_format | |
| # | |
| # Ken Shirriff http://righto.com |
| /* | |
| Copyright (c) 2014-2020 Electronic Cats SAPI de CV. All right reserved. | |
| This library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU Lesser General Public | |
| License as published by the Free Software Foundation; either | |
| version 2.1 of the License, or (at your option) any later version. | |
| This library is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
If you have:
You can:
| <?xml version="1.0" ?> | |
| <!-- =================================================================================== --> | |
| <!-- | This document was autogenerated by xacro from /home/docker/ws/src/val_description/model/robots/valkyrie_sim_gazebo_sync.xacro | --> | |
| <!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | --> | |
| <!-- =================================================================================== --> | |
| <robot name="valkyrie" xmlns:xacro="http://www.ros.org/wiki/xacro"> | |
| <gazebo> | |
| <plugin filename="libval_gazebo.so" name="SharedMemorySimInterfacePlugin"> | |
| <robotNamespace>/val</robotNamespace> | |
| <updateRateHz>500.0</updateRateHz> |
| /** | |
| * USB HID Keyboard scan codes as per USB spec 1.11 | |
| * plus some additional codes | |
| * | |
| * Created by MightyPork, 2016 | |
| * Public domain | |
| * | |
| * Adapted from: | |
| * https://source.android.com/devices/input/keyboard-devices.html | |
| */ |
| /* | |
| Copyright 2011 Martin Hawksey | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software |