Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. if `MY_NODE_ID` is not AUTO

if `MY_NODE_ID` is not AUTO

Scheduled Pinned Locked Moved Development
6 Posts 3 Posters 1.6k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • magicwM Offline
    magicwM Offline
    magicw
    wrote on last edited by
    #1
    if (MY_NODE_ID != AUTO) {
    	// Set static id
           _nc.nodeId = MY_NODE_ID;
    	// Save static id in eeprom
    	hwWriteConfig(EEPROM_NODE_ID_ADDRESS, MY_NODE_ID);
    }
    

    In the stInitTransition function,if MY_NODE_ID is not AUTO,the code will write eeprom one time.if the node reset because some mistakes,It's to bad for the eeprom.Isn't it?

    1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2

      What do you mean?

      1 Reply Last reply
      0
      • hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by
        #3

        @magicw,

        It will only write to EEPROM if the value differs from the one already stored. So no, this won't affect EEPROM.

        magicwM 1 Reply Last reply
        0
        • hekH hek

          @magicw,

          It will only write to EEPROM if the value differs from the one already stored. So no, this won't affect EEPROM.

          magicwM Offline
          magicwM Offline
          magicw
          wrote on last edited by
          #4

          @hek For example,If i define MY_NODE_ID is 2,When the node reset,,the logic of this code will write the eeprom again(hwWriteConfig(EEPROM_NODE_ID_ADDRESS, MY_NODE_ID);). Isn't it?

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #5

            hwWriteConfig == eeprom_update_byte

            See doc:
            http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html

            update reads before writing

            magicwM 1 Reply Last reply
            0
            • hekH hek

              hwWriteConfig == eeprom_update_byte

              See doc:
              http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html

              update reads before writing

              magicwM Offline
              magicwM Offline
              magicw
              wrote on last edited by
              #6

              @magicw ok,thanks!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              12

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              Posts


              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular