#garfield Logs

May 21 2015

#garfield Calendar


00:17 rue_house ok
00:17 rue_house two objects
00:17 rue_house one wraps a ssls, notifier, and charreciever
00:18 rue_house the other wraps a ssls, genservo and ssc8
00:27 rue_house OK
00:27 rue_house first, the trainer
00:27 rue_house going in
00:28 rue_house port and config file
00:28 rue_house going out, a transBuffer
00:30 rue_house and the robot
00:30 rue_house going in, as output...
00:30 rue_house port, config
00:30 any92104904 sheesh, the cost of 4580 pcs of 74HC574 just quadrupled
00:30 rue_house going out, as input... transBuffer
00:30 any92104904 to $12.50 (plus s&h)
01:01 zhanx ok hackaday has my home automation trending as number 3 viewed page today
01:01 zhanx guess i better get back to coding
01:24 rue_house how the hell do I pass data to a callback function
01:24 rue_house zhanx, any92104904 !?
01:25 zhanx return (data)
01:25 any92104904 or return a ponter to the data
01:25 rue_house but I dont call it, it calls me
01:25 zhanx get a better phone
01:26 any92104904 function(pointer)
01:26 rue_house void charReciever(unsigned char * data) {
01:26 any92104904 oh, i don't do C
01:26 rue_house the serial subsystem calls this function when it has data
01:26 rue_house but I dont have any global variables for this fucntion to change
01:27 rue_house /callback mechanism
01:27 rue_house / use when you want to hear what it says without knowing when it may speak
01:27 rue_house Status_t SerStartNotifier(SSLS_t *this, void (*charHandler)(unsigned char*)) {
01:27 rue_house
01:27 rue_house // set callback fn.
01:27 rue_house this->charHandler = charHandler;
01:27 rue_house
01:27 rue_house // start thread
01:27 rue_house if( (pthread_create( &(this->monitorThread), NULL, (void * (*)(void *))&SerNotifierThread, this)) ){
01:27 rue_house printf("Failed to start serial monitor thread \n");
01:27 rue_house }
01:27 rue_house }
01:27 rue_house void *SerNotifierThread(SSLS_t *this) {
01:27 rue_house unsigned char data;
01:27 rue_house while(1) {
01:27 rue_house read(this->fd, &data, 1);
01:27 rue_house // printf("-%X", data);
01:27 rue_house this->charHandler(&data);
01:27 rue_house }
01:27 rue_house }
01:29 rue_house maybe I should rewrite it all with a NULL data pointer
01:29 rue_house er, void
01:29 rue_house THIS IS HOW i KNOW I'M CODING TOO LATE
01:32 any92104904 i never understand void, i mean if you are voiding it all, then why write it?
01:33 rue_house void *, a pointer to no data type
01:34 rue_house so it can be used for a pointer to any data type
01:34 any92104904 i wanted to learn C 20 yrs ago, someone told me the language was dead, because it was too complicated, and no one since has offered to give me a clue about C
01:34 any92104904 besides, no one would appreciate me using it, and the freaking usa gov won't let me sell anything if i do write a gadjet in C
01:35 rue_house voip *p; *(int *)p = 4; // casting 4 into the void
01:35 any92104904 voip is casting?
01:35 any92104904 what's with all teh * ? sparklies?
01:35 rue_house voip *p; *(float *)p = 3.1415926535; // casting a floating pie into the void
01:35 rue_house arg
01:36 rue_house void *p; *(float *)p = 3.1415926535; // casting a floating pie into the void
01:36 any92104904 makes no sense to me
01:36 rue_house the * says set the value at the address, the (float *) says to reffer to p not as a void * but a float *
01:37 rue_house int data; int * datapointer; datapointer = &data; *datapointer = 4;
01:37 rue_house alloc an integer and a pointer
01:38 rue_house point the pointer at the integer
01:38 any92104904 C is the least of my worries now, i am building a boat to leave humans on shore, so i can use a window fan and my life not be run by the neighbor's dogs
01:38 rue_house write 4 to the pointed memory
01:38 rue_house I was just making conversation, geez :)
01:38 any92104904 i was too, geese
01:39 e_house giggles and chases the g
01:39 any92104904 sorry
01:39 rue_house my eyes keep snapping shut
01:39 rue_house like when you cant tell your eyes closed cause your imagination totally took over
01:40 any92104904 don't use cyanoacrylic glues to hold them open, it stings
01:40 rue_house ok
01:40 rue_house I dont think it matters
01:40 any92104904 maybe if you imagine they are glued open
01:40 rue_house I noticed that when I'm really tired my eyes can be open and I just stop seeing thru them
01:41 rue_house its like the visual processing stops and the output buffer holds its last state
01:41 y92104904
01:42 e_house nods
01:42 any92104904 i notice that can happen when watching the dvd version of Colussus: the Forbin Project
01:43 any92104904 i think it's because they did the dvd in panavision and not the theatre wide screen it was originally done in
01:43 any92104904 or maybe i know the movie, and it's so simple
01:44 rue_house this callback function needs to utilize an object that I cant pass it a pointer to
01:44 rue_house maybe its time for rev 3 of my serial library
01:45 rue_house this library wasn't designed with the expectation of multiple instances
01:46 any92104904 did you know that at one time, the ussr had 5x more nuke subs at sea than the usa did?
01:46 rue_house v1 of this library was done in 2006
01:46 rue_house and what did it get them
01:47 rue_house sell the old ones to canada!
01:47 any92104904 i don't know that part
01:47 rue_house WE can pay to throw them out
01:47 any92104904 canada prefers to buy fireball subs from uk
01:47 rue_house cause we have idiot politicians who can be bought into thinking they are usefull
01:47 any92104904 damnit
01:48 rue_house spend 5x the money to refit them than to build one
01:48 any92104904 he won't say what i am doing to piss him off, same as Tom
01:48 any92104904 Canadia should buy them from Oz
01:49 any92104904 maybe oz has the bugs worked out by now
01:49 any92104904 the AIP diesels seem to be pretty darned good
02:02 y92104904 wanders
12:04 any96089335 trailer is off the boat deck and hooked to car, ready to go to town and be fitted for her bottom
12:04 any96089335 err, deck
17:23 any00453996 the trailer pulls *really* nicely on the back roads and interstate
17:24 any00453996 no weaving, bouncing was way limited
17:25 any00453996 twice i forgot it was back there, because i cannot see it in any rearview mirror
17:25 Tom_itx better put a flag on it
17:25 any00453996 it's maybe 2x as heavy as the baby trailer, the car just barely needs a lil of the turbo ton the really steep mountains on the highway
17:27 any00453996 i was thinking of 1ft tall fold-up light poles, at the rear corners, wired to the brake/running lites
17:29 any00453996 all the guys at the steel place came out and gave it a long look-over, said i did nice work
17:36 any00453996 i think i'll wash up, make a fish sammich, eat it during news, and then take a nap
17:36 any00453996 i didn't sleep last nite
17:37 any00453996 bbl
17:39 rue_bed I got nauzia today and came home from work
17:40 rue_bed you do do nice work