3

I am trying to edit the timer of heartbeat trigger on RPi Zero. I have found original .c file of kernel driver here https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/leds/trigger/ledtrig-heartbeat.c. But when I look into my Pi's kernel drivers, in directory with triggers /lib/modules/5.4.51+/kernel/drivers/leds/trigger there are only three triggers and none of them are heartbeat : ledtrig-camera.ko ledtrig-netdev.ko ledtrig-transient.ko. So I am assuming the heartbeat trigger is defined elsewhere.

Where can I find and edit the heartbeat trigger of led ?

1 Answers1

1

In order to build a kernel object for ledtrig-heartbeat.c, you need to add CONFIG_LEDS_TRIGGER_HEARTBEAT=Y to your kernel configuration:

 config LEDS_TRIGGER_HEARTBEAT
    tristate "LED Heartbeat Trigger"
    help
      This allows LEDs to be controlled by a CPU load average.
      The flash frequency is a hyperbolic function of the 1-minute
      load average.
If unsure, say Y.

Kernel configuration can usually be changed by running make menuconfig in the kernel source folder.

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147