Skip to main content
Topic: Eric: patch for tiny bug (Read 3818 times) previous topic - next topic

Eric: patch for tiny bug

Hi

I just got my web platform kit and managed to compile+build your freertos just fine. However I got a couple of odd printf's on the serial port and the attached patch fixes it (basically a missing n).

--
Trygve

Re: Eric: patch for tiny bug

Reply #1
It seems I was a bit too fast, there's some code that had n in them which this patch removes as it seems from the rest of the code that it should be all without n.

--
Trygve

 

Re: Eric: patch for tiny bug

Reply #2
[quote author="trygvis"]
I just got my web platform kit and managed to compile+build your freertos just fine.
[/quote]

I'm glad you got it to work.  I haven't had any time to work on it in quite some time now. 

[quote author="trygvis"]
However I got a couple of odd printf's on the serial port and the attached patch fixes it (basically a missing n).
[/quote]

There is still a lot of cleaning up that needs to be done in the code.  One area in particular that I have not come up with a unified approach to is the logging.  Matt had started to write a logging daemon.  I was thinking of doing it a different way.  What's in there now is a mishmash. 

The past month+ has been crazy with the holidays.  I'm pretty busy at work right now.  I have some computer projects I need to get finished.  I'm probably going to be moving again soon.  Whenever I can get back to it though I plan to do some more work on this.

Thanks for taking a look at it.


-Eric

Re: Eric: patch for tiny bug

Reply #3
I applied this patch and committed to SVN. There was an error in the patch (unknown something on line 22), so I had to do it manually. Just a few lines so no big deal, but if there are more patches we should work it out :)

Could you please test the latest SVN code to make sure it still works for you?
Got a question? Please ask in the forum for the fastest answers.

Re: Eric: patch for tiny bug

Reply #4
Thanks, I'll test it when I get home. I had to manually edit the patch as I started on some different work at the same time.

I'm going to copy the code to a git repository as that'll make it easier to publish changes at the same time as I have stuff under version control.

Re: Eric: patch for tiny bug

Reply #5
Hi trygvis,

Did you fork the code? I'm keen to try and get some web pages running on the [tt:]FreeRTOS/port-eric[/tt:] branch, something more than a hello world. I would read/follow anything you've done in a public git repo that improves the platform first.

The FreeRTOS web server looks much more complex, and more difficult to modify than the single-packet http stateless model used by the tuxgraphics http server. Has anyone got anything near the complexity of the Microchip demo running on the RTOS stack?

Chris

Re: Eric: patch for tiny bug

Reply #6
Yeah, I forked it but forgot to push it to github. I'll try to do it later on today.

I haven't looked too much into the web stuff, but I did get the telnetd application to run. However, my goal is to control the hardware over HTTP and the httpd application that's included in the freertos distribution isn't very sophisticated so there's a bit of work to do.

What do you want to build?

--
Trygve

Re: Eric: patch for tiny bug

Reply #7
It's a heating controller for the UK. Multiple zones, LCD panel/joystick for controls  and http interface for configuration and charting. Not a commercial project, more a tinkering toy.

Inputs are 1-wire temperature controllers and outputs are triac drives for opening heating gate values.

I've the design started with a ARM CoretexM3 chip, using USB for the pc-link, but the software side of USB was becoming a real pain, so I ditched it for an Ethernet connection to the wireless router and do it web based. there are just enough pins on the web project to get the IO I need out - one UART for the 1wire bus line-driver and an I2C bus.

I think I can work within the constraints of the eeprom chip for now, so no need for SD card. I like the way that the microchip demo keeps the small 'active' portion of the site in c code, and for the remaining requests passes it through to a file-store. Very neat trick to re-write the contents of the flash over http-post. I need something like that as a first steps as would be really useful to tweak the HTML/Javascript portion without having to burn a new PIC firmware, or jack around with swapping a card to my desktop.

Re: Eric: patch for tiny bug

Reply #8
That sounds like a useful and fun application to make!

I just got myself a couple 74hc595 today to make me an IO expander which I'm looking into now.

--
Trygve

Re: Eric: patch for tiny bug

Reply #9
I've used the MCP23016 for IO expander, http://www.microchip.com/wwwproducts/De ... e=en010412. It's got 16 IO pins per device, bi-directional tri state drivers, interrupt line and I2C control + hardware switch-able address. Quite quick (400khz I2C bus). Being able to address a couple without extra addressing hardware is nice.

I have a little console which comprises an LCD screen plus joystick for the project. Using this chip I'm hoping to bit-bang the LCD drive signals. Sadly the screen leaves only 3 pins unused, which isn't  enough to handle the up/down/left/right/press joystick directly, so I need to multiplex it somehow without causing a lot of bus traffic i.e. polling.

I've come up with a scheme I think might work:
The joystick has 5 push-to-make switches with a common line at one side.  I think its possible to hold the common line high, then feeding the 5 switch inputs via diodes to a single input pin (with a 10k pull-down res), and also tie each switch output via fairly high resisters to the data bus D0 - D4 lines between the LCD the IO expander. The common input pin will be configured to signal interrupt on change to the CPU, so that the interrupt routine is invoked for the press of "any" position. When this happens, it needs to quickly switch the data bus pins to input rather than output, and ensure the LCD is disabled. I think if done quick enough it should be possible to still read which of the five directions was pressed from D0..D4 briefly after the bus settles. I'm using resistors because it will ensure that when the bus is being driven by the IO expander in output mode (as used to talk to the LCD) and the switch is initially pressed, the bus could be driven two directions, so while it might cause a bad read for that byte to the LCD, it should not cause any damage. I then probably need to repeat the last LCD command/drawing instruction after the push-button press is de-bounced since it could be corrupt.

If the reading isn't reliable (because it cant be done quick enough), I can probably put a small capacitor on each joystick pin that's charged by the press, and holds the bus briefly above the logic-input level, but doing that needs a second diode to prevent charging them from the bus signals.

Maybe it's cheaper/easier to use a second MCP23016 :-(

Re: Eric: patch for tiny bug

Reply #10
Ah, but I'm after driving a bunch of 8x8 led matrixes so my demands are IO only (for now at least) and I need them to update fast enough. It would be nice if Microchip had a SPI version of that chip. Maxim has some similar chips with SPI though.