/*
ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT 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 3 of the License, or
(at your option) any later version.
ChibiOS/RT 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 .
*/
/**
* @page article_timing Reliable timings using Threads
* One common task is to have threads do something at regular, scheduled,
* intervals.
* An obvious solution is to write something like this:
* @code
msg_t my_thread(void *param) {
while (TRUE) {
do_something();
chThdSleepMilliseconds(1000); /* Fixed interval */
}
}
* @endcode
* This example works well assuming that @p do_something() execution time is
* well below the system tick period and that @p my_thread() is not preempted
* by other threads inserting long intervals.
* If the above conditions are not satisfied you may have @p do_something()
* executed at irregular intervals, as example:
* T0...T0+1000...T0+2002...T0+3002...T0+4005...etc.
* Also note that the error increases over time and this kind of behavior can
* lead to anomalies really hard to debug.
*
blob: 897b833e1a7d741323794624f26baa4ddbbbb453 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
VUSB_DIR = protocol/vusb
OPT_DEFS += -DPROTOCOL_VUSB
SRC += $(VUSB_DIR)/main.c \
$(VUSB_DIR)/vusb.c \
$(VUSB_DIR)/usbdrv/usbdrv.c \
$(VUSB_DIR)/usbdrv/usbdrvasm.S \
$(VUSB_DIR)/usbdrv/oddebug.c
ifdef NO_UART
SRC += $(COMMON_DIR)/sendchar_null.c
else
SRC += $(COMMON_DIR)/sendchar_uart.c \
$(COMMON_DIR)/uart.c
endif
# Search Path
VPATH += $(TMK_PATH)/$(VUSB_DIR)
VPATH += $(TMK_PATH)/$(VUSB_DIR)/usbdrv
|