Code Monkey home page Code Monkey logo

Comments (4)

mfalkvidd avatar mfalkvidd commented on June 2, 2024

attachInterrupt takes an uint8_t, so any value above 255 will result in whatever C does when things don't fit (360 - 256 is 104 so I guess it just ignores the higher bits). This normally result in warnings during compilation. Could you post the full output of the compilation?

from mysensors.

mfalkvidd avatar mfalkvidd commented on June 2, 2024

Could you also provide the full configure command? That would make it possible to try to reproduce the problem.

from mysensors.

mfalkvidd avatar mfalkvidd commented on June 2, 2024

When using ./configure --my-rf24-irq-pin=360 I get the following warnings, confirming that 360 is truncated to 104:

./hal/transport/RF24/driver/RF24.cpp: In function ‘bool RF24_initialize()’:
<command-line>: warning: unsigned conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} changes value from ‘360’ to ‘104’ [-Woverflow]
./hal/transport/RF24/driver/RF24.cpp:522:12: note: in expansion of macro ‘MY_RF24_IRQ_PIN’
  hwPinMode(MY_RF24_IRQ_PIN,INPUT);
            ^~~~~~~~~~~~~~~
In file included from ./MySensors.h:39,
                 from examples_linux/mysgw.cpp:82:
<command-line>: warning: unsigned conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} changes value from ‘360’ to ‘104’ [-Woverflow]
./hal/architecture/Linux/drivers/core/Arduino.h:40:62: note: in definition of macro ‘digitalPinToInterrupt’
 #define digitalPinToInterrupt(pin) RPi.digitalPinToInterrupt(pin)
                                                              ^~~
./hal/transport/RF24/driver/RF24.cpp:537:48: note: in expansion of macro ‘MY_RF24_IRQ_PIN’
  RF24_SPI.usingInterrupt(digitalPinToInterrupt(MY_RF24_IRQ_PIN));
                                                ^~~~~~~~~~~~~~~
<command-line>: warning: unsigned conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} changes value from ‘360’ to ‘104’ [-Woverflow]
./hal/architecture/Linux/drivers/core/Arduino.h:40:62: note: in definition of macro ‘digitalPinToInterrupt’
 #define digitalPinToInterrupt(pin) RPi.digitalPinToInterrupt(pin)
                                                              ^~~
./hal/transport/RF24/driver/RF24.cpp:539:40: note: in expansion of macro ‘MY_RF24_IRQ_PIN’
  attachInterrupt(digitalPinToInterrupt(MY_RF24_IRQ_PIN), RF24_irqHandler, FALLING);
                                        ^~~~~~~~~~~~~~~
./hal/architecture/Linux/MyMainLinuxGeneric.cpp: In function ‘void handle_sigint(int)’:
<command-line>: warning: unsigned conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} changes value from ‘360’ to ‘104’ [-Woverflow]
./hal/architecture/Linux/MyMainLinuxGeneric.cpp:45:18: note: in expansion of macro ‘MY_RF24_IRQ_PIN’
  detachInterrupt(MY_RF24_IRQ_PIN);

from mysensors.

DocRuben avatar DocRuben commented on June 2, 2024

My complete configure command getting this error is

./configure --spi-spidev-device=/dev/spidev1.0 --my-transport=rf24 --my-rf24-channel=76 --my-rf24-ce-pin=117 --my-rf24-cs-pin=227 --my-rf24-irq-pin=360 --my-rf24-pa-level=RF24_PA_MAX

When compiling I get a lot of warnings about different vars getting truncated both with and without specifying a IRQ-pin, in both cases it compiles sucsessfully but with the IRQ-pin specified I get the previous error at runtime.
Without it compiles and seams to run fine eaven though all warnings.

Attaching my output from make.
make.txt

from mysensors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.