PaulStoffregen / FreqCount

Measures the frequency of a signal by counting the number of pulses during a fixed time.
http://www.pjrc.com/teensy/td_libs_FreqCount.html
141 stars 45 forks source link

Teensy 4.0 #18

Open fbolze opened 3 years ago

fbolze commented 3 years ago

Good evening, thanks for this wonderful work. I try to implement a photon counting unit using an Hamamatsu module. I try to compile the code for teensy 4.0 and there is an error code, please see below. is there a way to solve this problem? thanks for your attention, cordially frederic

Arduino: 1.8.12 (Mac OS X), TD: 1.53, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"

In file included from /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:27:0: /Users/fbolze/Documents/Arduino/libraries/FreqCount/util/FreqCountTimers.h:64:4: error: #error "Unknown chip, please edit me with timer+counter definitions"

error "Unknown chip, please edit me with timer+counter definitions"

^

/Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp: In static member function 'static void FreqCountClass::begin(uint16_t)': /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:44:15: error: 'counter_init' was not declared in this scope counter_init(); ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:45:31: error: 'timer_init' was not declared in this scope gate_length = timer_init(msec); ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:46:19: error: 'SREG' was not declared in this scope uint8_t status = SREG; ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:48:14: error: 'timer_start' was not declared in this scope timer_start(); ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:50:16: error: 'counter_start' was not declared in this scope counter_start(); ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp: In static member function 'static uint32_t FreqCountClass::read()': /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:64:11: error: 'SREG' was not declared in this scope status = SREG; ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp: In static member function 'static void FreqCountClass::end()': /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:74:17: error: 'timer_shutdown' was not declared in this scope timer_shutdown(); ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:75:19: error: 'counter_shutdown' was not declared in this scope counter_shutdown(); ^ /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp: At global scope: /Users/fbolze/Documents/Arduino/libraries/FreqCount/FreqCount.cpp:79:4: error: expected constructor, destructor, or type conversion before '(' token ISR(TIMER_ISR_VECTOR) ^ Multiple libraries were found for "FreqCount.h" Used: /Users/fbolze/Documents/Arduino/libraries/FreqCount Not used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/FreqCount Error compiling for board Teensy 4.0.

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

MahdiShaban commented 3 years ago

Just check that you dont have libraries that are interfering in the IDE, in my case I deleted the library I downloaded from the Arduino library manager as it interferes with the libraries installed when you download teensyduino.