diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-23 13:28:44 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-23 13:28:44 +0000 |
commit | bd5e8f07b71b4fa0c058c0edfa8ff3f59ab31610 (patch) | |
tree | 2134708569c80cf166664ef6ad3aeba9a9e08d9a /Projects/AVRISP/Lib/ISPProtocol.h | |
parent | be71f934a4434ebeab7e9c2263ffb1170499a169 (diff) | |
download | lufa-bd5e8f07b71b4fa0c058c0edfa8ff3f59ab31610.tar.gz lufa-bd5e8f07b71b4fa0c058c0edfa8ff3f59ab31610.tar.bz2 lufa-bd5e8f07b71b4fa0c058c0edfa8ff3f59ab31610.zip |
Stub out more of the TPI programming protocol routines in the AVRISP project.
Diffstat (limited to 'Projects/AVRISP/Lib/ISPProtocol.h')
-rw-r--r-- | Projects/AVRISP/Lib/ISPProtocol.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Projects/AVRISP/Lib/ISPProtocol.h b/Projects/AVRISP/Lib/ISPProtocol.h index 4bbffbbd1..85a669a4e 100644 --- a/Projects/AVRISP/Lib/ISPProtocol.h +++ b/Projects/AVRISP/Lib/ISPProtocol.h @@ -64,6 +64,26 @@ #define PROG_MODE_PAGED_READYBUSY_MASK (1 << 6)
#define PROG_MODE_COMMIT_PAGE_MASK (1 << 7)
+ /* Inline Functions: */
+ /** Blocking delay for a given number of milliseconds, via a hardware timer.
+ *
+ * \param[in] DelayMS Number of milliseconds to delay for
+ */
+ static inline void ISPProtocol_DelayMS(uint8_t DelayMS)
+ {
+ TCNT0 = 0;
+ TIFR0 = (1 << OCF1A);
+
+ while (DelayMS)
+ {
+ if (TIFR0 & (1 << OCF1A))
+ {
+ TIFR0 = (1 << OCF1A);
+ DelayMS--;
+ }
+ }
+ }
+
/* Function Prototypes: */
void ISPProtocol_EnterISPMode(void);
void ISPProtocol_LeaveISPMode(void);
|