NetBurner examples now accept pull requests, listed @ Github

Discussion to talk about software related topics only.
Post Reply
User avatar
Forrest
Posts: 289
Joined: Wed Apr 23, 2008 10:05 am

NetBurner examples now accept pull requests, listed @ Github

Post by Forrest »

We are in the process of adding most of our examples to Github. This will both allow prospective users a chance to examine the examples, and allow our current users the opportunity to submit fixes and features to these examples.

You can see the github repository at http://github.com/netburner

At this point, this is more of a preview for you, the forum community. Over the next few weeks we will be adding more examples, which include rewrites of some of our existing examples. We will also be integrating these examples directly to our releases, so that what you see on github is what will be included in upcoming NNDK releases.

One small note, the examples we have already uploaded include a new function init() and initWithWeb(). These helper functions include the default initialization functions you would normally find in the start of UserMain. You cannot build the examples on github without the new code, which will be released in the next 2.6.3 of the tools. If you really need to build the examples, you can add this init function to your code.

So the init function looks like this:

Code: Select all


#include <startnet.h>
#include <autoupdate.h>
#include <taskmon.h>
#include <dhcpclient.h>
#include <NetworkDebug.h>
#include <serial.h>

void init()
{
    SerialClose( 0 );               // Switch to IRQ serial I/O mode
    int fdSerial = OpenSerial( 0, 115200, 1, 8, eParityNone );
    ReplaceStdio( 0, fdSerial );    // stdin via UART 0
    ReplaceStdio( 1, fdSerial );    // stdout via UART 0
    ReplaceStdio( 2, fdSerial );    // stderr via UART 0

    InitializeStack();              // Initialize TCP/IP
    GetDHCPAddressIfNecessary();    // Set up networking, print IP address
    OSChangePrio( MAIN_PRIO );      // Set up this threads priority
    EnableAutoUpdate();             // Enable Autoupdate support
    EnableTaskMonitor();            // Enable Task Monitor support
    #ifdef _DEBUG                   // Set up network debugging
    InitializeNetworkGDB();
    #endif
}
and the initWithWeb calls init() and then starts HTTP.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: NetBurner examples now accept pull requests, listed @ Gi

Post by tod »

Where's the +1 button!
Post Reply