C语言小程序
低调奢华猿
这个作者很懒,什么都没留下…
展开
-
printf实用封装
封装一:#define my_debug_firmware printf#define my_app_debug(x,y...) my_debug_firmware("app debug =>fun(%s)line:%d:->"x,__FUNCTION__,__LINE__,##y)#define my_net_debug(x,y...) my_debug_firmware("net debug =>fun(%s)line:%d:->"x,__FUNCTION__,__LINE转载 2020-10-30 23:17:43 · 593 阅读 · 0 评论 -
控制台队列程序 --- 定时器定时入队
1、简单的队列入队、出队实现,2、控制台线程开启定时器,定时入队3、控制台获取系统时间,并随出队打印queue.h文件#ifndef QUEUE_H_#define QUEUE_H_#include "stdio.h"#include "stdlib.h"#include "string.h"#include "time.h"#define QUEUE_OK 1#def...原创 2019-03-01 14:27:32 · 199 阅读 · 0 评论 -
debug打印带打印调试级别的万用模板
带调试等级的打印,用起来很方便!!!! #include "stdlib.h"#include "string.h"#include "stdio.h"#include <stdarg.h>typedef unsigned char uint原创 2019-03-01 14:11:40 · 670 阅读 · 0 评论 -
C语言实现了crontab表达式执行时间
公司有个嵌入式低功耗项目,项目需求中有一项是仿照Linux cron task的定时设置,作为设备定时唤醒时间。于是就自己琢磨写了C语言的Crontab表达式执行时间,各种调试结果与在线工具一致。用到了基姆拉尔森计算公式计算星期,Linux源码中的Crond.c文件的ParseField函数。希望能对同行有帮助。crontab表达式的知识请自行百度。先讲讲实现思路:1、参考Linux源码中的...原创 2019-08-30 14:38:26 · 2174 阅读 · 0 评论 -
Unix时间戳转北京时间 UTC时间转北京时间 C代码实现
参考大佬源码,做个记录,#include "stdio.h"#include <stdio.h>#include <stdlib.h>#include <time.h>#include <string.h>typedef unsigned int uint32_t;typedef unsigned char uint8_t;ty...转载 2019-09-03 15:58:39 · 771 阅读 · 0 评论