From: Mikko Rasa Date: Wed, 30 Oct 2013 21:59:50 +0000 (+0200) Subject: Mark module-private variables static X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4150740d3a5c2384289865923cef08c5852cb520;p=model-railway-devices.git Mark module-private variables static --- diff --git a/arducontrol/interface.c b/arducontrol/interface.c index c5a7262..a8ae2a2 100644 --- a/arducontrol/interface.c +++ b/arducontrol/interface.c @@ -10,7 +10,7 @@ static uint8_t cmd_buffer[15]; static uint8_t cmd_length = 0; static uint8_t cmd_read_pos = 0; -uint8_t dispatch_command(const uint8_t *, uint8_t); +static uint8_t dispatch_command(const uint8_t *, uint8_t); void interface_init(void) { @@ -61,7 +61,7 @@ void interface_check(void) } } -uint8_t dispatch_command(const uint8_t *cmd, uint8_t length) +static uint8_t dispatch_command(const uint8_t *cmd, uint8_t length) { uint8_t type = cmd[0]>>4; if(type==0) diff --git a/arducontrol/monitor.c b/arducontrol/monitor.c index d8f3dad..de00fc1 100644 --- a/arducontrol/monitor.c +++ b/arducontrol/monitor.c @@ -4,21 +4,21 @@ #include "output.h" #include "serial.h" -uint16_t track_current_samples[16] = { 0 }; -uint8_t track_current_head = 0; -volatile uint16_t track_current_sum = 0; -uint16_t overcurrent_limit = 8796; -uint8_t overcurrent_sent = 0; +static uint16_t track_current_samples[16] = { 0 }; +static uint8_t track_current_head = 0; +static volatile uint16_t track_current_sum = 0; +static uint16_t overcurrent_limit = 8796; +static uint8_t overcurrent_sent = 0; -uint16_t input_voltage_samples[16] = { 0 }; -uint8_t input_voltage_head = 0; -volatile uint16_t input_voltage_sum = 0; +static uint16_t input_voltage_samples[16] = { 0 }; +static uint8_t input_voltage_head = 0; +static volatile uint16_t input_voltage_sum = 0; -volatile uint8_t adc_state = 0; -volatile uint16_t adc_value = 0; +static volatile uint8_t adc_state = 0; +static volatile uint16_t adc_value = 0; -uint16_t track_current_milliamps(void); -uint16_t input_voltage_millivolts(void); +static uint16_t track_current_milliamps(void); +static uint16_t input_voltage_millivolts(void); void monitor_init(void) { @@ -113,7 +113,7 @@ uint8_t monitor_command(const uint8_t *cmd_buf, uint8_t cmd_length) return COMMAND_OK; } -uint16_t track_current_milliamps(void) +static uint16_t track_current_milliamps(void) { uint16_t value = track_current_sum; @@ -130,7 +130,7 @@ uint16_t track_current_milliamps(void) } } -uint16_t input_voltage_millivolts(void) +static uint16_t input_voltage_millivolts(void) { uint16_t value = input_voltage_sum; diff --git a/arducontrol/output.c b/arducontrol/output.c index b862ac3..3c94f70 100644 --- a/arducontrol/output.c +++ b/arducontrol/output.c @@ -8,10 +8,10 @@ #define BIT(x) (1<<(x)) OutputPacket packet; -uint8_t out_bit; -uint8_t out_time; -uint8_t out_data; -uint8_t delay_time; +static uint8_t out_bit; +static uint8_t out_time; +static uint8_t out_data; +static uint8_t delay_time; void output_init(void) { diff --git a/arducontrol/s88.c b/arducontrol/s88.c index bce0a2a..cfe5367 100644 --- a/arducontrol/s88.c +++ b/arducontrol/s88.c @@ -11,12 +11,12 @@ #define DATA PIN7 #define BIT(x) (1<<(x)) -volatile uint8_t s88_read_count = 0; -uint8_t s88_read_bit = 0; -volatile uint8_t s88_read_phase = 0; -uint8_t s88_data = 0; -RINGBUFFER(s88_buffer, 8); -uint8_t s88_out_index = 0; +static volatile uint8_t s88_read_count = 0; +static uint8_t s88_read_bit = 0; +static volatile uint8_t s88_read_phase = 0; +static uint8_t s88_data = 0; +static RINGBUFFER(s88_buffer, 8); +static uint8_t s88_out_index = 0; void s88_init(void) {