Build pico-example/cdc_msc sample on qmk build system Add usb descriptors Use usb config in config.h tentative implementation Enable debug print by cdc Process queued transfer before new report Fix dprint hang on Windows resolve warnings Add pico uart/i2c/spi sources Trim mouse report ID before send implement atomic_util Add eeprom emulation Save emulated eeprom by CLI comamnd Delete unused file Implement RGBLIGHT Add pio_manager Implement split Chang default serial speed Print elf size Fix make command Add eeprom save command to keymaps Reset when CDC baudrate is 1200bps Replace pro micro pin config to RP2040 pro micro Add i2c functions Disable LTO automatically Add CTPIM, CONVERT_TO_PICO_MICRO option Add MIDI functions Call usb_task() in midi send function Convert pico-sdk results to i2c_status Add build target uf2 to rp2040 Remove unused parts Fix warnings rp2040 samples: Update readme.md Check pico-sdk setup Implement lazy write back from eepemu to ROM Add PiPi Gherkin Change DDYNAMIC_KEYMAP_EEPROM_MAX_ADDR to 4095 PiPi Gherkin: Increase DYNAMIC_KEYMAP_LAYER_COUNT to 6 Change interface number of RAW to 1 due to VIA restriction Generate bs2_default_padded_checksummed.S at build time Calculate eeprom emulation region Fix warning Add pico/usb_util.c to SRC Fix pico's split Add keyboard_quantizer/rp Add pwm driver Remove unused file Add analog.c Change default FLASH clock div to 4 Fix merge mistakes and issues. rejig files remove ugfx more rejigging remove qmk_main add watchdog back
67 lines
1.4 KiB
C
67 lines
1.4 KiB
C
/*
|
|
Copyright 2011 Jun Wako <wakojun@gmail.com>
|
|
|
|
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, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include "timer.h"
|
|
#include "pico/stdlib.h"
|
|
|
|
/** \brief timer initialization
|
|
*
|
|
* FIXME: needs doc
|
|
*/
|
|
void timer_init(void) {
|
|
}
|
|
|
|
/** \brief timer read
|
|
*
|
|
* FIXME: needs doc
|
|
*/
|
|
inline uint16_t timer_read(void) {
|
|
|
|
return (to_ms_since_boot(get_absolute_time()) & 0xFFFF);
|
|
}
|
|
|
|
/** \brief timer read32
|
|
*
|
|
* FIXME: needs doc
|
|
*/
|
|
inline uint32_t timer_read32(void) {
|
|
return (to_ms_since_boot(get_absolute_time()) & 0xFFFFFFFF);
|
|
}
|
|
|
|
/** \brief timer elapsed
|
|
*
|
|
* FIXME: needs doc
|
|
*/
|
|
inline uint16_t timer_elapsed(uint16_t last) {
|
|
uint32_t t;
|
|
|
|
t = timer_read32();
|
|
|
|
return TIMER_DIFF_16((t & 0xFFFF), last);
|
|
}
|
|
|
|
/** \brief timer elapsed32
|
|
*
|
|
* FIXME: needs doc
|
|
*/
|
|
inline uint32_t timer_elapsed32(uint32_t last) {
|
|
uint32_t t;
|
|
|
|
t = timer_read32();
|
|
|
|
return TIMER_DIFF_32(t, last);
|
|
}
|