Welcome! Log In Create A New Profile

Advanced

I found something in temperature.h I'm wondering about

Posted by agrub918 
I found something in temperature.h I'm wondering about
February 19, 2019 06:44PM
I was looking around in the firmware and saw that
MAX is uppercase and in a previous version it was lowercase. Isn't arduino case sensitive. Is this something done on purpose?
This is what it has (when I preview this the hot smiley pops up in the code on the one with capital letters)
#define ACTUAL_ADC_SAMPLES MAhot smileyint(MIN_ADC_ISR_LOOPS), int(SensorsReady))

should it be this?
#define ACTUAL_ADC_SAMPLES max(int(MIN_ADC_ISR_LOOPS), int(SensorsReady))
Re: I found something in temperature.h I'm wondering about
February 19, 2019 07:43PM
yes smiles are a pain in the ass when posting code, and a general eye saw. wish you could turn them off (there is a forum plugin, but its not active)

they are using uppercase to get away from the arduino specific stuff to make it multi platform

take a look in macros.h they define their own

  #define MAX (a, b) \
    ({__typeof__(a) _a = (a); \
      __typeof__(b) _b = (b); \
      _a > _b ? _a : _b;})

Edited 1 time(s). Last edit at 02/19/2019 07:43PM by Dust.
Re: I found something in temperature.h I'm wondering about
February 19, 2019 08:02PM
Oh cool I just learned something, Thanks!
Sorry, only registered users may post in this forum.

Click here to login