Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Luigi Thirty
Apr 30, 2006

Emergency confection port.

Awia posted:

on that note of doing c++ directly to arduino, how the gently caress do you do that? ive tried before with atmel studio but poo poo didn't work

http://www.visualmicro.com/ adds all the arduino junk to atmel studio/VS for you

Adbot
ADBOT LOVES YOU

yippee cahier
Mar 28, 2005

a couple things:
  • the RTOS i use at work's malloc() is configured to call sbrk() to allocate memory from the system heap. free() is a no-op. this is running on a more powerful chip than an arduino. check that your system does the right thing before using dynamic memory.
  • check the implementation of USART_Send_int for spinloops on a transmit complete status register or something else that shouldn't be in an ISR. a single character is probably going to be loaded into the transmit register and return immediately, but you might run into issues if you assume I/O works great in the interrupt context and you move on to sending long strings.
  • i'd put a critical section in Pop() and rearrange the operations to spend less time in it:
    code:
    CommandNode *temp;
    critsec_enter();	//or whatever your system uses
    temp = root;
    root = root->next;
    critsec_exit();
    //now you've got a pointer to the old root via temp and Push can't be
    //creating a new node that points to the root you're about to delete
    
    i'd look at doing something similar in Push as well, but I'd change it to a queue instead of a stack were i digging around in there. you might omit it as long as you are sure that Push would always be called from an ISR, but i wouldn't risk it, especially if you're writing general library code that might be used again elsewhere. think about what might happen if your interrupt fires and calls Push() during every line of your Pop() executing in your application, then think about what CPU instructions might compose that single line of C/C++... are pointer assignments atomic, have you omitted a volatile and the value won't be guaranteed to update the actual shared memory like a static variable outside your function until the end of a call, etc.? that can be exhausting and error-prone to worry about all the time, so in general just wrap modification of shared state in a critical section. if they get too long to execute quickly, you're going to have to find a different method of doing what you want to do.

yippee cahier fucked around with this message at 18:39 on Aug 9, 2015

Mahatma Goonsay
Jun 6, 2007
Yum
what are we gonna call this new serial protocol we are making? also you probably need a checksum if you are dropping characters.

Lime
Jul 20, 2004

hey i am always open to being wrong but i am pretty sure the command corruption is because of the thing i said earlier, have you tried that

Luigi Thirty
Apr 30, 2006

Emergency confection port.

changing the ISR to put the command into a buffer and set a flag when complete took care of the majority of the problem and now i have a readout! also, turns out i had a timing problem with my LCD routines that was the source of needing this whole mess in the first place.



Mahatma Goonsay posted:

what are we gonna call this new serial protocol we are making? also you probably need a checksum if you are dropping characters.

DSM-232

now it accepts packets containing vessel state information instead of just "draw this text here" commands too

oh no blimp issue
Feb 23, 2011

but, but...it has an altitude reading right there

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Awia posted:

but, but...it has an altitude reading right there

that's just so I know it's working :ssh:

the endgame is a giant red staging button with various read outs I can scroll through on the display

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Luigi Thirty posted:

that's just so I know it's working :ssh:

the endgame is a giant red staging button with various read outs I can scroll through on the display

does KSP have an api or are you doing something crazy?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

KSP has an API. I just wrote a plugin that grabs the vessel state information and shoves data out to the device.

oh no blimp issue
Feb 23, 2011

that's pretty cool

echinopsis
Apr 13, 2004

by Fluffdaddy

Mahatma Goonsay posted:

what are we gonna call this new serial protocol we are making? also you probably need a checksum if you are dropping characters.

CS-69

the CS stands for cleaveland steamaer

Luigi Thirty
Apr 30, 2006

Emergency confection port.

if parity bits are so cool why does everything use 9600,8,N,1?

Jerry Bindle
May 16, 2003

Luigi Thirty posted:

if parity bits are so cool why does everything use 9600,8,N,1?

a parity bit is the least you can do to detect, but not correct, a single bit error. if you want to do something more complicated than detect that a byte is corrupted, or detect a different type of corruption than a single bit error then you'll need some protocol above what the hardware provides. the hardware provided parity bit becomes less useful once you're doing error correction and detection in your protocol, may as well use 8n1 to get more bandwidth out of the channel.

Jerry Bindle
May 16, 2003
oh also 8n1 is very needs suiting for stuff in a non-industrial setting where there isn't a lot electrical interference.

BattleMaster
Aug 14, 2000

sund posted:

a couple things:
  • the RTOS i use at work's malloc() is configured to call sbrk() to allocate memory from the system heap. free() is a no-op. this is running on a more powerful chip than an arduino. check that your system does the right thing before using dynamic memory.

Lol what, did they just expect user code to just allocate memory once at startup and leave it at that?

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

BattleMaster posted:

Lol what, did they just expect user code to just allocate memory once at startup and leave it at that?
That's pretty normal for hard-realtime code.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

you know if you're really nuts you can hook up an SPI interface SRAM chip to the Arduino

I would say that one would be better served buying a more powerful board

such as the Raspberry Pi 2, which runs Windows 10.

BattleMaster
Aug 14, 2000

Luigi Thirty posted:

you know if you're really nuts you can hook up an SPI interface SRAM chip to the Arduino

I would say that one would be better served buying a more powerful board

