Skip to content

Commit

Permalink
OverSampling ATmega1280/2560-ATmega16/32U4-ESP8266 dedicated timing
Browse files Browse the repository at this point in the history
  • Loading branch information
gioblu committed Jan 15, 2017
1 parent fb43506 commit 9507cfc
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions strategies/OverSampling/Timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,46 @@
faster speed. Probably you need experience, time and an oscilloscope. */

#if defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
#if _OS_MODE == _STXRX882_STANDARD
#if OS_MODE == _STXRX882_STANDARD
#if F_CPU == 16000000L
#define OS_BIT_WIDTH 512
#define OS_BIT_SPACER 328
#endif
#endif
#endif

/* ATmega1280/2560 - Arduino Mega/Mega-nano --------------------------------- */
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
#if OS_MODE == _STXRX882_STANDARD
#define OS_BIT_WIDTH 508
#define OS_BIT_SPACER 332
#endif
#endif

/* ATmega16/32U4 - Arduino Leonardo/Micro ----------------------------------- */
#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)
#if OS_MODE == _STXRX882_STANDARD
#define OS_BIT_WIDTH 508
#define OS_BIT_SPACER 332
#endif
#endif

/* NodeMCU, generic ESP8266 ------------------------------------------------- */
#if defined(ESP8266)
#if _OS_MODE == _STXRX882_STANDARD
#if OS_MODE == _STXRX882_STANDARD
#if F_CPU == 80000000L
#define OS_BIT_WIDTH 486
#define OS_BIT_SPACER 298
#define OS_BIT_WIDTH 520
#define OS_BIT_SPACER 332
#endif
#endif
#endif

#ifndef OS_BIT_WIDTH
#define OS_BIT_WIDTH 512
#define OS_BIT_WIDTH 512 // 520 microseconds detected by oscilloscope
#endif

#ifndef OS_BIT_SPACER
#define OS_BIT_SPACER 328
#define OS_BIT_SPACER 328 // 340 microseconds detected by oscilloscope
#endif

/* The default response timeout setup dedicates the transmission time of 1 byte plus
Expand Down

0 comments on commit 9507cfc

Please sign in to comment.