Hi all!
I would like to modify the behaviour of the command "halt" which is been created to shutdown the raspberry system in a safe way.
The natural behaviour of the "halt" command is:
- to dismount everything (action A) and than
- program the raspberry hw to do not use anymore the power (action B).
I would like to add a new "action C" between the actions A and B.
I immagine that after the action A many of the linux functionalities aren't anymore available. So I suppose that the new action C should be coded in "C" at kernel level.
The "action C" I want to realize is very simple: I want to drive a GPIO pin at 1 level and than wait some time (about 1 sec) in a strict loop.
In this way I will be able to switch off the rechargeable battery that supplies the raspberry pi board. So I prevent the dammages caused by an over discharge.
Unfortunately I'm not even able to find the code currently executed by the command "halt".
Does anyone can help me?
Many thanks in advance!
Bye