BUG haptics_handler.c

There appear to be mistakes in haptics_handler.c it appears to be using outdated functions / includes in NCS 3.2.1:

The corrections that work for me:

#include <zephyr/internal/syscall_handler.h>
#include <zephyr/drivers/haptics.h>

static inline int z_vrfy_haptics_start_output(const struct device *dev)
  {
        K_OOPS(K_SYSCALL_DRIVER_HAPTICS(dev, start_output));
        return z_impl_haptics_start_output(dev);
  }
  #include <zephyr/syscalls/haptics_start_output_mrsh.c>

  static inline int z_vrfy_haptics_stop_output(const struct device *dev)
  {
        K_OOPS(K_SYSCALL_DRIVER_HAPTICS(dev, stop_output));
        return z_impl_haptics_stop_output(dev);
  }
  #include <zephyr/syscalls/haptics_stop_output_mrsh.c>

Changes made:

#include <zephyr/syscall_handler.h> --> #include <zephyr/internal/syscall_handler.h>
Z_OOPS --> K_OOPS
Z_SYSCALL_DRIVER_HAPTICS --> K_SYSCALL_DRIVER_HAPTICS
Without these changes my build was failing
/home/simonukadin/ncs/v3.2.1/zephyr/drivers/haptics/haptics_handlers.c:12:9: warning: implicit declaration of function 'Z_OOPS'; did you mean 'K_OOPS'? [-Wimplicit-function-declaration]
   12 |         Z_OOPS(Z_SYSCALL_DRIVER_HAPTICS(dev, start_output));
      |         ^~~~~~
      |         K_OOPS
/home/simonukadin/ncs/v3.2.1/zephyr/drivers/haptics/haptics_handlers.c:12:16: warning: implicit declaration of function 'Z_SYSCALL_DRIVER_HAPTICS'; did you mean 'K_SYSCALL_DRIVER_HAPTICS'? [-Wimplicit-function-declaration]
   12 |         Z_OOPS(Z_SYSCALL_DRIVER_HAPTICS(dev, start_output));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
      |                K_SYSCALL_DRIVER_HAPTICS
/home/simonukadin/ncs/v3.2.1/zephyr/drivers/haptics/haptics_handlers.c:12:46: error: 'start_output' undeclared (first use in this function)
   12 |         Z_OOPS(Z_SYSCALL_DRIVER_HAPTICS(dev, start_output));
      |                                              ^~~~~~~~~~~~
/home/simonukadin/ncs/v3.2.1/zephyr/drivers/haptics/haptics_handlers.c:12:46: note: each undeclared identifier is reported only once for each function it appears in
/home/simonukadin/ncs/v3.2.1/zephyr/drivers/haptics/haptics_handlers.c: In function 'z_vrfy_haptics_stop_output':
/home/simonukadin/ncs/v3.2.1/zephyr/drivers/haptics/haptics_handlers.c:21:46: error: 'stop_output' undeclared (first use in this function)
   21 |         Z_OOPS(Z_SYSCALL_DRIVER_HAPTICS(dev, stop_output));
      |                                              ^~~~~~~~~~~
[399/433] Building C object modules/hal_nordic/modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/home/simonukadin/ncs/v3.2.1/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
ninja: build stopped: subcommand failed.
[10/20] No configure step for 'mcuboot'
FAILED: _sysbuild/sysbuild/images/smartcup-prefix/src/smartcup-stamp/smartcup-build /usr/projects/smartcup/build_smartcup/_sysbuild/sysbuild/images/smartcup-prefix/src/smartcup-stamp/smartcup-build 
cd /usr/projects/smartcup/build_smartcup/smartcup && /home/simonukadin/ncs/toolchains/43683a87ea/usr/local/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/simonukadin/ncs/toolchains/43683a87ea/usr/local/bin/cmake --build /usr/projects/smartcup/build_smartcup
     
     
     
     
/home/simonukadin/ncs/v3.2.1/zephyr/drivers/haptics/haptics_handlers.c:7:10: fatal error: zephyr/syscall_handler.h: No such file or directory
    7 | #include <zephyr/syscall_handler.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Parents Reply Children
Related