git clone https://github.com/probonopd/linuxdeployqt.git
cd linuxdeployqt
mkdir build && cd build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int Euclidean(int num_1, int num_2) { | |
| int a = num_1 > num_2 ? num_1 : num_2; | |
| int b = num_1 > num_2 ? num_2 : num_1; | |
| int tmp; | |
| while (a % b = tmp) { | |
| a = b; | |
| b = tmp; | |
| } | |
| return b; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ADS1115.h" | |
| uint8_t ADS1115_Init(ADS1115_t *ptr) | |
| { | |
| uint16_t buf = 0x8083; | |
| // Pins | |
| buf &= ~(0x03 << 12); //[14:12] | |
| buf |= ptr->Pin << 12; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "INA226.h" | |
| int16_t combi_int16(uint8_t *ptr) | |
| { | |
| return *ptr++ << 8 | *ptr; | |
| } | |
| uint8_t INA226_Reset(INA226_t *ptr) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "TCA6424A.h" | |
| /* 7Bit - 0x23 (a0 = 1) | |
| 7Bit - 0x22 (a0 = 0) | |
| */ | |
| const uint8_t SlaveAddress = 0x46; | |
| static uint32_t OUTPUT_Reg = 0x00; | |
| /** 底层调用定义 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set(PRJ_NAME CLion_STM_LED) | |
| set(MCU_FAMILY STM32F1xx) | |
| set(MCU_LINE STM32F103xB) | |
| set(MCU_LINKER_SCRIPT STM32F103RBTx_FLASH.ld) | |
| cmake_minimum_required(VERSION 3.6) | |
| project(${PRJ_NAME} C ASM) | |
| add_definitions(-D${MCU_LINE}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function use_proxy() { | |
| git config --global http.proxy $1 | |
| git config --global https.proxy $1 | |
| export http_proxy=$1 | |
| export https_proxy=$1 | |
| export ftp_proxy=$1 | |
| export rsync_proxy=$1 | |
| export all_proxy=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| template <typename T, int N> | |
| struct _CircleBuffer_iterator { | |
| private: | |
| T *_base; | |
| T *_ptr; | |
| static inline size_t _modN_(size_t pos) { return pos % N; } | |
| static inline size_t _iter_pos_(T *ptr, T *base) { return (ptr - base); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/sh | |
| # install zsh and oh-my-zsh | |
| sudo apt install -y curl zsh fonts-powerline | |
| sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
| # install powerlevel10k theme | |
| git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k | |
| # set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc. | |
| sed -i 's/^ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ~/.zshrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstddef> | |
| #include <cstdint> | |
| #include <type_traits> | |
| template <typename T, T _base, size_t _size> | |
| struct StaticBlock { | |
| static_assert(std::is_pointer<T>::value); | |
| static constexpr void* base = _base; | |
| static constexpr const size_t size = _size; |
OlderNewer