Arduino Linux mint: error: ‘digitalPinToInterrupt’ - linux-mint

I wanted to interrupt a simple squared voltage and I was using a common program:
const byte ledPin = 13;
const byte interruptPin = 2;
volatile byte state = LOW;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
}
void loop() {
digitalWrite(ledPin, state);
}
void blink() {
state = !state;
}
But if I want to verify it with the Arduino Software, this is the error:
interrupt.ino: In function ‘void setup()’:
interrupt.ino:11:53: error: ‘digitalPinToInterrupt’ was not declared in this scope
I already tried adding libraries, which include this command, but I had problems finding them.
I am using Linux mint and the Arduino software version is:
arduino:
Installed: 2:1.0.5+dfsg2-4
Candidate: 2:1.0.5+dfsg2-4
Version table:
*** 2:1.0.5+dfsg2-4 500
And I couldn't install the IDE which I downloaded from https://www.arduino.cc
So this is the version of the package manager in Linux mint.
My question now is, does someone know where to find the libary which includes digitalPinToInterrupt().
There is no libary manager in this version of IDE, so perhaps someone knows how to get a newer version of IDE for Linuxmint.
Thank you

SOLVED
The version 1.8.2 for Linux 64bit on https://www.arduino.cc/en/Main/Software is defective. I found an other one on http://www.arduino.org/downloads.
This version also already includes digitalPinToInterrupt().

Related

Can't include <I2S.h> on ESP32 on neither VSCode PIO nor Arduino IDE

I've tried to get my ESP32 LOLIN32 with Arduino framework working, but I can't even upload code to it. I'm including nothing but Arduino and I2S but it doesn't understand what I mean with I2S.
I have only written:
#include <I2S.h>
#include <Arduino.h>
void setup(){
}
void loop(){
}
but it fails to compile and gives:
src\main.cpp:1:17: fatal error: I2S.h: No such file or directory
*************************************************************
* Looking for I2S.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:I2S.h"
* Web > https://registry.platformio.org/search?q=header:I2S.h
*
*************************************************************
Arduino IDE can't find it eather, I get the same error.
I've tried adding build_flags = -I and lib_deps in platform.ini:
[env:lolin32]
platform = espressif32
board = lolin32
framework = arduino
build_flags = -I include
lib_deps =
I2S
to no avail.
I2S.h was added to arduino-esp32 from version 2.0.3-RC1.
The OP does not describe the used version, but I guess it is older than the mentioned 2.0.3
I suggest updating arduino-esp32

Compiling RTX Kernel files using GCC Compiler in Eclipse IDE

We have a project in KEIL IDE for LPC2148 which has RTX kernel programs along with other programs in it, which was compiled by ARM CC.Now we need to change the IDE from KEIL(ARM CC) to Eclipse(GCC). When we tried to compile it in Eclipse GCC Compiler, it is showing errors in RTX_Config.c and RTX_Config.h files. Other files are compiled successfully using GCC compiler. But RTXConfig.c file has compiler specific codes which are not getting compiled by GCC. Is there any solution to compile this project in Eclipse IDE using GCC compiler? Please help me out in this as am a beginner. Thanks in advance
We have some keil specific keywords like irq , __swi, __task , __asm which is compiled successfully by ARM CC (keil), but when we tried to port it to GCC Compiler (Eclipse), This compiler cannot compile these keywords and showing errors.
Is there any way to compile these keil specific keywords in GCC Compiler?
do_software_interrupt, do_irq and do_fiq are interrupt service routines for SWI, IRQ and FIQ respectively. These functions are implemented in c using gcc’s attribute feature. Here is the actual c code containing routines for irq, fiq and software interrupt.
entry.c
void __attribute__((interrupt("IRQ"))) do_irq()
{
//your irq service code goes here
}
void __attribute__((interrupt("FIQ"))) do_fiq()
{
//your fiq service code goes here
}
void __attribute__((interrupt("SWI"))) do_software_interrupt()
{
volatile unsigned int int_num;
asm("LDR r0, [lr, #-4]");
asm("BIC r0, #0xFF000000");
asm("MOV %0, r0":"=r"(int_num):);
//based on int_num, you can determine which system call is called
}
void c_start() {
asm volatile ("SVC 0x5");
while(1){}
}

Configure Java CV with eclipse juno

