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.8k 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
      • H Offline
        H 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
        • H 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
          • H Offline
            H 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
            • H 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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              13

              Online

              12.0k

              Users

              11.2k

              Topics

              113.4k

              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