openwch / arduino_core_ch32

Core library for CH32duino
269 stars 52 forks source link

util/atomic.h not found #85

Open Styne13 opened 7 months ago

Styne13 commented 7 months ago

Hi,

thank you for the great work on this project.

I try to use ch32v003 with the radiohead library to connect to ASK or Lora RF modules. If I try to compile the code, I get util/atomic.h not found. I had a look and it is normally located in the avr code for original arduino, so I would guess the core ch32 shall adapt it somehow to be compatible.

maxint-rd commented 7 months ago

Have you tried this release? It contains a folder named RHutil, which also contains atomic.h.

Styne13 commented 6 months ago

Thank you for your advice. 👍 I will try out this fork of the library.

Styne13 commented 6 months ago

Ok, looked into the code of the library and RHutil/atomic.h is only used in the case of arm If I try to include it in else path, other things like ATOMIC_BLOCK are not declared.

TianpeiLee commented 6 months ago

@Styne13 Can you provide the function declaration for the atomic operation you need so that I can know what functions I need to provide? The AMO extension of RISC-V provides the following instructions: amo.zip

fearpro13 commented 1 month ago

@TianpeiLee Encountered same problem, missing atomic.h for RadioHead library

Function definitions that needs to be provided are here: https://github.com/epsilonrt/RadioHead/blob/master/RHutil/atomic.h