Re: [cc65] Interrupt handlers in C as part of the C library ?

From: Oliver Schmidt <ol.sc1web.de>
Date: 2012-01-21 14:20:49
Hi Spiro,

>> /* Possible returns for irq_handler() */
>> #define IRQ_NOT_HANDLED       0
>> #define IRQ_HANDLED   1
>
> W/o having looked at the code: Why are the above returns needed?

There are translated to the Carry Clear / Carry Set values returned by
all cc65 irq handlers. Maybe consider looking at the code.

>> typedef unsigned (*irq_handler) (void);
>
> Bad style, I would highly advise to use the "int".

If you refer to the return value than this is how Uz wanted it to be -
or at least how I understood him that he wanted it to be.

> You never worked with some more or less official coding guideline, did
> you? ;)

To be honest I'm not sure where this type of question is supposed to
lead this thread - therefore opt to ignore it beside this general
statement. Please note that I noted the ";-)".

>> void __fastcall__ set_irq (irq_handler f, void *stack_addr, size_t stack_size);
>
> Just personal style:
>
> Instead of defining irq_handler as a type which is a pointer to a
> function, I would define irq_handler as a type which is the function.
> That way, the above two lines would look like:

This is just the very style in which the already existing function
set_brk() is typed.

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jan 21 14:20:55 2012

This archive was generated by hypermail 2.1.8 : 2012-01-21 14:20:59 CET