I am having a 64-bit windows 7 laptop.
I have opencv version 2.4.2. I have extracted it in the C:
I have eclipse juno classic on my laptop.
Jdk 7 64-bit version is installed and and path variable set so i can access javac from CMD.
I have javacv-0.2 downloaded from google projects.
for opencv i have added following path to the classpath variable.
C:\opencv\build\x64\vc10\bin;C:\opencv\build\common\tbb\intel64\vc10\
I have installed Microsoft Visual C++ 2010 Redistributable Package (x64)
I have inclused javacv.jar, javacpp.jar and javacv-windows-x86_64.jar in the ProjectBuildPath of eclipse.
Yet when i try to write following program function cvLoadImage(), cvSmooth(), cvSaveImage and cvReleaseImage() they are not identified and available to me.
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
public class ssss {
public static void main(String filename) {
IplImage image = cvLoadImage(filename);
if (image != null) {
cvSmooth(image, image, CV_GAUSSIAN, 3);
cvSaveImage(filename, image);
cvReleaseImage(image);
}
}
}
Please guide me. If you need any other information regarding it do let know.
I followed the instruction available at this link to configure java-cv: http://ganeshtiwaridotcomdotnp.blogspot.in/2011/12/opencv-javacv-eclipse-project.html
Regards,
Priyank
You have mentioned that you are using 64bit system. But you have set path for 32bit binaries. correct path for 64 bit system should be
C:\opencv\build\x64\vc10\bin;C:\opencv\build\common\tbb\intel64\vc10\

Why MinGW couldn't find memcpy?

I just installed MinGW + MSYS in Windows XP using graphical installer. Everything seems fine.
However, when I try to build a C++ application using ./configure, make, make install, it shows error message. The following 2 checkings failed:
AC_CHECK_LIB(m, memcpy, [], [AC_MSG_ERROR([error msg])])
AC_CHECK_FUNC(memcpy, [],[AC_MSG_ERROR([error msg])])
Why my MinGW couldn't find memcpy and its library? Can anyone give me suggestion how to fix this error? Thank you.
void * memcpy ( void * destination, const void * source, size_t num );
Copy block of memory, copies the values of num bytes from the location pointed by source directly to the memory block pointed by destination.
For reference please see http://www.cplusplus.com/reference/cstring/memcpy/

Static linking issue on Solaris sparc

Undefined symbols Error while statically linking xerces with application only on solaris sparc, whereas static linking on other platforms(Linux, HP-UX,Solaris-x86) working.
Here are errors.
Undefined first referenced
symbol in file
void xercesc_2_8::JanitorMemFunCall<xercesc_2_8::XMLNotationDecl>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(XMLNotationDecl.o)
const xercesc_2_8::XMLAttr*xercesc_2_8::BaseRefVectorOf<xercesc_2_8::XMLAttr>::elementAt(const unsigned)const /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(SAX2XMLReaderImpl.o)
void xercesc_2_8::RefHashTableOf<xercesc_2_8::KVStringPair>::put(void*,xercesc_2_8::KVStringPair*const) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(DatatypeValidatorFactory.o)
socket /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(UnixHTTPURLInputStream.o)
xercesc_2_8::SchemaElementDecl*xercesc_2_8::Janitor<xercesc_2_8::SchemaElementDecl>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
void xercesc_2_8::ValueVectorOf<xercesc_2_8::DOMNode*>::addElement(xercesc_2_8::DOMNode*const&) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(GeneralAttributeCheck.o)
unsigned xercesc_2_8::RefHashTableOf<xercesc_2_8::XercesAttGroupInfo>::getHashModulus()const /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(XTemplateSerializer.o)
bool xercesc_2_8::RefHashTableOf<xercesc_2_8::XMLAttDef>::containsKey(const void*const)const /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
void xercesc_2_8::JanitorMemFunCall<xercesc_2_8::IdentityConstraintHandler>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(IdentityConstraintHandler.o)
xercesc_2_8::XMLHolder<_pthread_mutex>::~XMLHolder() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(SolarisPlatformUtils.o)
void xercesc_2_8::ValueHashTableOf<unsigned short>::put(void*,const unsigned short&) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(GeneralAttributeCheck.o)
void xercesc_2_8::ValueHashTableOf<unsigned>::put(void*,const unsigned&) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
xercesc_2_8::RefVectorOf<xercesc_2_8::DOMImplementationSource>::~RefVectorOf() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(DOMImplementationRegistry.o)
void xercesc_2_8::JanitorMemFunCall<xercesc_2_8::FieldValueMap>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(FieldValueMap.o)
void xercesc_2_8::Janitor<xercesc_2_8::SchemaAttDef>::orphan() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
xercesc_2_8::SchemaInfo&xercesc_2_8::BaseRefVectorEnumerator<xercesc_2_8::SchemaInfo>::nextElement() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
void xercesc_2_8::BaseRefVectorOf<xercesc_2_8::ENameMap>::addElement(xercesc_2_8::ENameMap*const) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TransService.o)
Sachin,can you please provide your link line, as reported by your build system?
This will show what libraries are being used in what order and what flags are being invoked. (I expect this is a CC command, not ld.)
Also to respond to Erik, Solaris 10 does support static linking -- you can link a static library (.a file) with your binary -- what it doesn't support is linking the Solaris system libraries statically. Sachin, from the errors it look like you're linking your own static xerces library against your binary, which is fine in S10.
As far as compiling and linking is concerned, there is no difference between Solaris running on x86 and SPARC. You certainly can build and link with static libraries on Solaris 10 (and 11). One notable exception would be the C library which is only provided as a dynamic library, but the error messages you show are unrelated to libc.
What version of solaris are you using? If it's solaris 10 then you're out of luck, it no longer supports static linking.
See here.