@@ -53,6 +53,7 @@ extern void setf5(void);
5353
5454#pragma data_seg("_CODE")
5555
56+ uint8_t get_fujinet_version ();
5657uint8_t get_set_time (uint8_t set_flag );
5758void check_uart ();
5859uint16_t parse_config (const uint8_t far * config_sys );
@@ -78,9 +79,11 @@ uint16_t Init_cmd(SYSREQ far *req)
7879 fujicom_init ();
7980 check_uart ();
8081
81- err = get_set_time (!getenv ("NOTIME" ));
82+ err = get_fujinet_version ();
83+ if (!err )
84+ err = get_set_time (!getenv ("NOTIME" ));
8285
83- // If get_set_time returned error, FujiNet is probably not connected
86+ // If get_ returned error, FujiNet is probably not connected
8487 if (err ) {
8588 fujicom_done ();
8689 return ERROR_BIT ;
@@ -121,6 +124,31 @@ uint16_t Init_cmd(SYSREQ far *req)
121124 return OP_COMPLETE ;
122125}
123126
127+ /* Returns non-zero on error */
128+ uint8_t get_fujinet_version ()
129+ {
130+ char reply = 0 ;
131+ AdapterConfig config ;
132+ unsigned int idx ;
133+
134+
135+ cmd .device = DEVICEID_FUJINET ;
136+ cmd .comnd = CMD_GET_ADAPTERCONFIG ;
137+ reply = fujicom_command_read (& cmd , (uint8_t * ) & config , sizeof (config ));
138+
139+ if (reply != 'C' ) {
140+ consolef ("Unable to get FujiNet version %i.\nAborted.\n" , reply );
141+ return 1 ;
142+ }
143+
144+ consolef ("FujiNet firmware version " );
145+ for (idx = 0 ; idx < sizeof (config .fn_version ) && config .fn_version [idx ]; idx ++ )
146+ printChar (config .fn_version [idx ]);
147+ consolef ("\n" );
148+
149+ return 0 ;
150+ }
151+
124152/* Returns non-zero on error */
125153uint8_t get_set_time (uint8_t set_flag )
126154{
0 commit comments