Changeset 790 for firmware/trunk/core/makingthings/system.c
- Timestamp:
- 08/06/08 14:29:39 (5 months ago)
- Files:
-
- 1 modified
-
firmware/trunk/core/makingthings/system.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
firmware/trunk/core/makingthings/system.c
r748 r790 62 62 @param state An integer specifying the state system 63 63 @return Zero on success. 64 65 \b Example 66 \code 67 // enable the System subsystem 68 System_SetActive(1); 69 \endcode 64 70 */ 65 71 int System_SetActive( int state ) … … 95 101 Returns the active state of the subsystem. 96 102 @return The active state of the subsystem - 1 (active) or 0 (inactive). 103 104 \b Example 105 \code 106 if(System_GetActive()) 107 { 108 // System is active 109 } 110 else 111 { 112 // System is inactive 113 } 114 \endcode 97 115 */ 98 116 int System_GetActive( ) … … 103 121 /** 104 122 Returns the free size of the heap. 123 The heap size is set in config.h in the constant CONTROLLER_HEAPSIZE. 124 Any calls to Malloc will take their memory from the heap. This allows 125 you to check how much heap is remaining. 105 126 @return The size free memory. 127 128 \b Example 129 \code 130 // see how much memory is available 131 int freemem = System_GetFreeMemory(); 132 \endcode 106 133 */ 107 134 int System_GetFreeMemory( void ) … … 111 138 112 139 /** 113 Gets the board's Serial Number. 140 Gets the board's Serial Number. 141 Each board has a serial number, although it's not necessarily unique 142 as you can reset it as you please. 143 144 The serial number is used to determine the Ethernet MAC address, so boards 145 on the same network need to have unique serial numbers. 114 146 @return CONTROLLER_OK ( = 0 ). 147 148 \b Example 149 \code 150 // get this board's serial number 151 int sernum = System_GetSerialNumber(); 152 \endcode 115 153 */ 116 154 int System_GetSerialNumber( void ) … … 123 161 124 162 /** 125 Sets the Serial Number. Note that this can be changed by the user at 163 Sets the Serial Number. 164 Note that this can be changed by the user at 126 165 any time, but that it is used in the \ref Network subsystem to form the last 127 166 two bytes of the network MAC address, so ideally units on the same network 128 167 should have unique serial numbers. 129 @return CONTROLLER_OK if OK. 168 @return 0 on success. 169 170 \b Example 171 \code 172 // set the serial number to 12345 173 System_SetSerialNumber(12345); 174 \endcode 130 175 */ 131 176 int System_SetSerialNumber( int serial ) … … 137 182 /** 138 183 Returns the board to SAM-BA mode, erasing the flash memory. 139 Leaves the board in a non-deterministic state awaiting a power cycle or reset. 140 @return CONTROLLER_OK if OK. 184 When a board is in SAM-BA mode, it is ready to have new firmware uploaded to it. 185 Note that you'll need to unplug/replug the board to complete the transition to 186 SAM-BA mode. 187 @param sure Confirm you're sure you want to do this. 188 @return 0 on success. 189 190 \b Example 191 \code 192 // prepare to be uploaded 193 System_SetSamba(1); 194 \endcode 141 195 */ 142 196 int System_SetSamba( int sure ) … … 168 222 /** 169 223 Gives the board a name. 170 The name must be alpha-numeric - only letters and numbers. 224 The name must be alpha-numeric - only letters and numbers. It can help you 225 determine one board from another when there are more than one connected to 226 your system. 171 227 @param name A string specifying the board's name 172 @return CONTROLLER_OK if OK. 228 @return 0 on success. 229 230 \b Example 231 \code 232 // give the board a special name 233 System_SetName("my very special controller"); 234 \endcode 173 235 */ 174 236 int System_SetName( char* name ) … … 193 255 Read the board's name. 194 256 @return The board's name as a string. 257 258 \b Example 259 \code 260 char* board_name = System_GetName(); 261 \endcode 195 262 */ 196 263 char* System_GetName( ) … … 234 301 Will reboot the board if the parameter sure is true. 235 302 @param sure confirms the request is true. 236 @return CONTROLLER_OK if OK. 303 @return 0 on success. 304 305 \b Example 306 \code 307 // reboot 308 System_SetReset(1); 309 \endcode 237 310 */ 238 311 int System_SetReset( int sure )
