C Macro – how to get an integer value into a string literal [duplicate]

I think it’s good to have a stringifying macro in your utils header: #define STR_IMPL_(x) #x //stringify argument #define STR(x) STR_IMPL_(x) //indirection to expand argument macros Then you can keep the macro numerical and stringify it on the spot: #define LEDS 48 int x = LEDS; void DrawFrame() { asm( “ldi R27, 0x00 \n\t” “ldi … Read more

What happens when an ISR is running and another interrupt happens?

Normally, an interrupt service routine proceeds until it is complete without being interrupted itself in most of the systems. However, If we have a larger system, where several devices may interrupt the microprocessor, a priority problem may arise. If you set the interrupt enable flag within the current interrupt as well, then you can allow … Read more

Mixing C and assembly sources and build with cmake

CMake supports assembler out of the box. Just be sure to enable the “ASM” language in your project. If an assembler source file needs preprocessing, also set the source file’s compilation options: project(assembler C ASM) set_property(SOURCE foo.s APPEND PROPERTY COMPILE_OPTIONS “-x” “assembler-with-cpp”) add_executable(hello foo.s bar.c)

How can I unit test Arduino code?

Don’t Run Unit Tests on the Arduino Device or Emulator The case against microcontroller Device/Emulator/Sim-based tests There’s a lot of discussion about what unit test means and I’m not really trying to make an argument about that here. This post is not telling you to avoid all practical testing on your ultimate target hardware. I … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)