/* * This file is part of the flashrom project. * * Copyright (C) 2000 Silicon Integrated System Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "flash.h" // count to a billion. Time it. If it's < 1 sec, count to 10B, etc. unsigned long micro = 1; void myusec_delay(int time) { volatile unsigned long i; for (i = 0; i < time * micro; i++) ; } void myusec_calibrate_delay() { int count = 1000; unsigned long timeusec; struct timeval start, end; int ok = 0; printf("Calibrating delay loop... "); while (!ok) { gettimeofday(&start, 0); myusec_delay(count); gettimeofday(&end, 0); timeusec = 1000000 * (end.tv_sec - start.tv_sec) + (end.tv_usec - start.tv_usec); count *= 2; if (timeusec < 1000000 / 4) continue; ok = 1; } // compute one microsecond. That will be count / time micro = count / timeusec; printf_debug("%ldM loops per second. ", (unsigned long)micro); printf("OK.\n"); } 7f6aa2ebb37c93409e691'>treecommitdiffstats
blob: 8c0ebaa2438f54de4cdf58f42f9d4f9b5bc472b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 获得帮助

有很多方法来获得关于QMK的帮助.

## 实时聊天

你可以在我们的主要[Discord服务器](https://discord.gg/Uq7gcHh)找到QMK的开发者和用户。有很多讨论固件的不同频道, 工具箱(Toolbox), 硬件,配置工具(configurator).

## OLKB Subreddit

QMK的官方论坛是[/r/olkb](https://reddit.com/r/olkb) 在[reddit.com](https://reddit.com)上.

## GitHub的Issue

你可以在GitHub上 [提出issue](https://github.com/qmk/qmk_firmware/issues).当您的问题需要长期讨论或调试时,这尤其方便。