~ubuntu-branches/ubuntu/raring/vice/raring

« back to all changes in this revision

Viewing changes to src/rs232drv/rsuser.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2009-03-31 00:37:15 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20090331003715-mzclchtl0dp7fcl0
Tags: upstream-2.1.dfsg
ImportĀ upstreamĀ versionĀ 2.1.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include "resources.h"
45
45
#include "rs232drv.h"
46
46
#include "rsuser.h"
47
 
#ifdef HAS_TRANSLATION
48
47
#include "translate.h"
49
 
#endif
50
48
#include "types.h"
51
49
 
52
 
 
53
50
static int fd = -1;
54
51
 
55
52
static alarm_t *rsuser_alarm = NULL;
118
115
            /* if(clk_start_tx) rs232drv_putc(fd, rxdata); */
119
116
            rs232drv_close(fd);
120
117
        }
121
 
        alarm_unset(rsuser_alarm);
 
118
        if (rsuser_alarm)
 
119
            alarm_unset(rsuser_alarm);
122
120
        fd = -1;
123
121
    }
124
122
 
163
161
    return resources_register_int(resources_int);
164
162
}
165
163
 
166
 
#ifdef HAS_TRANSLATION
167
 
static const cmdline_option_t cmdline_options[] = {
168
 
    { "-rsuser", SET_RESOURCE, 0, NULL, NULL, "RsUserEnable", (void *)1,
169
 
      0, IDCLS_ENABLE_RS232_USERPORT },
170
 
    { "+rsuser", SET_RESOURCE, 0, NULL, NULL, "RsUserEnable", (void *)0,
171
 
      0, IDCLS_DISABLE_RS232_USERPORT },
172
 
    { "-rsuserbaud", SET_RESOURCE, 1, NULL, NULL, "RsUserBaud",
173
 
      (resource_value_t)300, IDCLS_P_BAUD,
174
 
      IDCLS_SET_BAUD_RS232_USERPORT },
175
 
    { "-rsuserdev", SET_RESOURCE, 1, NULL, NULL, "RsUserDev",
176
 
      (resource_value_t)0,
177
 
      IDCLS_P_0_3, IDCLS_SPECIFY_RS232_DEVICE_USERPORT },
178
 
    { NULL }
179
 
};
180
 
#else
181
 
static const cmdline_option_t cmdline_options[] = {
182
 
    { "-rsuser", SET_RESOURCE, 0, NULL, NULL, "RsUserEnable", (void *)1,
183
 
      NULL, N_("Enable RS232 userport emulation") },
184
 
    { "+rsuser", SET_RESOURCE, 0, NULL, NULL, "RsUserEnable", (void *)0,
185
 
      NULL, N_("Disable RS232 userport emulation") },
186
 
    { "-rsuserbaud", SET_RESOURCE, 1, NULL, NULL, "RsUserBaud",
187
 
      (resource_value_t)300, N_("<baud>"),
188
 
      N_("Set the baud rate of the RS232 userport emulation.") },
189
 
    { "-rsuserdev", SET_RESOURCE, 1, NULL, NULL, "RsUserDev",
190
 
      (resource_value_t)0,
191
 
      "<0-3>", N_("Specify VICE RS232 device for userport") },
192
 
    { NULL }
193
 
};
194
 
#endif
 
164
static const cmdline_option_t cmdline_options[] = {
 
165
    { "-rsuser", SET_RESOURCE, 0,
 
166
      NULL, NULL, "RsUserEnable", (void *)1,
 
167
      USE_PARAM_STRING, USE_DESCRIPTION_ID,
 
168
      IDCLS_UNUSED, IDCLS_ENABLE_RS232_USERPORT,
 
169
      NULL, NULL },
 
170
    { "+rsuser", SET_RESOURCE, 0,
 
171
      NULL, NULL, "RsUserEnable", (void *)0,
 
172
      USE_PARAM_STRING, USE_DESCRIPTION_ID,
 
173
      IDCLS_UNUSED, IDCLS_DISABLE_RS232_USERPORT,
 
174
      NULL, NULL },
 
175
    { "-rsuserbaud", SET_RESOURCE, 1,
 
176
      NULL, NULL, "RsUserBaud", (resource_value_t)300,
 
177
      USE_PARAM_ID, USE_DESCRIPTION_ID,
 
178
      IDCLS_P_BAUD, IDCLS_SET_BAUD_RS232_USERPORT,
 
179
      NULL, NULL },
 
180
    { "-rsuserdev", SET_RESOURCE, 1,
 
181
      NULL, NULL, "RsUserDev", (resource_value_t)0,
 
182
      USE_PARAM_STRING, USE_DESCRIPTION_ID,
 
183
      IDCLS_UNUSED, IDCLS_SPECIFY_RS232_DEVICE_USERPORT,
 
184
      "<0-3>", NULL },
 
185
    { NULL }
 
186
};
195
187
 
196
188
int rsuser_cmdline_options_init(void)
197
189
{
442
434
    if (clk_start_bit)
443
435
        clk_start_bit -= sub;
444
436
}
445