Skip to content

Instantly share code, notes, and snippets.

View armink's full-sized avatar

朱天龙 (Armink) armink

View GitHub Profile
@armink
armink / si4463_test_cmd.c
Created March 13, 2020 14:18
SI4463 测试命令
static void si4463(uint8_t argc, char **argv) {
enum {
CMD_SEND_INDEX,
CMD_RECV_INDEX,
CMD_STAT_INDEX,
CMD_PROP_INDEX,
CMD_TEST_INDEX,
};
// Example use of the iterator. Intended for the ESP32 console
// Caveat emptor: No express or implied warranty, functionality
// or fitness for any particular purpose
....
static int nvsdump_cmd(int argc, char** argv)
{
bool all = argc == 2 && *argv[1] == '*';
@armink
armink / user-profile.cmd
Last active February 10, 2018 02:47
在任意路径下【右键】使用 cmder_mini 打开 RT-Thread ENV 环境
:: ****************************************************************************
:: Copyright (c) 2018 Armink (armink.ztl@gmail.com)
:: This file is add for RT-Thread ENV initialization command
:: Happy coding on RT-Thread ENV :)
:: ****************************************************************************
:: 1. copy this file to cmder_mini/config/
:: 2. change your ENV path to ENV_ROOT on this file;
:: 3. add cmder_mini folder to windows PATH;
:: 4. execute 'Cmder.exe /REGISTER ALL' on windows command line by administrator permission;
@armink
armink / portevent_ucos.c
Created September 6, 2017 07:42
网友移植的基于 UCOS 的 Freemodbus 主/从协议栈移植代码,主站和从栈可以同时用。
/*
* FreeModbus Libary: STM32 Port
* Copyright (C) 2013 Armink <armink.ztl@gmail.com>
*
* 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,
@armink
armink / portevent_freertos.c
Last active September 27, 2024 06:15
网友移植的基于 FreeRTOS 的 Freemodbus 主/从协议栈移植代码,从栈没有用事件,主站和从栈可以同时用。
/*
* FreeModbus Libary: STM32 Port
* Copyright (C) 2013 Armink <armink.ztl@gmail.com>
*
* 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,
/* RT-Thread config file */
#ifndef __RTTHREAD_CFG_H__
#define __RTTHREAD_CFG_H__
/* RT_NAME_MAX*/
#define RT_NAME_MAX 24
/* RT_ALIGN_SIZE*/
#define RT_ALIGN_SIZE 4
@armink
armink / sync_time.sh
Created March 1, 2017 07:44
Liunx 时间同步脚本
#!/bin/sh
sudo ntpdate cn.ntp.org.cn
sudo hwclock --systohc
@armink
armink / rtt_iap_jump.c
Last active December 26, 2016 10:22
RT-Thread bootloader jump to RT-Thread app
/**
* Jump to user application.
*
* @return result
*/
IbootErrCode iap_jump_to_app(void) {
uint32_t jump_addr;
void (*jump_to_app)(void);
/* iap_app_addr must be initialize */
@armink
armink / rtt_flash_driver_bech.c
Created December 21, 2016 12:38
RT-Thread W25QX driver VS SFUD driver (SPI Flash Driver Bench)
static void rtt_flash_driver_bench(void) {
uint32_t start_time, time_cast;
static char buffer[4096] = { 0 };
size_t i;
w25qxx_init("rtt_w25q_driver", "spi10");
rt_device_t rtt_w25q_driver = rt_device_find("rtt_w25q_driver");
rt_device_t rtt_sfud_driver = rt_device_find("W25Q64");
rt_device_open(rtt_w25q_driver, RT_DEVICE_OFLAG_RDWR);
rt_device_open(rtt_sfud_driver, RT_DEVICE_OFLAG_RDWR);
/*
* File : usart.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2013, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs: