I have not used hash before but I have a two files as shown below . How to put its contents into hash in such a way that PIO_M_U_PIO55_1 ,PIO_M_U_PIO55_2
etc becomes the keys and 896, 895
as its values so that its easy to access it in other files . Similarly for second file UART_10,UART_13
etc become the key and PIO_M_U_PIO55_1
etc as its value so that i can access 896
directly by UART_10
. any other way is also welcomed...
#define PIO_M_U_PIO55_1 896
#define PIO_M_U_PIO55_2 895
#define PIO_M_U_PIO57_3 894
#define PIO_M_U_PIO55_4 893
and so on.....huge file
Similarly one more file
#define UART_10 PIO_M_U_PIO55_1
#define UART_13 PIO_M_U_PIO55_2
#define UART_11 PIO_M_U_PIO57_3
and so on ...
See Question&Answers more detail:os