diff --git a/examples/SMA/Decoder_10Serv_7LED_4Function/Decoder_10Serv_7LED_4Function.ino b/examples/SMA/Decoder_10Serv_7LED_4Function/Decoder_10Serv_7LED_4Function.ino index 57efba5..27bbf41 100755 --- a/examples/SMA/Decoder_10Serv_7LED_4Function/Decoder_10Serv_7LED_4Function.ino +++ b/examples/SMA/Decoder_10Serv_7LED_4Function/Decoder_10Serv_7LED_4Function.ino @@ -68,7 +68,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -407,7 +406,7 @@ void loop() //**************************************************************** } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 diff --git a/examples/SMA/Decoder_13Serv_4LED_4Function/Decoder_13Serv_4LED_4Function.ino b/examples/SMA/Decoder_13Serv_4LED_4Function/Decoder_13Serv_4LED_4Function.ino index cb6a608..049f60d 100755 --- a/examples/SMA/Decoder_13Serv_4LED_4Function/Decoder_13Serv_4LED_4Function.ino +++ b/examples/SMA/Decoder_13Serv_4LED_4Function/Decoder_13Serv_4LED_4Function.ino @@ -68,7 +68,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -407,7 +406,7 @@ void loop() //**************************************************************** } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 diff --git a/examples/SMA/Decoder_15_Servos_1LED_4Function/Decoder_15_Servos_1LED_4Function.ino b/examples/SMA/Decoder_15_Servos_1LED_4Function/Decoder_15_Servos_1LED_4Function.ino index 524d77f..5d38f9b 100755 --- a/examples/SMA/Decoder_15_Servos_1LED_4Function/Decoder_15_Servos_1LED_4Function.ino +++ b/examples/SMA/Decoder_15_Servos_1LED_4Function/Decoder_15_Servos_1LED_4Function.ino @@ -68,7 +68,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -407,7 +406,7 @@ void loop() //**************************************************************** } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 diff --git a/examples/SMA/Decoder_17LED_1Function/DecoderNmraDcc_4.ino b/examples/SMA/Decoder_17LED_1Function/DecoderNmraDcc_4.ino index 0159dbf..57ad538 100755 --- a/examples/SMA/Decoder_17LED_1Function/DecoderNmraDcc_4.ino +++ b/examples/SMA/Decoder_17LED_1Function/DecoderNmraDcc_4.ino @@ -33,7 +33,6 @@ DCC_MSG Packet ; #define This_Decoder_Address 17 -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -89,7 +88,7 @@ void loop() } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { diff --git a/examples/SMA/Decoder_17LED_4Function/Decoder_17LED_4Function.ino b/examples/SMA/Decoder_17LED_4Function/Decoder_17LED_4Function.ino index ea23b1b..ae27ca6 100755 --- a/examples/SMA/Decoder_17LED_4Function/Decoder_17LED_4Function.ino +++ b/examples/SMA/Decoder_17LED_4Function/Decoder_17LED_4Function.ino @@ -68,7 +68,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -407,7 +406,7 @@ void loop() //**************************************************************** } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 diff --git a/examples/SMA/Decoder_17LED_5FTN_Fade/Decoder_17LED_5FTN_Fade.ino b/examples/SMA/Decoder_17LED_5FTN_Fade/Decoder_17LED_5FTN_Fade.ino index 169e87c..1e68653 100755 --- a/examples/SMA/Decoder_17LED_5FTN_Fade/Decoder_17LED_5FTN_Fade.ino +++ b/examples/SMA/Decoder_17LED_5FTN_Fade/Decoder_17LED_5FTN_Fade.ino @@ -67,7 +67,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -416,7 +415,7 @@ void loop() //**************************************************************** } } -extern void notifyDccFunc( uint16_t Addr, uint8_t FuncNum, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { if (FuncNum==1) { //Function Group 1 F0 F4 F3 F2 F1 exec_function( 0, FunctionPin0, (FuncState&0x10)>>4 ); exec_function( 1, FunctionPin1, (FuncState&0x01 )); diff --git a/examples/SMA/Decoder_17Pulsed_5Function/Decoder_17Pulsed_5Function.ino b/examples/SMA/Decoder_17Pulsed_5Function/Decoder_17Pulsed_5Function.ino index c82dc2a..2fd1c81 100755 --- a/examples/SMA/Decoder_17Pulsed_5Function/Decoder_17Pulsed_5Function.ino +++ b/examples/SMA/Decoder_17Pulsed_5Function/Decoder_17Pulsed_5Function.ino @@ -71,7 +71,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -420,7 +419,7 @@ void loop() //**************************************************************** } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 diff --git a/examples/SMA/Decoder_2MotDrive_12LED_1Servo/Decoder_2MotDrive_12LED_1Servo.ino b/examples/SMA/Decoder_2MotDrive_12LED_1Servo/Decoder_2MotDrive_12LED_1Servo.ino index 60c6a73..db64c10 100755 --- a/examples/SMA/Decoder_2MotDrive_12LED_1Servo/Decoder_2MotDrive_12LED_1Servo.ino +++ b/examples/SMA/Decoder_2MotDrive_12LED_1Servo/Decoder_2MotDrive_12LED_1Servo.ino @@ -85,7 +85,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -470,7 +469,7 @@ void gobwd2(int bcnt,int bcycle) { icnt++; } } -extern void notifyDccSpeed( uint16_t Addr, uint8_t Speed, uint8_t ForwardDir, uint8_t MaxSpeed ) { +void notifyDccSpeed( uint16_t Addr, uint8_t Speed, uint8_t ForwardDir, uint8_t MaxSpeed ) { if (Function13_value==1) { Motor1Speed = Speed; Motor1ForwardDir = ForwardDir; @@ -482,7 +481,7 @@ extern void notifyDccSpeed( uint16_t Addr, uint8_t Speed, uint8_t ForwardDir, ui Motor2MaxSpeed = MaxSpeed; } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 @@ -669,4 +668,5 @@ void detach_servo (int servo_num) { default: break; } -} +} + diff --git a/examples/SMA/Decoder_7Servos_10LED_4Function/Decoder_7Servos_10LED_4Function.ino b/examples/SMA/Decoder_7Servos_10LED_4Function/Decoder_7Servos_10LED_4Function.ino index 904291a..33e221a 100755 --- a/examples/SMA/Decoder_7Servos_10LED_4Function/Decoder_7Servos_10LED_4Function.ino +++ b/examples/SMA/Decoder_7Servos_10LED_4Function/Decoder_7Servos_10LED_4Function.ino @@ -68,7 +68,6 @@ struct QUEUE }; QUEUE *ftn_queue = new QUEUE[16]; -extern uint8_t Decoder_Address = This_Decoder_Address; struct CVPair { uint16_t CV; @@ -407,7 +406,7 @@ void loop() //**************************************************************** } } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { switch(FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 diff --git a/examples/SMA/Decoder_Dir_and_Fade/Decoder_Dir_and_Fade.ino b/examples/SMA/Decoder_Dir_and_Fade/Decoder_Dir_and_Fade.ino index f18c087..1637cfe 100755 --- a/examples/SMA/Decoder_Dir_and_Fade/Decoder_Dir_and_Fade.ino +++ b/examples/SMA/Decoder_Dir_and_Fade/Decoder_Dir_and_Fade.ino @@ -101,7 +101,8 @@ void loop() // You MUST call the NmraDcc.process() method frequently from the Arduino loop() function for correct library operation Dcc.process(); } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { + +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { int f_index; switch (FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 @@ -145,7 +146,8 @@ void exec_function (int f_index, int FuncState) { Set_LED (f_index,false); } } -extern void notifyDccSpeed( uint16_t Addr, uint8_t Speed, uint8_t ForwardDir, uint8_t MaxSpeed ) { + +void notifyDccSpeed( uint16_t Addr, uint8_t Speed, uint8_t ForwardDir, uint8_t MaxSpeed ) { Last_Decoder_direction = Decoder_direction; Decoder_direction = ForwardDir; if ( Decoder_direction==Last_Decoder_direction) return; @@ -196,4 +198,5 @@ void Switch_LED (int Function) { delayMicroseconds (1000.*time_fraction); } led_last_state[Function] = end_state; -} +} + diff --git a/examples/SMA/Decoder_SMA12_LED_Groups/Decoder_SMA12_LED_Groups.ino b/examples/SMA/Decoder_SMA12_LED_Groups/Decoder_SMA12_LED_Groups.ino index ab1191a..7bc5fe6 100755 --- a/examples/SMA/Decoder_SMA12_LED_Groups/Decoder_SMA12_LED_Groups.ino +++ b/examples/SMA/Decoder_SMA12_LED_Groups/Decoder_SMA12_LED_Groups.ino @@ -123,7 +123,7 @@ void loop() Dcc.process(); } -extern void notifyDccFunc( uint16_t Addr, FN_GROUP FuncGrp, uint8_t FuncState) { +void notifyDccFunc( uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState) { int f_index; switch (FuncGrp) { case FN_0_4: //Function Group 1 F0 F4 F3 F2 F1 @@ -172,4 +172,5 @@ void exec_function (int f_index, int FuncState) { Last_Function_State[f_index] = false; } } - + +