#include "monitor.h"
#include "output.h"
-int main()
+int main(void)
{
output_init();
interface_init();
uint8_t cmd_buf[15];
uint8_t cmd_length;
-void process_commands();
-uint8_t process_command();
+void process_commands(void);
+uint8_t process_command(void);
-void interface_init()
+void interface_init(void)
{
DDRD = (DDRD&0xFC)|0x02;
serial_init(9600);
}
-void interface_check()
+void interface_check(void)
{
if(recv_overrun)
{
process_commands();
}
-void process_commands()
+void process_commands(void)
{
while(recv_fill>0)
{
}
}
-uint8_t process_command()
+uint8_t process_command(void)
{
uint8_t type = cmd_buf[0]>>4;
if(type==0)
extern uint8_t cmd_buf[];
extern uint8_t cmd_length;
-void interface_init();
-void interface_check();
+void interface_init(void);
+void interface_check(void);
#endif
volatile uint8_t adc_state = 0;
volatile uint16_t adc_value = 0;
-uint16_t track_current_milliamps();
-uint16_t input_voltage_millivolts();
+uint16_t track_current_milliamps(void);
+uint16_t input_voltage_millivolts(void);
-void monitor_init()
+void monitor_init(void)
{
adc_init();
}
-void monitor_check()
+void monitor_check(void)
{
if(!(adc_state&1))
{
}
}
-uint8_t monitor_command()
+uint8_t monitor_command(void)
{
if(cmd_buf[0]==READ_TRACK_CURRENT)
{
return COMMAND_OK;
}
-uint16_t track_current_milliamps()
+uint16_t track_current_milliamps(void)
{
uint16_t value = track_current_sum;
}
}
-uint16_t input_voltage_millivolts()
+uint16_t input_voltage_millivolts(void)
{
uint16_t value = input_voltage_sum;
#include <stdint.h>
-void monitor_init();
-void monitor_check();
-uint8_t monitor_command();
+void monitor_init(void);
+void monitor_check(void);
+uint8_t monitor_command(void);
#endif
packet.ready = 1;
}
-uint8_t motorola_command()
+uint8_t motorola_command(void)
{
if(cmd_buf[0]==MOTOROLA_SPEED || cmd_buf[0]==MOTOROLA_SPEED_DIRECTION || cmd_buf[0]==MOTOROLA_SPEED_FUNCTION)
{
void motorola_locomotive_speed_function_packet(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t);
void motorola_solenoid_packet(uint8_t, uint8_t, uint8_t);
void motorola_set_repeat_count(uint8_t);
-uint8_t motorola_command();
+uint8_t motorola_command(void);
#endif
uint8_t out_data;
uint8_t delay_time;
-void output_init()
+void output_init(void)
{
DDRD = (DDRD&0xF3)|0x0C;
PORTD &= ~BIT(ENABLE);
timer_start_hz(0, 80000, 1);
}
-void clear_packet()
+void clear_packet(void)
{
packet.ready = 0;
packet.sending = 0;
PORTD &= ~BIT(ENABLE);
}
-uint8_t output_command()
+uint8_t output_command(void)
{
if(cmd_buf[0]==POWER_ON || cmd_buf[0]==POWER_OFF)
{
return COMMAND_OK;
}
-static inline void output_tick()
+static inline void output_tick(void)
{
if(delay_time && --delay_time)
return;
extern OutputPacket packet;
-void output_init();
-void clear_packet();
+void output_init(void);
+void clear_packet(void);
void output_set_power(uint8_t);
-uint8_t output_command();
+uint8_t output_command(void);
#endif