such as the Raspberry Pi 2, which runs Windows 10.

in the embedded world there isn't much between 8-bit micros designed for running washing machine front panels and 32-bit multicores designed for running desktop OSes

hobbesmaster
Jan 28, 2008

BattleMaster posted:

in the embedded world there isn't much between 8-bit micros designed for running washing machine front panels and 32-bit multicores designed for running desktop OSes

i don't understand the arm cortex m0

Luigi Thirty
Apr 30, 2006

Emergency confection port.

BattleMaster posted:

in the embedded world there isn't much between 8-bit micros designed for running washing machine front panels and 32-bit multicores designed for running desktop OSes

your washer ran into a problem and needs to restart (ERR_UNBALANCED_LOAD) *door opens and floods house*

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i want a dumber house, not a smarter house. i want things i can fix myself with a soldering iron.

gonadic io
Feb 16, 2011

>>=

Cold on a Cob posted:

i want a dumber house, not a smarter house. i want things i can fix myself with a soldering iron.

Don't you want to turn on your soldering iron with your phone so that it's already hot and prepared for you as you walk through the door? What about your person soldering achievements??

jony neuemonic
Nov 13, 2009

gonadic io posted:

Don't you want to turn on your soldering iron with your phone so that it's already hot and prepared for you as you walk through the door?

*pocket-dials soldering iron, burns house down*

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

BattleMaster posted:

Lol what, did they just expect user code to just allocate memory once at startup and leave it at that?

ideally you don't actually alloc at all at runtime, and all "allocations" in your code compile/link down to offsets relative to a base address

I bet there are ways to leverage fancy type system tricks to let you write code that looks like it's doing dynamic allocation that actually winds up doing everything statically, or cause a compile or link error if you do something that really will require runtime dynamism so you can adjust buffer sizes, adjust code, etc.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

BattleMaster posted:

in the embedded world there isn't much between 8-bit micros designed for running washing machine front panels and 32-bit multicores designed for running desktop OSes

you run the washing machine itself using the microcontroller

the 32/64-bit multicore CPU with an adapted desktop OS is for running the washing machine's UI

gonadic io
Feb 16, 2011

>>=
lol if u can't change your washing machine's desktop background

Notorious b.s.d.
Jan 25, 2003

by Reene

eschaton posted:

you run the washing machine itself using the microcontroller

the 32/64-bit multicore CPU with an adapted desktop OS is for running the washing machine's UI

the microcontroller costs three cents, cut it. the rtos is another nickel, so it can go, too

also we outsourced to a webos consultancy in brazil, so it's all done on a single-threaded message pump in userspace. but it looks really cool

BattleMaster
Aug 14, 2000

internet of thangs

Soricidus
Oct 21, 2010
freedom-hating statist shill
I love being able to control your washing machine from my phone

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Notorious b.s.d. posted:

the microcontroller costs three cents, cut it. the rtos is another nickel, so it can go, too

also we outsourced to a webos consultancy in brazil, so it's all done on a single-threaded message pump in userspace. but it looks really cool

my washer is a sarnsung so I should be lucky it's not running android

AWWNAW
Dec 30, 2008

it's probably running Tizen though?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

AWWNAW posted:

it's probably running Tizen though?

that would probably be an improvement

i got the thing to do something useful too, show me my goddamn orbit parameters without needing mapview or mechjeb open. i wish i had a bigger screen than 2x16 or more readouts though. maybe i need one of those graphic LCDs.

i do have enough parts to put together an SPI-controlled 8-digit 7-segment display but i haven't been able to cram everything i need for that onto one breadboard so :barf: the footprint

Luigi Thirty fucked around with this message at 04:51 on Aug 12, 2015

Stringent
Dec 22, 2004


image text goes here

Luigi Thirty posted:

that would probably be an improvement

lol no

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

tizen is a crappy knockoff of anroid

pointers
Sep 4, 2008

BattleMaster posted:

internet of thongs

surebet
Jan 10, 2013

avatar
specialist


so we have a new web dev

"hey please add this google analytics snippet to the site: (link to my personal gh repo) it goes in the <head>"

sent that 2 fridays ago, last week i was on vacation, come back to the realisation that instead of adding the code as a sane person would he just pasted the link verbatim as the first <body> line and every loving page if the company site has been advertising my gh for a week

when i asked wtf wasn't clear about "put the code in the <head>" he explains that he doesn't understand what a <head> is

dude uses frontpage 2003 in strictly wysiwyg mode :woop:

so we have another new web dev

cowboy beepboop
Feb 24, 2001

lol you hired a web guy who can't web

Bloody
Mar 3, 2013

how is your hiring process that bad

surebet
Jan 10, 2013

avatar
specialist


yeah my client went with a bargain basement shop that does restaurant microsites because ~costs~

Adbot
ADBOT LOVES YOU

surebet
Jan 10, 2013

avatar
specialist


my local market is 50-75$ for a junior dev and 100-150 for a senior on a contractual basis, dude bid 45

he still managed to rack up thousands in billables which i'll be going over because there's no loving way stuff like changing 100 pictures from 10mp to 640*480 should take 3 hours when you don't do any actual work on them

hell, if you're not completely retarded you just install this https://imageresizer.codeplex.com/

he somehow got control of the domain though so that's going to be pretty lol to resolve

  • Locked thread