X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=hw_clock.c;fp=hw_clock.c;h=a6c87b11b08bac58cfe0a7c0f23349c2512279ae;hp=83eaa8090598866838ed90df00dc88da81e1d0c1;hb=33efa05d43acf927c97daab10c00d1cbc2a7b9f6;hpb=d3c579a9b588b7f94fca88474ab2bd010f67a22f diff --git a/hw_clock.c b/hw_clock.c index 83eaa80..a6c87b1 100644 --- a/hw_clock.c +++ b/hw_clock.c @@ -39,7 +39,7 @@ void clock_cycle_(struct dcpu16 *vm, struct dcpu16_hw *hw) { if (clock->interrupt_message) { if (dcpu16_interrupt(vm, clock->interrupt_message)) - vm->warn_cb_("%s: could not send interrupt", hw->name_); + vm->warn_cb_("%s: could not send interrupt", hw->mod->name_); } } } @@ -87,8 +87,10 @@ void clock_data_free_(struct dcpu16_hw *hw) { } } -static struct dcpu16_hw hw_ = { + +struct dcpu16_hw_module dcpu16_hw_module_clock = { .name_ = "Generic Clock (compatible)", + .id_l = 0xb402, .id_h = 0x12d0, .ver = 0x0001, @@ -97,11 +99,7 @@ static struct dcpu16_hw hw_ = { .hwi = clock_hwi_, .cycle = clock_cycle_, .reset = clock_reset_, - .data = (struct clock_ *)NULL -}; -struct dcpu16_hw_module dcpu16_hw_module_clock = { - .template = &hw_, .data_init = clock_data_init_, .data_free = clock_data_free_, .ctl = NULL,