#garfield Logs
Sep 19 2021
#garfield Calendar
01:43 AM rue_shop3: yes, there are usually a few things I want to have welded up, but when I have the chance I cant remmeber what htey are
12:18 PM rue_mohr: coding an eprom programmer
01:54 PM rue_mohr: Tom_L, your alive right?
03:44 PM Tom_L: barely
04:59 PM rue_mohr: Ill or nothin to do?
04:59 PM rue_mohr: do you know a company that exports stuff around there?
05:04 PM Tom_L: ill
05:20 PM rue_mohr: everyone seems to be comming down with not-covid latley
05:20 PM rue_mohr: bad cases of it too
05:27 PM rue_mohr: came up with an idea to make pinwise io easier on the avrs
05:27 PM rue_mohr: as I been playing with some arduino code latley
05:27 PM rue_mohr: typdef struct IOPin_s {
05:27 PM rue_mohr: uint8_t bit;
05:27 PM rue_mohr: uint8_t portPIN;
05:27 PM rue_mohr: } IOPin_t;
05:27 PM rue_mohr: so to set up a single pin, you
05:27 PM rue_mohr: IOPin_t foo = { 5, PINA };
05:28 PM rue_mohr: then you can use #define SetPin(P, L) (L)?SetBit(P.bit,P.portPIN+2):ClearBit(P.bit, P.portPIN+2)
05:28 PM rue_mohr: #define GetPin(P) IsHigh(P.bit,P.portPIN)
05:28 PM rue_mohr: #define DirPin(P, D) (D)?SetBit(P.bit,P.portPIN+1):ClearBit(P.bit,P.portPIN+1)
05:50 PM rue_mohr: erp, I cant quite do that
05:50 PM rue_mohr: how do I get the address of PINA
05:51 PM rue_mohr: #define PINA _SFR_IO8(0x19)
05:52 PM rue_mohr: #define _SFR_IO8(io_addr) ((io_addr) + __SFR_OFFSET)
05:52 PM rue_mohr: not that one tho
05:52 PM rue_mohr: #define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) + __SFR_OFFSET)
05:53 PM rue_mohr: #define _MMIO_BYTE(mem_addr) (*(volatile uint8_t *)(mem_addr))
06:04 PM spline: https://twitter.com/aarondfrancis/status/1438888219471491074
06:06 PM rue_mohr: there isn't
06:08 PM rue_mohr: heh, I caught it!
06:15 PM rue_mohr: well drat, I cant get the port number nicely as I cant undo the macro
06:15 PM rue_mohr: so
06:16 PM rue_mohr: but wait, its still a macro
06:16 PM rue_mohr: can I make an undo macro?
06:23 PM rue_mohr: can & undo * in a macro?
06:42 PM rue_mohr: I think it worked
07:14 PM rue_mohr: yea, coool
08:54 PM Tom_L: :)
09:42 PM rue_shop2: we will gradually file back in