Added 20MHz support.

This commit is contained in:
Erik van der Zalm
2012-03-11 12:25:04 +01:00
parent 7cefad3744
commit 910f4e77a2
4 changed files with 84 additions and 11 deletions

View File

@ -236,8 +236,8 @@ FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
step_loops = 1;
}
if(step_rate < 32) step_rate = 32;
step_rate -= 32; // Correct for minimal speed
if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000);
step_rate -= (F_CPU/500000); // Correct for minimal speed
if(step_rate >= (8*256)){ // higher step rate
unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0];
unsigned char tmp_step_rate = (step_rate & 0x00ff);